pod-builder 1.9.2 → 2.0.0.beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/Example/Frameworks/.gitignore +6 -0
- data/Example/Frameworks/.pod_builder/pod_builder +0 -0
- data/Example/Frameworks/PodBuilder.json +10 -4
- data/Example/Frameworks/Podfile +23 -0
- data/Example/Frameworks/Podfile.restore +40 -0
- data/Example/PodBuilderExample.xcodeproj/project.pbxproj +3 -8
- data/Example/{PodBuilderExample.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist → PodBuilderExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist} +2 -8
- data/Example/PodBuilderExample/AppDelegate.swift +4 -0
- data/Example/Podfile +44 -1
- data/Example/Podfile.lock +426 -7
- data/Example/Pods-acknowledgements.md +210 -0
- data/Example/Pods-acknowledgements.plist +206 -0
- data/README.md +38 -1
- data/exe/pod_builder +14 -14
- data/lib/pod_builder/analyze.rb +32 -7
- data/lib/pod_builder/analyzer.rb +16 -0
- data/lib/pod_builder/command/build.rb +110 -96
- data/lib/pod_builder/command/clean.rb +9 -11
- data/lib/pod_builder/command/clear_lldbinit.rb +1 -1
- data/lib/pod_builder/command/deintegrate.rb +2 -1
- data/lib/pod_builder/command/generate_lfs.rb +2 -2
- data/lib/pod_builder/command/install_sources.rb +1 -1
- data/lib/pod_builder/command/switch.rb +99 -99
- data/lib/pod_builder/command/sync_podfile.rb +2 -1
- data/lib/pod_builder/command/update.rb +1 -1
- data/lib/pod_builder/command/update_lldbinit.rb +2 -2
- data/lib/pod_builder/configuration.rb +62 -7
- data/lib/pod_builder/core.rb +60 -5
- data/lib/pod_builder/info.rb +24 -90
- data/lib/pod_builder/install.rb +149 -83
- data/lib/pod_builder/podfile.rb +87 -14
- data/lib/pod_builder/podfile/post_actions.rb +0 -1
- data/lib/pod_builder/podfile_item.rb +152 -74
- data/lib/pod_builder/podspec.rb +125 -133
- data/lib/pod_builder/rome/post_install.rb +248 -0
- data/lib/pod_builder/rome/pre_install.rb +6 -0
- data/lib/pod_builder/templates/build_podfile.template +1 -1
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +4 -4
- metadata +32 -64
- data/Example/Pods/Alamofire/LICENSE +0 -19
- data/Example/Pods/Alamofire/README.md +0 -242
- data/Example/Pods/Alamofire/Source/AFError.swift +0 -460
- data/Example/Pods/Alamofire/Source/Alamofire.swift +0 -465
- data/Example/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +0 -37
- data/Example/Pods/Alamofire/Source/MultipartFormData.swift +0 -580
- data/Example/Pods/Alamofire/Source/NetworkReachabilityManager.swift +0 -233
- data/Example/Pods/Alamofire/Source/Notifications.swift +0 -55
- data/Example/Pods/Alamofire/Source/ParameterEncoding.swift +0 -483
- data/Example/Pods/Alamofire/Source/Request.swift +0 -654
- data/Example/Pods/Alamofire/Source/Response.swift +0 -567
- data/Example/Pods/Alamofire/Source/ResponseSerialization.swift +0 -715
- data/Example/Pods/Alamofire/Source/Result.swift +0 -300
- data/Example/Pods/Alamofire/Source/ServerTrustPolicy.swift +0 -307
- data/Example/Pods/Alamofire/Source/SessionDelegate.swift +0 -725
- data/Example/Pods/Alamofire/Source/SessionManager.swift +0 -896
- data/Example/Pods/Alamofire/Source/TaskDelegate.swift +0 -466
- data/Example/Pods/Alamofire/Source/Timeline.swift +0 -136
- data/Example/Pods/Alamofire/Source/Validation.swift +0 -315
- data/Example/Pods/Manifest.lock +0 -16
- data/Example/Pods/Pods.xcodeproj/project.pbxproj +0 -673
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Alamofire.xcscheme +0 -60
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Pods-PodBuilderExample.xcscheme +0 -60
- data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -21
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-dummy.m +0 -5
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +0 -12
- data/Example/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +0 -16
- data/Example/Pods/Target Support Files/Alamofire/Alamofire.modulemap +0 -6
- data/Example/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +0 -9
- data/Example/Pods/Target Support Files/Alamofire/Info.plist +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Info.plist +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.markdown +0 -26
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.plist +0 -58
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-dummy.m +0 -5
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-frameworks.sh +0 -153
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-resources.sh +0 -118
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-umbrella.h +0 -16
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.debug.xcconfig +0 -11
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.modulemap +0 -6
- data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.release.xcconfig +0 -11
- data/lib/pod_builder/cocoapods/specification.rb +0 -27
@@ -16,7 +16,7 @@ module PodBuilder
|
|
16
16
|
end
|
17
17
|
|
18
18
|
lldbinit_path = File.expand_path(argument_pods[0])
|
19
|
-
lldbinit_content = File.
|
19
|
+
lldbinit_content = File.exist?(lldbinit_path) ? File.read(lldbinit_path) : ""
|
20
20
|
|
21
21
|
lldbinit_lines = []
|
22
22
|
skipNext = false
|
@@ -39,7 +39,8 @@ module PodBuilder
|
|
39
39
|
PodBuilder::safe_rm_rf(Configuration.base_path)
|
40
40
|
|
41
41
|
Dir.chdir(PodBuilder::project_path)
|
42
|
-
|
42
|
+
bundler_prefix = Configuration.use_bundler ? "bundle exec " : ""
|
43
|
+
system("#{bundler_prefix}pod install;")
|
43
44
|
|
44
45
|
license_base = PodBuilder::project_path(Configuration.license_filename)
|
45
46
|
FileUtils.rm_f("#{license_base}.plist")
|
@@ -13,8 +13,8 @@ module PodBuilder
|
|
13
13
|
gitattributes_excludes = ["*.h", "*.hh", "*.m", "*.mm", "*.i", "*.c", "*.cc", "*.cxx", "*.cpp", "*.def", "*.inc", "*.inl", "*.swift", "*.modulemap", "*.strings", "*.png", "*.jpg", "*.gif", "*.html", "*.htm", "*.js", "*.json", "*.xml", "*.txt", "*.md", "*.rb", "*.sh", "*.py", "*.plist", "*.resolved", ".*", "README*", "LICENSE*"]
|
14
14
|
|
15
15
|
gitattributes_includes_frameworks = ["**/* filter=lfs diff=lfs merge=lfs !text"]
|
16
|
-
write_attributes(PodBuilder::
|
17
|
-
write_attributes(PodBuilder::
|
16
|
+
write_attributes(PodBuilder::prebuiltpath, gitattributes_includes_frameworks, gitattributes_excludes)
|
17
|
+
write_attributes(PodBuilder::dsympath, gitattributes_includes_frameworks, gitattributes_excludes)
|
18
18
|
|
19
19
|
if Configuration.lfs_include_pods_folder
|
20
20
|
gitattributes_includes_pods = ["**/*.framework/**/* filter=lfs diff=lfs merge=lfs !text"]
|
@@ -12,7 +12,7 @@ module PodBuilder
|
|
12
12
|
framework_items = Analyze.podfile_items(installer, analyzer).select { |x| !x.is_prebuilt }
|
13
13
|
podspec_names = framework_items.map(&:podspec_name)
|
14
14
|
|
15
|
-
base_path = PodBuilder::
|
15
|
+
base_path = PodBuilder::prebuiltpath
|
16
16
|
framework_files = Dir.glob("#{base_path}/**/*.framework")
|
17
17
|
|
18
18
|
framework_files.each do |path|
|
@@ -12,108 +12,130 @@ module PodBuilder
|
|
12
12
|
unless argument_pods.count > 0
|
13
13
|
return -1
|
14
14
|
end
|
15
|
-
unless argument_pods.count == 1
|
16
|
-
raise "\n\nSpecify a single pod to switch\n\n".red
|
17
|
-
end
|
18
|
-
|
19
|
-
pod_name_to_switch = argument_pods.first
|
20
|
-
|
21
|
-
check_not_building_subspec(pod_name_to_switch)
|
22
15
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
options[:switch_mode] = request_switch_mode(pod_name_to_switch, podfile_item)
|
16
|
+
pod_names_to_switch = []
|
17
|
+
argument_pods.each do |pod|
|
18
|
+
pod_name_to_switch = pod
|
19
|
+
pod_name_to_switch = Podfile::resolve_pod_names_from_podfile([pod_name_to_switch]).first
|
20
|
+
raise "\n\nDid not find pod '#{pod}'" if pod_name_to_switch.nil?
|
21
|
+
|
22
|
+
check_not_building_subspec(pod_name_to_switch)
|
31
23
|
|
32
|
-
|
33
|
-
return 0
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
if options[:switch_mode] == "prebuilt"
|
38
|
-
check_prebuilded(pod_name_to_switch)
|
24
|
+
pod_names_to_switch.push(pod_name_to_switch)
|
39
25
|
end
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
next
|
54
|
-
end
|
55
|
-
|
56
|
-
if pod_name.include?("/")
|
57
|
-
podfile_items = all_buildable_items.select { |x| x.name == pod_name }
|
58
|
-
else
|
59
|
-
podfile_items = all_buildable_items.select { |x| x.root_name == pod_name }
|
26
|
+
|
27
|
+
pod_names_to_switch.each do |pod_name_to_switch|
|
28
|
+
development_path = ""
|
29
|
+
default_entries = Hash.new
|
30
|
+
|
31
|
+
case options[:switch_mode]
|
32
|
+
when "development"
|
33
|
+
development_path = find_podspec(pod_name_to_switch)
|
34
|
+
when "prebuilt"
|
35
|
+
podfile_path = PodBuilder::basepath("Podfile.restore")
|
36
|
+
content = File.read(podfile_path)
|
37
|
+
if !content.include?("pod '#{pod_name_to_switch}")
|
38
|
+
raise "\n\n'#{pod_name_to_switch}' does not seem to be prebuit!"
|
60
39
|
end
|
61
|
-
|
62
|
-
|
63
|
-
|
40
|
+
when "default"
|
41
|
+
podfile_path = PodBuilder::basepath("Podfile")
|
42
|
+
content = File.read(podfile_path)
|
43
|
+
|
44
|
+
current_section = ""
|
45
|
+
content.each_line do |line|
|
46
|
+
stripped_line = line.strip
|
47
|
+
if stripped_line.start_with?("def ") || stripped_line.start_with?("target ")
|
48
|
+
current_section = line.split(" ")[1]
|
49
|
+
next
|
50
|
+
end
|
51
|
+
|
52
|
+
matches = line.gsub("\"", "'").match(/pod '(.*?)',(.*)/)
|
53
|
+
if matches&.size == 3
|
54
|
+
if matches[1].split("/").first == pod_name_to_switch
|
55
|
+
default_entries[current_section] = line
|
56
|
+
end
|
57
|
+
end
|
64
58
|
end
|
59
|
+
|
60
|
+
raise "\n\n'#{pod_name_to_switch}' not found in #{podfile_path}" if default_entries.keys.count == 0
|
61
|
+
end
|
65
62
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
63
|
+
podfile_path = PodBuilder::project_path("Podfile")
|
64
|
+
content = File.read(podfile_path)
|
65
|
+
|
66
|
+
lines = []
|
67
|
+
current_section = ""
|
68
|
+
content.each_line do |line|
|
69
|
+
stripped_line = line.strip
|
70
|
+
if stripped_line.start_with?("def ") || stripped_line.start_with?("target ")
|
71
|
+
current_section = line.split(" ")[1]
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
|
74
|
+
matches = line.gsub("\"", "'").match(/pod '(.*?)',(.*)/)
|
75
|
+
if matches&.size == 3
|
76
|
+
if matches[1].split("/").first == pod_name_to_switch
|
77
|
+
case options[:switch_mode]
|
78
|
+
when "prebuilt"
|
79
|
+
indentation = line.split("pod '").first
|
80
|
+
rel_path = Pathname.new(PodBuilder::prebuiltpath).relative_path_from(Pathname.new(PodBuilder::project_path)).to_s
|
81
|
+
prebuilt_line = "#{indentation}pod '#{matches[1]}', :path => '#{rel_path}'\n"
|
82
|
+
if line.include?("# pb<") && marker = line.split("# pb<").last
|
83
|
+
prebuilt_line = prebuilt_line.chomp("\n") + " # pb<#{marker}"
|
84
|
+
end
|
85
|
+
lines.append(prebuilt_line)
|
86
|
+
next
|
87
|
+
when "development"
|
88
|
+
indentation = line.split("pod '").first
|
89
|
+
rel_path = Pathname.new(development_path).relative_path_from(Pathname.new(PodBuilder::project_path)).to_s
|
90
|
+
development_line = "#{indentation}pod '#{matches[1]}', :path => '#{rel_path}'\n"
|
91
|
+
if line.include?("# pb<") && marker = line.split("# pb<").last
|
92
|
+
development_line = development_line.chomp("\n") + " # pb<#{marker}"
|
93
|
+
end
|
94
|
+
|
95
|
+
lines.append(development_line)
|
96
|
+
next
|
97
|
+
when "default"
|
98
|
+
if default_line = default_entries[current_section]
|
99
|
+
if line.include?("# pb<") && marker = line.split("# pb<").last
|
100
|
+
default_line = default_line.chomp("\n") + " # pb<#{marker}"
|
101
|
+
end
|
102
|
+
lines.append(default_line)
|
103
|
+
next
|
104
|
+
elsif
|
105
|
+
raise "Line for pod '#{matches[1]}' in section '#{current_section}' not found in PodBuilder's Podfile"
|
106
|
+
end
|
107
|
+
else
|
108
|
+
raise "Unsupported mode '#{options[:switch_mode]}'"
|
109
|
+
end
|
110
|
+
end
|
76
111
|
end
|
77
|
-
podfile_item = podfile_item.dup
|
78
112
|
|
79
|
-
|
80
|
-
|
81
|
-
case options[:switch_mode]
|
82
|
-
when "prebuilt"
|
83
|
-
line = indentation + podfile_item.prebuilt_entry + "\n"
|
84
|
-
when "development"
|
85
|
-
podfile_item.path = find_podspec(podfile_item)
|
86
|
-
podfile_item.is_external = true
|
87
|
-
|
88
|
-
line = indentation + podfile_item.entry + "\n"
|
89
|
-
when "default"
|
90
|
-
line = indentation + podfile_item.entry + "\n"
|
91
|
-
else
|
92
|
-
break
|
93
|
-
end
|
113
|
+
lines.append(line)
|
94
114
|
end
|
95
115
|
|
96
|
-
|
116
|
+
File.write(podfile_path, lines.join)
|
97
117
|
end
|
98
118
|
|
99
|
-
File.write(podfile_path, pod_lines.join)
|
100
|
-
|
101
119
|
Dir.chdir(PodBuilder::project_path)
|
102
|
-
|
120
|
+
bundler_prefix = Configuration.use_bundler ? "bundle exec " : ""
|
121
|
+
system("#{bundler_prefix}pod install;")
|
103
122
|
|
104
123
|
return 0
|
105
124
|
end
|
106
125
|
|
107
126
|
private
|
108
127
|
|
109
|
-
def self.find_podspec(
|
128
|
+
def self.find_podspec(podname)
|
110
129
|
unless Configuration.development_pods_paths.count > 0
|
111
130
|
raise "\n\nPlease add the development pods path(s) in #{Configuration.dev_pods_configuration_filename} as per documentation\n".red
|
112
131
|
end
|
113
132
|
|
114
133
|
podspec_path = nil
|
115
134
|
Configuration.development_pods_paths.each do |path|
|
116
|
-
|
135
|
+
if Pathname.new(path).relative?
|
136
|
+
path = PodBuilder::basepath(path)
|
137
|
+
end
|
138
|
+
podspec = Dir.glob(File.expand_path("#{path}/**/#{podname}*.podspec*"))
|
117
139
|
podspec.select! { |x| !x.include?("/Local Podspecs/") }
|
118
140
|
podspec.select! { |x| Dir.glob(File.join(File.dirname(x), "*")).count > 1 } # exclude podspec folder (which has one file per folder)
|
119
141
|
if podspec.count > 0
|
@@ -123,39 +145,17 @@ module PodBuilder
|
|
123
145
|
end
|
124
146
|
|
125
147
|
if podspec_path.nil?
|
126
|
-
raise "\n\nCouln't find `#{
|
148
|
+
raise "\n\nCouln't find `#{podname}` sources in the following specified development pod paths:\n#{Configuration.development_pods_paths.join("\n")}\n".red
|
127
149
|
end
|
128
150
|
|
129
151
|
return podspec_path
|
130
152
|
end
|
131
|
-
|
132
|
-
def self.request_switch_mode(pod_name, podfile_item)
|
133
|
-
matches = podfile_item.entry.match(/(pod '.*?',)(.*)('.*')/)
|
134
|
-
unless matches&.size == 4
|
135
|
-
raise "\n\nFailed matching pod name\n".red
|
136
|
-
end
|
137
|
-
|
138
|
-
default_entry = matches[3].strip
|
139
|
-
|
140
|
-
modes = ["prebuilt", "development", "default"]
|
141
|
-
mode_indx = ask("\n\nSwitch #{pod_name} to:\n1) Prebuilt\n2) Development pod\n3) Default (#{default_entry})\n\n") { |x| x.limit = 1, x.validate = /[1-3]/ }
|
142
|
-
|
143
|
-
return modes[mode_indx.to_i - 1]
|
144
|
-
end
|
145
|
-
|
153
|
+
|
146
154
|
def self.check_not_building_subspec(pod_to_switch)
|
147
155
|
if pod_to_switch.include?("/")
|
148
156
|
raise "\n\nCan't switch subspec #{pod_to_switch} refer to podspec name.\n\nUse `pod_builder switch #{pod_to_switch.split("/").first}` instead\n\n".red
|
149
157
|
end
|
150
158
|
end
|
151
|
-
|
152
|
-
private
|
153
|
-
|
154
|
-
def self.check_prebuilded(pod_name)
|
155
|
-
if !Podspec.include?(pod_name)
|
156
|
-
raise "\n\n#{pod_name} is not prebuilt.\n\nRun 'pod_builder build #{pod_name}'\n".red
|
157
|
-
end
|
158
|
-
end
|
159
159
|
end
|
160
160
|
end
|
161
161
|
end
|
@@ -21,7 +21,8 @@ module PodBuilder
|
|
21
21
|
Licenses::write([], all_buildable_items)
|
22
22
|
|
23
23
|
if previous_podfile_content != updated_podfile_content
|
24
|
-
|
24
|
+
bundler_prefix = Configuration.use_bundler ? "bundle exec " : ""
|
25
|
+
system("#{bundler_prefix}pod install;")
|
25
26
|
end
|
26
27
|
|
27
28
|
return 0
|
@@ -22,7 +22,7 @@ module PodBuilder
|
|
22
22
|
app_podfile_content = File.read(PodBuilder::project_path("Podfile"))
|
23
23
|
|
24
24
|
lldbinit_path = File.expand_path(argument_pods[0])
|
25
|
-
lldbinit_content = File.
|
25
|
+
lldbinit_content = File.exist?(lldbinit_path) ? File.read(lldbinit_path) : ""
|
26
26
|
status_hash = podfiles_status_hash(app_podfile_content, podfile_restore_content)
|
27
27
|
if lldbinit_content.include?("# <pb_md5:#{base_path}:#{status_hash}")
|
28
28
|
puts "\n\n🎉 already in sync!\n".green
|
@@ -125,7 +125,7 @@ module PodBuilder
|
|
125
125
|
puts "Writing #{lldbinit_path}".yellow
|
126
126
|
|
127
127
|
FileUtils.touch(lldbinit_path)
|
128
|
-
raise "\n\nDestination file should be a file" unless File.
|
128
|
+
raise "\n\nDestination file should be a file" unless File.exist?(lldbinit_path)
|
129
129
|
|
130
130
|
lldbinit_lines = []
|
131
131
|
skipNext = false
|
@@ -22,10 +22,14 @@ module PodBuilder
|
|
22
22
|
DEFAULT_SKIP_PODS = ["GoogleMaps"]
|
23
23
|
DEFAULT_FORCE_PREBUILD_PODS = ["Firebase", "GoogleTagManager"]
|
24
24
|
DEFAULT_BUILD_SYSTEM = "Legacy".freeze # either Latest (New build system) or Legacy (Standard build system)
|
25
|
+
DEFAULT_LIBRARY_EVOLUTION_SUPPORT = false
|
25
26
|
MIN_LFS_SIZE_KB = 256.freeze
|
27
|
+
DEFAULT_PLATFORMS = ["iphoneos", "iphonesimulator", "appletvos", "appletvsimulator"].freeze
|
28
|
+
DEFAULT_BUILD_FOR_APPLE_SILICON = false
|
26
29
|
|
27
30
|
private_constant :DEFAULT_BUILD_SETTINGS
|
28
31
|
private_constant :DEFAULT_BUILD_SYSTEM
|
32
|
+
private_constant :DEFAULT_LIBRARY_EVOLUTION_SUPPORT
|
29
33
|
private_constant :MIN_LFS_SIZE_KB
|
30
34
|
|
31
35
|
class <<self
|
@@ -33,6 +37,7 @@ module PodBuilder
|
|
33
37
|
attr_accessor :build_settings
|
34
38
|
attr_accessor :build_settings_overrides
|
35
39
|
attr_accessor :build_system
|
40
|
+
attr_accessor :library_evolution_support
|
36
41
|
attr_accessor :base_path
|
37
42
|
attr_accessor :spec_overrides
|
38
43
|
attr_accessor :skip_licenses
|
@@ -51,13 +56,19 @@ module PodBuilder
|
|
51
56
|
attr_accessor :project_name
|
52
57
|
attr_accessor :restore_enabled
|
53
58
|
attr_accessor :framework_plist_filename
|
54
|
-
attr_accessor :
|
59
|
+
attr_accessor :lockfile_name
|
60
|
+
attr_accessor :lockfile_path
|
61
|
+
attr_accessor :use_bundler
|
62
|
+
attr_accessor :deterministic_build
|
63
|
+
attr_accessor :supported_platforms
|
64
|
+
attr_accessor :build_for_apple_silicon
|
55
65
|
end
|
56
66
|
|
57
67
|
@allow_building_development_pods = false
|
58
68
|
@build_settings = DEFAULT_BUILD_SETTINGS
|
59
69
|
@build_settings_overrides = {}
|
60
70
|
@build_system = DEFAULT_BUILD_SYSTEM
|
71
|
+
@library_evolution_support = DEFAULT_LIBRARY_EVOLUTION_SUPPORT
|
61
72
|
@base_path = "Frameworks" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
|
62
73
|
@spec_overrides = DEFAULT_SPEC_OVERRIDE
|
63
74
|
@skip_licenses = []
|
@@ -66,8 +77,8 @@ module PodBuilder
|
|
66
77
|
@license_filename = "Pods-acknowledgements"
|
67
78
|
@subspecs_to_split = []
|
68
79
|
@development_pods_paths = []
|
69
|
-
@build_base_path = "/tmp/
|
70
|
-
@build_path =
|
80
|
+
@build_base_path = "/tmp/pod_builder".freeze
|
81
|
+
@build_path = build_base_path
|
71
82
|
@configuration_filename = "PodBuilder.json".freeze
|
72
83
|
@dev_pods_configuration_filename = "PodBuilderDevPodsPaths.json".freeze
|
73
84
|
@lfs_min_file_size = MIN_LFS_SIZE_KB
|
@@ -76,7 +87,14 @@ module PodBuilder
|
|
76
87
|
@project_name = ""
|
77
88
|
@restore_enabled = true
|
78
89
|
@framework_plist_filename = "PodBuilder.plist"
|
79
|
-
@
|
90
|
+
@lockfile_name = "PodBuilder.lock"
|
91
|
+
@lockfile_path = "/tmp/#{lockfile_name}"
|
92
|
+
|
93
|
+
@use_bundler = false
|
94
|
+
@deterministic_build = false
|
95
|
+
|
96
|
+
@supported_platforms = DEFAULT_PLATFORMS
|
97
|
+
@build_for_apple_silicon = DEFAULT_BUILD_FOR_APPLE_SILICON
|
80
98
|
|
81
99
|
def self.check_inited
|
82
100
|
raise "\n\nNot inited, run `pod_builder init`\n".red if podbuilder_path.nil?
|
@@ -106,17 +124,17 @@ module PodBuilder
|
|
106
124
|
end
|
107
125
|
end
|
108
126
|
if value = json["skip_licenses"]
|
109
|
-
if value.is_a?(Array)
|
127
|
+
if value.is_a?(Array)
|
110
128
|
Configuration.skip_licenses = value
|
111
129
|
end
|
112
130
|
end
|
113
131
|
if value = json["skip_pods"]
|
114
|
-
if value.is_a?(Array)
|
132
|
+
if value.is_a?(Array)
|
115
133
|
Configuration.skip_pods = value
|
116
134
|
end
|
117
135
|
end
|
118
136
|
if value = json["force_prebuild_pods"]
|
119
|
-
if value.is_a?(Array)
|
137
|
+
if value.is_a?(Array)
|
120
138
|
Configuration.force_prebuild_pods = value
|
121
139
|
end
|
122
140
|
end
|
@@ -135,6 +153,11 @@ module PodBuilder
|
|
135
153
|
Configuration.build_system = value
|
136
154
|
end
|
137
155
|
end
|
156
|
+
if value = json["library_evolution_support"]
|
157
|
+
if [TrueClass, FalseClass].include?(value.class)
|
158
|
+
Configuration.library_evolution_support = value
|
159
|
+
end
|
160
|
+
end
|
138
161
|
if value = json["license_filename"]
|
139
162
|
if value.is_a?(String) && value.length > 0
|
140
163
|
Configuration.license_filename = value
|
@@ -170,8 +193,25 @@ module PodBuilder
|
|
170
193
|
Configuration.allow_building_development_pods = value
|
171
194
|
end
|
172
195
|
end
|
196
|
+
if value = json["use_bundler"]
|
197
|
+
if [TrueClass, FalseClass].include?(value.class)
|
198
|
+
Configuration.use_bundler = value
|
199
|
+
end
|
200
|
+
end
|
201
|
+
if value = json["deterministic_build"]
|
202
|
+
if [TrueClass, FalseClass].include?(value.class)
|
203
|
+
Configuration.deterministic_build = value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
if value = json["build_for_apple_silicon"]
|
207
|
+
if [TrueClass, FalseClass].include?(value.class)
|
208
|
+
Configuration.build_for_apple_silicon = value
|
209
|
+
end
|
210
|
+
end
|
173
211
|
|
174
212
|
Configuration.build_settings.freeze
|
213
|
+
|
214
|
+
sanity_check()
|
175
215
|
else
|
176
216
|
write
|
177
217
|
end
|
@@ -188,6 +228,11 @@ module PodBuilder
|
|
188
228
|
Configuration.development_pods_paths = json || []
|
189
229
|
Configuration.development_pods_paths.freeze
|
190
230
|
end
|
231
|
+
|
232
|
+
if !deterministic_build
|
233
|
+
build_path = "#{build_base_path}#{(Time.now.to_f * 1000).to_i}"
|
234
|
+
lockfile_path = File.join(PodBuilder::home, lockfile_name)
|
235
|
+
end
|
191
236
|
end
|
192
237
|
|
193
238
|
def self.write
|
@@ -201,6 +246,7 @@ module PodBuilder
|
|
201
246
|
config["build_settings"] = Configuration.build_settings
|
202
247
|
config["build_settings_overrides"] = Configuration.build_settings_overrides
|
203
248
|
config["build_system"] = Configuration.build_system
|
249
|
+
config["library_evolution_support"] = Configuration.library_evolution_support
|
204
250
|
config["license_filename"] = Configuration.license_filename
|
205
251
|
config["subspecs_to_split"] = Configuration.subspecs_to_split
|
206
252
|
config["lfs_update_gitattributes"] = Configuration.lfs_update_gitattributes
|
@@ -210,6 +256,14 @@ module PodBuilder
|
|
210
256
|
end
|
211
257
|
|
212
258
|
private
|
259
|
+
|
260
|
+
def self.sanity_check
|
261
|
+
Configuration.skip_pods.each do |pod|
|
262
|
+
if Configuration.force_prebuild_pods.include?(pod)
|
263
|
+
puts "PodBuilder.json contains '#{pod}' both in `force_prebuild_pods` and `skip_pods`. Will force prebuilding.".yellow
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
213
267
|
|
214
268
|
def self.config_path
|
215
269
|
unless path = podbuilder_path
|
@@ -221,6 +275,7 @@ module PodBuilder
|
|
221
275
|
|
222
276
|
def self.podbuilder_path
|
223
277
|
paths = Dir.glob("#{PodBuilder::home}/**/.pod_builder")
|
278
|
+
paths.reject! { |t| t.match(/pod-builder-.*\/Example\/Frameworks\/\.pod_builder$/i) }
|
224
279
|
raise "\n\nToo many .pod_builder found `#{paths.join("\n")}`\n".red if paths.count > 1
|
225
280
|
|
226
281
|
return paths.count > 0 ? File.dirname(paths.first) : nil
|