cocoapods-binary-cache 0.1.5 → 0.1.10

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocoapods-binary-cache/cache/validation_result.rb +4 -0
  3. data/lib/cocoapods-binary-cache/cache/validator.rb +1 -1
  4. data/lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb +7 -2
  5. data/lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb +20 -25
  6. data/lib/cocoapods-binary-cache/dependencies_graph/graph_visualizer.rb +29 -38
  7. data/lib/cocoapods-binary-cache/diagnosis/diagnosis.rb +9 -1
  8. data/lib/cocoapods-binary-cache/diagnosis/integration.rb +7 -3
  9. data/lib/cocoapods-binary-cache/env.rb +1 -1
  10. data/lib/cocoapods-binary-cache/helper/checksum.rb +10 -4
  11. data/lib/cocoapods-binary-cache/helper/lockfile.rb +1 -1
  12. data/lib/cocoapods-binary-cache/helper/podspec.rb +4 -2
  13. data/lib/cocoapods-binary-cache/hooks/post_install.rb +2 -12
  14. data/lib/cocoapods-binary-cache/hooks/pre_install.rb +22 -39
  15. data/lib/cocoapods-binary-cache/main.rb +0 -1
  16. data/lib/cocoapods-binary-cache/pod-binary/helper/build.rb +37 -0
  17. data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/installer.rb +2 -2
  18. data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/target_definition.rb +2 -9
  19. data/lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb +15 -14
  20. data/lib/cocoapods-binary-cache/pod-binary/helper/target_checker.rb +7 -10
  21. data/lib/cocoapods-binary-cache/pod-binary/integration.rb +1 -2
  22. data/lib/cocoapods-binary-cache/pod-binary/integration/alter_specs.rb +4 -1
  23. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb +1 -1
  24. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/resolve_dependencies.rb +0 -3
  25. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/sandbox_analyzer_state.rb +29 -0
  26. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb +27 -12
  27. data/lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb +57 -62
  28. data/lib/cocoapods-binary-cache/pod-binary/prebuild.rb +45 -121
  29. data/lib/cocoapods-binary-cache/pod-binary/prebuild_dsl.rb +2 -63
  30. data/lib/cocoapods-binary-cache/pod-binary/prebuild_hook.rb +0 -1
  31. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb +195 -0
  32. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb +48 -0
  33. data/lib/cocoapods-binary-cache/prebuild_output/output.rb +7 -5
  34. data/lib/cocoapods-binary-cache/state_store.rb +16 -6
  35. data/lib/command/binary.rb +20 -1
  36. data/lib/command/config.rb +177 -8
  37. data/lib/command/executor/base.rb +9 -1
  38. data/lib/command/executor/fetcher.rb +5 -3
  39. data/lib/command/executor/prebuilder.rb +9 -7
  40. data/lib/command/executor/pusher.rb +2 -0
  41. data/lib/command/executor/visualizer.rb +3 -2
  42. data/lib/command/fetch.rb +0 -1
  43. data/lib/command/prebuild.rb +19 -3
  44. data/lib/command/push.rb +0 -1
  45. metadata +9 -11
  46. data/lib/cocoapods-binary-cache/pod-binary/helper/feature_switches.rb +0 -52
  47. data/lib/cocoapods-binary-cache/pod-binary/helper/passer.rb +0 -25
  48. data/lib/cocoapods-binary-cache/pod-binary/integration/remove_target_files.rb +0 -29
  49. data/lib/cocoapods-binary-cache/pod-binary/tool/tool.rb +0 -12
  50. data/lib/cocoapods-binary-cache/pod-rome/build_framework.rb +0 -248
  51. data/lib/cocoapods-binary-cache/scheme_editor.rb +0 -35
@@ -13,8 +13,9 @@ module PodPrebuild
13
13
  def run
14
14
  FileUtils.mkdir_p(@output_dir)
15
15
  graph = DependenciesGraph.new(@lockfile)
16
- graph.write_graphic_file("png", "#{@output_dir}/graph", Set.new)
17
- `open #{@output_dir}/graph.png` if @open
16
+ output_path = "#{@output_dir}/graph.png"
17
+ graph.write_graphic_file(output_path: output_path)
18
+ system("open #{@output_path}") if @open
18
19
  end
19
20
  end
20
21
  end
@@ -5,7 +5,6 @@ module Pod
5
5
  class Binary < Command
6
6
  class Fetch < Binary
7
7
  self.arguments = [CLAide::Argument.new("CACHE-BRANCH", false)]
8
-
9
8
  def initialize(argv)
10
9
  super
11
10
  @fetcher = PodPrebuild::CacheFetcher.new(
@@ -5,24 +5,40 @@ module Pod
5
5
  class Command
6
6
  class Binary < Command
7
7
  class Prebuild < Binary
8
+ attr_reader :prebuilder
9
+
8
10
  self.arguments = [CLAide::Argument.new("CACHE-BRANCH", false)]
9
11
  def self.options
10
12
  [
11
- ["--push", "Push cache to repo upon completion"]
12
- ]
13
+ ["--config", "Config (Debug, Test...) to prebuild"],
14
+ ["--repo-update", "Update pod repo before installing"],
15
+ ["--no-fetch", "Do not perform a cache fetch beforehand"],
16
+ ["--push", "Push cache to repo upon completion"],
17
+ ["--all", "Prebuild all binary pods regardless of cache validation"],
18
+ ["--targets", "Targets to prebuild. Use comma (,) to specify a list of targets"]
19
+ ].concat(super)
13
20
  end
14
21
 
15
22
  def initialize(argv)
16
23
  super
24
+ prebuild_all_pods = argv.flag?("all")
25
+ prebuild_targets = argv.option("targets", "").split(",")
26
+ update_cli_config(
27
+ :prebuild_job => true,
28
+ :prebuild_all_pods => prebuild_all_pods,
29
+ :prebuild_config => argv.option("config")
30
+ )
31
+ update_cli_config(:prebuild_targets => prebuild_targets) unless prebuild_all_pods
17
32
  @prebuilder = PodPrebuild::CachePrebuilder.new(
18
33
  config: prebuild_config,
19
34
  cache_branch: argv.shift_argument || "master",
35
+ repo_update: argv.flag?("repo-update"),
36
+ no_fetch: argv.flag?("fetch") == false,
20
37
  push_cache: argv.flag?("push")
21
38
  )
22
39
  end
23
40
 
24
41
  def run
25
- Pod::Podfile::DSL.prebuild_job = true
26
42
  @prebuilder.run
27
43
  end
28
44
  end
@@ -5,7 +5,6 @@ module Pod
5
5
  class Binary < Command
6
6
  class Push < Binary
7
7
  self.arguments = [CLAide::Argument.new("CACHE-BRANCH", false)]
8
-
9
8
  def initialize(argv)
10
9
  super
11
10
  @pusher = PodPrebuild::CachePusher.new(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binary-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bang Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
@@ -129,11 +129,10 @@ files:
129
129
  - lib/cocoapods-binary-cache/hooks/pre_install.rb
130
130
  - lib/cocoapods-binary-cache/main.rb
131
131
  - lib/cocoapods-binary-cache/pod-binary/LICENSE.txt
132
+ - lib/cocoapods-binary-cache/pod-binary/helper/build.rb
132
133
  - lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/installer.rb
133
134
  - lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/target_definition.rb
134
- - lib/cocoapods-binary-cache/pod-binary/helper/feature_switches.rb
135
135
  - lib/cocoapods-binary-cache/pod-binary/helper/names.rb
136
- - lib/cocoapods-binary-cache/pod-binary/helper/passer.rb
137
136
  - lib/cocoapods-binary-cache/pod-binary/helper/podfile_options.rb
138
137
  - lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb
139
138
  - lib/cocoapods-binary-cache/pod-binary/helper/target_checker.rb
@@ -141,19 +140,18 @@ files:
141
140
  - lib/cocoapods-binary-cache/pod-binary/integration/alter_specs.rb
142
141
  - lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb
143
142
  - lib/cocoapods-binary-cache/pod-binary/integration/patch/resolve_dependencies.rb
143
+ - lib/cocoapods-binary-cache/pod-binary/integration/patch/sandbox_analyzer_state.rb
144
144
  - lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb
145
- - lib/cocoapods-binary-cache/pod-binary/integration/remove_target_files.rb
146
145
  - lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb
147
146
  - lib/cocoapods-binary-cache/pod-binary/integration/validation.rb
148
147
  - lib/cocoapods-binary-cache/pod-binary/prebuild.rb
149
148
  - lib/cocoapods-binary-cache/pod-binary/prebuild_dsl.rb
150
149
  - lib/cocoapods-binary-cache/pod-binary/prebuild_hook.rb
151
- - lib/cocoapods-binary-cache/pod-binary/tool/tool.rb
152
150
  - lib/cocoapods-binary-cache/pod-rome/LICENSE.txt
153
- - lib/cocoapods-binary-cache/pod-rome/build_framework.rb
151
+ - lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb
152
+ - lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb
154
153
  - lib/cocoapods-binary-cache/prebuild_output/metadata.rb
155
154
  - lib/cocoapods-binary-cache/prebuild_output/output.rb
156
- - lib/cocoapods-binary-cache/scheme_editor.rb
157
155
  - lib/cocoapods-binary-cache/state_store.rb
158
156
  - lib/cocoapods-binary-cache/ui.rb
159
157
  - lib/cocoapods_plugin.rb
@@ -188,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
186
  - !ruby/object:Gem::Version
189
187
  version: '0'
190
188
  requirements: []
191
- rubygems_version: 3.0.8
189
+ rubygems_version: 3.0.3
192
190
  signing_key:
193
191
  specification_version: 4
194
192
  summary: Reduce build time by building pod frameworks and cache to remote storage,
@@ -1,52 +0,0 @@
1
- require_relative "../tool/tool"
2
- require_relative "prebuild_sandbox"
3
-
4
- module Pod
5
- # a force disable option for integral
6
- class Installer
7
- def self.force_disable_integration(value)
8
- @@force_disable_integration = value
9
- end
10
-
11
- old_method = instance_method(:integrate_user_project)
12
- define_method(:integrate_user_project) do
13
- if @@force_disable_integration
14
- return
15
- end
16
- old_method.bind(self).()
17
- end
18
- end
19
-
20
- # a option to disable install complete message
21
- class Installer
22
- def self.disable_install_complete_message(value)
23
- @@disable_install_complete_message = value
24
- end
25
-
26
- old_method = instance_method(:print_post_install_message)
27
- define_method(:print_post_install_message) do
28
- if @@disable_install_complete_message
29
- return
30
- end
31
- old_method.bind(self).()
32
- end
33
- end
34
-
35
- # option to disable write lockfiles
36
- class Config
37
- @@force_disable_write_lockfile = false
38
- def self.force_disable_write_lockfile(value)
39
- @@force_disable_write_lockfile = value
40
- end
41
-
42
- old_method = instance_method(:lockfile_path)
43
- define_method(:lockfile_path) do
44
- if @@force_disable_write_lockfile
45
- # As config is a singleton, sandbox_root refer to the standard sandbox.
46
- return PrebuildSandbox.from_standard_sanbox_path(sandbox_root).root + "Manifest.lock.tmp"
47
- else
48
- return old_method.bind(self).()
49
- end
50
- end
51
- end
52
- end
@@ -1,25 +0,0 @@
1
- require_relative "../tool/tool"
2
-
3
- module Pod
4
- class Prebuild
5
- # Pass the data between the 2 steps
6
- #
7
- # At step 2, the normal pod install, it needs some info of the
8
- # prebuilt step. So we store it here.
9
- #
10
- class Passer
11
- # indicate the add/remove/update of prebuit pods
12
- # @return [Analyzer::SpecsState]
13
- #
14
- class_attr_accessor :prebuild_pods_changes
15
-
16
- # Some pod won't be build in prebuild stage even if it have `binary=>true`.
17
- # The targets of this pods have `oshould_build? == true`.
18
- # We should skip integration (patch spec) for this pods
19
- #
20
- # @return [Array<String>]
21
- class_attr_accessor :target_names_to_skip_integration_framework
22
- self.target_names_to_skip_integration_framework = []
23
- end
24
- end
25
- end
@@ -1,29 +0,0 @@
1
- module Pod
2
- class Installer
3
- # Remove the old target files if prebuild frameworks changed
4
- def remove_target_files_if_needed
5
- changes = Pod::Prebuild::Passer.prebuild_pods_changes
6
- updated_names = []
7
- if changes.nil?
8
- updated_names = PrebuildSandbox.from_standard_sandbox(sandbox).exsited_framework_pod_names
9
- else
10
- added = changes.added
11
- changed = changes.changed
12
- deleted = changes.deleted
13
- updated_names = added + changed + deleted
14
- end
15
-
16
- updated_names.each do |name|
17
- root_name = Specification.root_name(name)
18
- next if sandbox.local?(root_name)
19
-
20
- UI.message "Delete cached files: #{root_name}"
21
- target_path = sandbox.pod_dir(root_name)
22
- target_path.rmtree if target_path.exist?
23
-
24
- support_path = sandbox.target_support_files_dir(root_name)
25
- support_path.rmtree if support_path.exist?
26
- end
27
- end
28
- end
29
- end
@@ -1,12 +0,0 @@
1
- # attr_accessor for class variable.
2
- # usage:
3
- #
4
- # ```
5
- # class Pod
6
- # class_attr_accessor :is_prebuild_stage
7
- # end
8
- # ```
9
- #
10
- def class_attr_accessor(symbol)
11
- self.class.send(:attr_accessor, symbol)
12
- end
@@ -1,248 +0,0 @@
1
- require 'fourflusher'
2
- require 'xcpretty' # TODO (thuyen): Revise this dependency
3
-
4
- module FileUtils
5
- def self.mvpath(src, dst, **options)
6
- FileUtils.rm_rf(File.join(dst, File.basename(src)))
7
- FileUtils.mv(src, dst, **options)
8
- end
9
- end
10
-
11
- PLATFORMS = { 'iphonesimulator' => 'iOS',
12
- 'appletvsimulator' => 'tvOS',
13
- 'watchsimulator' => 'watchOS' }
14
-
15
- # Build specific target to framework file
16
- # @param [PodTarget] target
17
- # a specific pod target
18
- #
19
- def build_for_iosish_platform(sandbox,
20
- build_dir,
21
- output_path,
22
- target,
23
- configuration,
24
- device,
25
- simulator,
26
- bitcode_enabled,
27
- custom_build_options = [], # Array<String>
28
- custom_build_options_simulator = [], # Array<String>
29
- enable_device_build = false
30
- )
31
-
32
- deployment_target = target.platform.deployment_target.to_s
33
-
34
- target_label = target.label # name with platform if it's used in multiple platforms
35
- Pod::UI.puts "Prebuilding #{target_label}..."
36
-
37
- other_options = []
38
- # bitcode enabled
39
- other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled
40
- # make less arch to iphone simulator for faster build
41
- custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'
42
-
43
- # paths
44
- target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms.
45
- module_name = target.product_module_name
46
- device_framework_path = "#{build_dir}/#{configuration}-#{device}/#{target_name}/#{module_name}.framework"
47
- simulator_framework_path = "#{build_dir}/#{configuration}-#{simulator}/#{target_name}/#{module_name}.framework"
48
- simulator_target_products_path = "#{build_dir}/#{configuration}-#{simulator}/#{target_name}"
49
-
50
- if !Dir.exist?(simulator_framework_path)
51
- is_succeed, = xcodebuild(
52
- sandbox,
53
- target_label,
54
- configuration,
55
- simulator,
56
- deployment_target,
57
- other_options + custom_build_options_simulator
58
- )
59
- raise "Build simulator framework failed: #{target_label}" unless is_succeed
60
- else
61
- puts "Simulator framework already exist at: #{simulator_framework_path}"
62
- end
63
-
64
- unless enable_device_build
65
- FileUtils.cp_r Dir["#{simulator_target_products_path}/*"], output_path
66
- return
67
- end
68
-
69
- if !Dir.exist?(device_framework_path)
70
- is_succeed, = xcodebuild(
71
- sandbox,
72
- target_label,
73
- configuration,
74
- device,
75
- deployment_target,
76
- other_options + custom_build_options
77
- )
78
- raise "Build device framework failed: #{target_label}" unless is_succeed
79
- else
80
- puts "Device framework already exist at: #{device_framework_path}"
81
- end
82
-
83
- device_binary = device_framework_path + "/#{module_name}"
84
- simulator_binary = simulator_framework_path + "/#{module_name}"
85
- return unless File.file?(device_binary) && File.file?(simulator_binary)
86
-
87
- # the device_lib path is the final output file path
88
- # combine the binaries
89
- tmp_lipoed_binary_path = "#{build_dir}/#{target_name}"
90
- lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`
91
- puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
92
- FileUtils.mvpath tmp_lipoed_binary_path, device_binary
93
-
94
- # collect the swiftmodule file for various archs.
95
- device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule"
96
- simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule"
97
- if File.exist?(device_swiftmodule_path)
98
- FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
99
- end
100
-
101
- # combine the generated swift headers
102
- # (In xcode 10.2, the generated swift headers vary for each archs)
103
- # https://github.com/leavez/cocoapods-binary/issues/58
104
- simulator_generated_swift_header_path = simulator_framework_path + "/Headers/#{module_name}-Swift.h"
105
- device_generated_swift_header_path = device_framework_path + "/Headers/#{module_name}-Swift.h"
106
- if File.exist? simulator_generated_swift_header_path
107
- device_header = File.read(device_generated_swift_header_path)
108
- simulator_header = File.read(simulator_generated_swift_header_path)
109
- # https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461
110
- combined_header_content = %Q{
111
- #if TARGET_OS_SIMULATOR // merged by cocoapods-binary
112
-
113
- #{simulator_header}
114
-
115
- #else // merged by cocoapods-binary
116
-
117
- #{device_header}
118
-
119
- #endif // merged by cocoapods-binary
120
- }
121
- File.write(device_generated_swift_header_path, combined_header_content.strip)
122
- end
123
-
124
- # handle the dSYM files
125
- device_dsym = "#{device_framework_path}.dSYM"
126
- if File.exist? device_dsym
127
- # lipo the simulator dsym
128
- simulator_dsym = "#{simulator_framework_path}.dSYM"
129
- if File.exist? simulator_dsym
130
- tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
131
- lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`
132
- puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
133
- FileUtils.mvpath tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}"
134
- end
135
- FileUtils.mvpath device_dsym, output_path
136
- end
137
-
138
- # output
139
- output_path.mkpath unless output_path.exist?
140
- FileUtils.mvpath device_framework_path, output_path
141
- end
142
-
143
- def xcodebuild(sandbox, target, configuration, sdk='macosx', deployment_target=nil, other_options=[])
144
- args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{configuration} -sdk #{sdk} )
145
- platform = PLATFORMS[sdk]
146
- args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
147
- args += other_options
148
-
149
- args_str = args.join(" ")
150
- cmd = "xcodebuild #{args_str} 2>&1"
151
- puts "xcodebuild command: #{cmd}"
152
- log = `#{cmd}`
153
-
154
- exit_code = $?.exitstatus # Process::Status
155
- is_succeed = (exit_code == 0)
156
-
157
- if !is_succeed
158
- begin
159
- if log.include?('** BUILD FAILED **')
160
- # use xcpretty to print build log
161
- # 64 represent command invalid. http://www.manpagez.com/man/3/sysexits/
162
- printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => 'auto'})
163
- log.each_line do |line|
164
- printer.pretty_print(line)
165
- end
166
- else
167
- raise "shouldn't be handle by xcpretty"
168
- end
169
- rescue
170
- puts log.red
171
- end
172
- end
173
- [is_succeed, log]
174
- end
175
-
176
- module Pod
177
- class Prebuild
178
- def self.build(options)
179
- sandbox_root_path = options[:sandbox_root_path]
180
- target = options[:target]
181
- configuration = options[:configuration]
182
- output_path = options[:output_path]
183
- bitcode_enabled = options[:bitcode_enabled] || false
184
- device_build_enabled = options[:device_build_enabled] || false
185
- custom_build_options = options[:custom_build_options] || []
186
- custom_build_options_simulator = options[:custom_build_options_simulator] || []
187
-
188
- return if target.nil?
189
-
190
- sandbox_root = Pathname(sandbox_root_path)
191
- sandbox = Pod::Sandbox.new(sandbox_root)
192
- build_dir = self.build_dir(sandbox_root)
193
-
194
- # -- build the framework
195
- case target.platform.name
196
- when :ios
197
- build_for_iosish_platform(
198
- sandbox,
199
- build_dir,
200
- output_path,
201
- target,
202
- configuration,
203
- "iphoneos",
204
- "iphonesimulator",
205
- bitcode_enabled,
206
- custom_build_options,
207
- custom_build_options_simulator,
208
- device_build_enabled
209
- )
210
- when :osx
211
- xcodebuild(
212
- sandbox,
213
- target.label,
214
- configuration,
215
- "macosx",
216
- nil,
217
- custom_build_options
218
- )
219
- # when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
220
- when :watchos
221
- build_for_iosish_platform(
222
- sandbox,
223
- build_dir,
224
- output_path,
225
- target,
226
- configuration,
227
- "watchos",
228
- "watchsimulator",
229
- true,
230
- custom_build_options,
231
- custom_build_options_simulator,
232
- device_build_enabled
233
- )
234
- else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end
235
-
236
- raise Pod::Informative, "The build directory was not found in the expected location" unless build_dir.directory?
237
- end
238
-
239
- def self.remove_build_dir(sandbox_root)
240
- path = build_dir(sandbox_root)
241
- path.rmtree if path.exist?
242
- end
243
-
244
- def self.build_dir(sandbox_root)
245
- sandbox_root.parent + "build"
246
- end
247
- end
248
- end