cocoapods-binary-cache 0.1.2 → 0.1.8

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 (59) 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 +2 -3
  4. data/lib/cocoapods-binary-cache/cache/validator_base.rb +28 -8
  5. data/lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb +7 -2
  6. data/lib/cocoapods-binary-cache/cache/validator_dev_pods.rb +21 -13
  7. data/lib/cocoapods-binary-cache/cache/validator_non_dev_pods.rb +1 -1
  8. data/lib/cocoapods-binary-cache/dependencies_graph/dependencies_graph.rb +20 -25
  9. data/lib/cocoapods-binary-cache/dependencies_graph/graph_visualizer.rb +29 -38
  10. data/lib/cocoapods-binary-cache/diagnosis/base.rb +13 -0
  11. data/lib/cocoapods-binary-cache/diagnosis/diagnosis.rb +24 -0
  12. data/lib/cocoapods-binary-cache/diagnosis/integration.rb +23 -0
  13. data/lib/cocoapods-binary-cache/env.rb +32 -0
  14. data/lib/cocoapods-binary-cache/helper/checksum.rb +10 -4
  15. data/lib/cocoapods-binary-cache/helper/lockfile.rb +26 -3
  16. data/lib/cocoapods-binary-cache/helper/podspec.rb +5 -1
  17. data/lib/cocoapods-binary-cache/helper/prebuild_order.rb +12 -0
  18. data/lib/cocoapods-binary-cache/hooks/post_install.rb +20 -2
  19. data/lib/cocoapods-binary-cache/hooks/pre_install.rb +14 -44
  20. data/lib/cocoapods-binary-cache/main.rb +2 -1
  21. data/lib/cocoapods-binary-cache/pod-binary/helper/build.rb +40 -0
  22. data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/installer.rb +2 -2
  23. data/lib/cocoapods-binary-cache/pod-binary/helper/detected_prebuilt_pods/target_definition.rb +3 -10
  24. data/lib/cocoapods-binary-cache/pod-binary/helper/names.rb +2 -11
  25. data/lib/cocoapods-binary-cache/pod-binary/helper/prebuild_sandbox.rb +15 -15
  26. data/lib/cocoapods-binary-cache/pod-binary/helper/target_checker.rb +7 -10
  27. data/lib/cocoapods-binary-cache/pod-binary/integration.rb +1 -3
  28. data/lib/cocoapods-binary-cache/pod-binary/integration/alter_specs.rb +4 -1
  29. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb +1 -1
  30. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/resolve_dependencies.rb +0 -3
  31. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/sandbox_analyzer_state.rb +29 -0
  32. data/lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb +6 -3
  33. data/lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb +42 -50
  34. data/lib/cocoapods-binary-cache/pod-binary/prebuild.rb +45 -110
  35. data/lib/cocoapods-binary-cache/pod-binary/prebuild_dsl.rb +2 -61
  36. data/lib/cocoapods-binary-cache/pod-binary/prebuild_hook.rb +0 -1
  37. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb +192 -0
  38. data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb +43 -0
  39. data/lib/cocoapods-binary-cache/prebuild_output/metadata.rb +16 -0
  40. data/lib/cocoapods-binary-cache/prebuild_output/output.rb +12 -39
  41. data/lib/cocoapods-binary-cache/scheme_editor.rb +17 -16
  42. data/lib/cocoapods-binary-cache/state_store.rb +16 -6
  43. data/lib/command/binary.rb +21 -2
  44. data/lib/command/config.rb +173 -10
  45. data/lib/command/executor/base.rb +7 -0
  46. data/lib/command/executor/fetcher.rb +4 -4
  47. data/lib/command/executor/prebuilder.rb +2 -2
  48. data/lib/command/executor/pusher.rb +1 -1
  49. data/lib/command/executor/visualizer.rb +3 -2
  50. data/lib/command/fetch.rb +0 -1
  51. data/lib/command/prebuild.rb +14 -2
  52. data/lib/command/push.rb +22 -0
  53. metadata +15 -11
  54. data/lib/cocoapods-binary-cache/pod-binary/helper/feature_switches.rb +0 -90
  55. data/lib/cocoapods-binary-cache/pod-binary/helper/passer.rb +0 -25
  56. data/lib/cocoapods-binary-cache/pod-binary/integration/remove_target_files.rb +0 -29
  57. data/lib/cocoapods-binary-cache/pod-binary/tool/tool.rb +0 -12
  58. data/lib/cocoapods-binary-cache/pod-rome/build_framework.rb +0 -247
  59. data/lib/cocoapods-binary-cache/prebuild_cache.rb +0 -49
@@ -1,16 +1,15 @@
1
1
  module Pod
2
2
  class Prebuild
3
-
4
3
  # Check the targets, for the current limitation of the plugin
5
4
  #
6
5
  # @param [Array<PodTarget>] prebuilt_targets
7
6
  def self.check_one_pod_should_have_only_one_target(prebuilt_targets)
8
- targets_have_different_platforms = prebuilt_targets.select { |t| t.pod_name != t.name }
7
+ targets_have_different_platforms = prebuilt_targets.reject { |t| t.pod_name == t.name }
8
+ return unless targets_have_different_platforms.empty?
9
9
 
10
- if targets_have_different_platforms.count > 0
11
- names = targets_have_different_platforms.map(&:pod_name)
12
- raw_names = targets_have_different_platforms.map(&:name)
13
- message = "Oops, you came across a limitation of cocoapods-binary.
10
+ names = targets_have_different_platforms.map(&:pod_name)
11
+ raw_names = targets_have_different_platforms.map(&:name)
12
+ message = "Oops, you came across a limitation of cocoapods-binary.
14
13
 
15
14
  The plugin requires that one pod should have ONLY ONE target in the 'Pod.xcodeproj'. There are mainly 2 situations \
16
15
  causing this problem:
@@ -36,10 +35,8 @@ causing this problem:
36
35
  end
37
36
  ```
38
37
 
39
- Related pods: #{names}, target names: #{raw_names}
40
- "
41
- raise Informative, message
42
- end
38
+ Related pods: #{names}, target names: #{raw_names}"
39
+ raise Informative, message
43
40
  end
44
41
  end
45
42
  end
@@ -1,12 +1,10 @@
1
1
  require_relative "helper/podfile_options"
2
2
  require_relative "helper/prebuild_sandbox"
3
- require_relative "helper/passer"
4
3
  require_relative "helper/names"
5
4
  require_relative "helper/target_checker"
6
5
  require_relative "integration/alter_specs"
7
- require_relative "integration/remove_target_files"
8
- require_relative "integration/source_installer"
9
6
  require_relative "integration/validation"
10
7
  require_relative "integration/patch/embed_framework_script"
8
+ require_relative "integration/patch/sandbox_analyzer_state"
11
9
  require_relative "integration/patch/resolve_dependencies"
12
10
  require_relative "integration/patch/source_installation"
@@ -15,6 +15,7 @@ module Pod
15
15
  # as to compitable with older version and be less wordy.
16
16
  framework_file_path = target.framework_name
17
17
  framework_file_path = target.name + "/" + framework_file_path if targets.count > 1
18
+ framework_file_path = PodPrebuild.config.prebuilt_path(path: framework_file_path)
18
19
  add_vendered_framework(spec, target.platform.name.to_s, framework_file_path)
19
20
  end
20
21
 
@@ -61,7 +62,9 @@ module Pod
61
62
  attributes["resource_bundles"] = nil
62
63
  attributes["resources"] ||= []
63
64
  attributes["resources"] = [attributes["resources"]] if attributes["resources"].is_a?(String)
64
- attributes["resources"] += resource_bundle_names.map { |n| n + ".bundle" }
65
+ attributes["resources"] += resource_bundle_names.map do |name|
66
+ PodPrebuild.config.prebuilt_path(path: "#{name}.bundle")
67
+ end
65
68
  end
66
69
 
67
70
  add_resource_bundles_to_resources.call(spec.attributes_hash)
@@ -9,7 +9,7 @@ module Pod
9
9
  class EmbedFrameworksScript
10
10
  old_method = instance_method(:script)
11
11
  define_method(:script) do
12
- script = old_method.bind(self).()
12
+ script = old_method.bind(self).call
13
13
  patch = <<-SH.strip_heredoc
14
14
  #!/bin/sh
15
15
  # ---- this is added by cocoapods-binary ---
@@ -7,9 +7,6 @@ module Pod
7
7
  # Modify specification to use only the prebuild framework after analyzing
8
8
  original_resolve_dependencies = instance_method(:resolve_dependencies)
9
9
  define_method(:resolve_dependencies) do
10
- # Remove the old target files. Otherwise, it will not notice file changes.
11
- # This call is to make sure subsequent pod installations function properly
12
- remove_target_files_if_needed
13
10
  original_resolve_dependencies.bind(self).call
14
11
 
15
12
  # check the pods
@@ -0,0 +1,29 @@
1
+ module Pod
2
+ class Installer
3
+ class Analyzer
4
+ class SandboxAnalyzer
5
+ original_analyze = instance_method(:analyze)
6
+ define_method(:analyze) do
7
+ state = original_analyze.bind(self).call
8
+ state = alter_state(state)
9
+ state
10
+ end
11
+
12
+ private
13
+
14
+ def alter_state(state)
15
+ return state if PodPrebuild.config.tracked_prebuilt_pod_names.empty?
16
+
17
+ prebuilt = PodPrebuild.config.tracked_prebuilt_pod_names
18
+ Pod::UI.message "Alter sandbox state: treat prebuilt frameworks as added: #{prebuilt.to_a}"
19
+ SpecsState.new(
20
+ :added => (state.added + prebuilt).uniq,
21
+ :changed => state.changed - prebuilt,
22
+ :removed => state.deleted - prebuilt,
23
+ :unchanged => state.unchanged - prebuilt
24
+ )
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,5 @@
1
+ require_relative "../source_installer"
2
+
1
3
  module Pod
2
4
  class Installer
3
5
  # Override the download step to skip download and prepare file in target folder
@@ -15,13 +17,14 @@ module Pod
15
17
  end
16
18
 
17
19
  def should_integrate_prebuilt_pod?(name)
18
- if Pod::Podfile::DSL.prebuild_job?
20
+ if PodPrebuild.config.prebuild_job? && PodPrebuild.config.targets_to_prebuild_from_cli.empty?
19
21
  # In a prebuild job, at the integration stage, all prebuilt frameworks should be
20
22
  # ready for integration regardless of whether there was any cache miss or not.
21
23
  # Those that are missed were prebuilt in the prebuild stage.
22
- PodPrebuild::StateStore.cache_validation.include?(name)
24
+ PodPrebuild.state.cache_validation.include?(name)
23
25
  else
24
- PodPrebuild::StateStore.cache_validation.hit?(name)
26
+ prebuilt = PodPrebuild.state.cache_validation.hit + PodPrebuild.config.targets_to_prebuild_from_cli
27
+ prebuilt.include?(name)
25
28
  end
26
29
  end
27
30
  end
@@ -11,69 +11,34 @@ module Pod
11
11
  class Installer
12
12
  class PodSourceInstaller
13
13
  def install_for_prebuild!(standard_sanbox)
14
- return if !Podfile::DSL.dev_pods_enabled && standard_sanbox.local?(name)
14
+ return if !PodPrebuild.config.dev_pods_enabled? && standard_sanbox.local?(name)
15
15
 
16
16
  # make a symlink to target folder
17
+ # TODO (bang): Unify to 1 sandbox to optimize and avoid inconsistency
17
18
  prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sanbox)
18
19
  # if spec used in multiple platforms, it may return multiple paths
19
- target_names = prebuild_sandbox.existed_target_names_for_pod_name(self.name)
20
-
21
- def walk(path, &action)
22
- return unless path.exist?
23
- path.children.each do |child|
24
- result = action.call(child, &action)
25
- if child.directory?
26
- walk(child, &action) if result
27
- end
28
- end
29
- end
30
-
31
- def make_link(source, target)
32
- source = Pathname.new(source)
33
- target = Pathname.new(target)
34
- target.parent.mkpath unless target.parent.exist?
35
- relative_source = source.relative_path_from(target.parent)
36
- FileUtils.ln_sf(relative_source, target)
37
- end
38
-
39
- def mirror_with_symlink(source, basefolder, target_folder)
40
- target = target_folder + source.relative_path_from(basefolder)
41
- make_link(source, target)
42
- end
43
-
20
+ target_names = prebuild_sandbox.existed_target_names_for_pod_name(name)
44
21
  target_names.each do |name|
45
-
46
- # symbol link copy all substructure
47
22
  real_file_folder = prebuild_sandbox.framework_folder_path_for_target_name(name)
48
23
 
49
24
  # If have only one platform, just place int the root folder of this pod.
50
25
  # If have multiple paths, we use a sperated folder to store different
51
26
  # platform frameworks. e.g. AFNetworking/AFNetworking-iOS/AFNetworking.framework
52
-
53
27
  target_folder = standard_sanbox.pod_dir(self.name)
54
- if target_names.count > 1
55
- target_folder += real_file_folder.basename
56
- end
57
-
58
- if !standard_sanbox.local?(name)
59
- target_folder.rmtree if target_folder.exist?
60
- target_folder.mkpath
61
- else
62
- system "find #{target_folder} -type l -delete" # Only clean up symlink, keep source code for local pod
63
- end
28
+ target_folder += real_file_folder.basename if target_names.count > 1
29
+ target_folder += PodPrebuild.config.prebuilt_path
30
+ target_folder.rmtree if target_folder.exist?
31
+ target_folder.mkpath
64
32
 
65
33
  walk(real_file_folder) do |child|
66
34
  source = child
67
35
  # only make symlink to file and `.framework` folder
68
- if child.directory? and [".framework", ".dSYM"].include? child.extname
69
- if child.extname == ".framework"
70
- mirror_with_symlink(source, real_file_folder, target_folder)
71
- else
72
- # Ignore dsym here to avoid cocoapods from adding install_dsym to buildphase-script
73
- # That can cause duplicated output files error in Xcode 11 (warning in Xcode 10)
74
- # We need more setup to support local debuging with prebuilt dSYM
75
- end
76
- next false # return false means don't go deeper
36
+ if child.directory? && [".framework", ".dSYM"].include?(child.extname)
37
+ mirror_with_symlink(source, real_file_folder, target_folder) if child.extname == ".framework"
38
+ # Ignore dsym here to avoid cocoapods from adding install_dsym to buildphase-script
39
+ # That can cause duplicated output files error in Xcode 11 (warning in Xcode 10)
40
+ # We need more setup to support local debuging with prebuilt dSYM
41
+ next false # Don't go deeper
77
42
  elsif child.file?
78
43
  mirror_with_symlink(source, real_file_folder, target_folder)
79
44
  next true
@@ -87,8 +52,9 @@ module Pod
87
52
  next unless metadata.static_framework?
88
53
 
89
54
  metadata.resources.each do |path|
90
- target_file_path = path.sub("${PODS_ROOT}", sandbox.root.to_path)
91
- .sub("${PODS_CONFIGURATION_BUILD_DIR}", sandbox.root.to_path)
55
+ target_file_path = path
56
+ .sub("${PODS_ROOT}", sandbox.root.to_path)
57
+ .sub("${PODS_CONFIGURATION_BUILD_DIR}", sandbox.root.to_path)
92
58
  real_file_path = real_file_folder + metadata.framework_name + File.basename(path)
93
59
  case File.extname(path)
94
60
  when ".xib"
@@ -106,6 +72,32 @@ module Pod
106
72
  end
107
73
  end
108
74
  end
75
+
76
+ private
77
+
78
+ def walk(path, &action)
79
+ return unless path.exist?
80
+
81
+ path.children.each do |child|
82
+ result = action.call(child, &action)
83
+ if child.directory?
84
+ walk(child, &action) if result
85
+ end
86
+ end
87
+ end
88
+
89
+ def make_link(source, target)
90
+ source = Pathname.new(source)
91
+ target = Pathname.new(target)
92
+ target.rmtree if target.exist?
93
+ target.parent.mkpath unless target.parent.exist?
94
+ relative_source = source.relative_path_from(target.parent)
95
+ FileUtils.ln_sf(relative_source, target)
96
+ end
97
+
98
+ def mirror_with_symlink(source, basefolder, target_folder)
99
+ make_link(source, target_folder + source.relative_path_from(basefolder))
100
+ end
109
101
  end
110
102
  end
111
103
  end
@@ -1,127 +1,60 @@
1
1
  require "fileutils"
2
- require_relative "../pod-rome/build_framework"
3
2
  require_relative "../prebuild_output/output"
4
- require_relative "helper/passer"
3
+ require_relative "../helper/lockfile"
4
+ require_relative "../helper/prebuild_order"
5
5
  require_relative "helper/target_checker"
6
+ require_relative "helper/build"
6
7
 
7
- # patch prebuild ability
8
8
  module Pod
9
- class PrebuildInstaller < Installer
9
+ class PrebuildInstaller < Installer # rubocop:disable Metrics/ClassLength
10
+ attr_reader :lockfile_wrapper
11
+
10
12
  def initialize(options)
11
13
  super(options[:sandbox], options[:podfile], options[:lockfile])
12
14
  @cache_validation = options[:cache_validation]
15
+ @lockfile_wrapper = lockfile && PodPrebuild::Lockfile.new(lockfile)
13
16
  end
14
17
 
15
- private
16
-
17
- def local_manifest
18
- @local_manifest ||= sandbox.manifest
19
- end
20
-
21
- # @return [Analyzer::SpecsState]
22
- def prebuild_pods_changes
23
- return nil if local_manifest.nil?
18
+ def run_code_gen!(targets)
19
+ return if PodPrebuild.config.prebuild_code_gen.nil?
24
20
 
25
- if @prebuild_pods_changes.nil?
26
- changes = local_manifest.detect_changes_with_podfile(podfile)
27
- @prebuild_pods_changes = Analyzer::SpecsState.new(changes)
28
- # save the chagnes info for later stage
29
- Pod::Prebuild::Passer.prebuild_pods_changes = @prebuild_pods_changes
21
+ Pod::UI.title("Running code generation...") do
22
+ PodPrebuild.config.prebuild_code_gen.call(self, targets)
30
23
  end
31
- @prebuild_pods_changes
32
- end
33
-
34
- def blacklisted?(name)
35
- PodPrebuild::StateStore.excluded_pods.include?(name)
36
- end
37
-
38
- def cache_hit?(name)
39
- @cache_validation.hit?(name)
40
- end
41
-
42
- def should_not_prebuild_vendor_pod(name)
43
- return true if blacklisted?(name)
44
- return false if Pod::Podfile::DSL.prebuild_all_vendor_pods
45
-
46
- cache_hit?(name)
47
24
  end
48
25
 
49
- public
50
-
51
26
  def prebuild_output
52
27
  @prebuild_output ||= PodPrebuild::Output.new(sandbox)
53
28
  end
54
29
 
55
- # Build the needed framework files
56
- def prebuild_frameworks!
57
- UI.puts "Start prebuild_frameworks"
58
-
59
- # build options
60
- sandbox_path = sandbox.root
61
- existed_framework_folder = sandbox.generate_framework_path
62
- bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled
63
- targets = []
64
-
65
- if Pod::Podfile::DSL.prebuild_all_vendor_pods
66
- UI.puts "Rebuild all vendor frameworks"
67
- targets = pod_targets
68
- elsif !local_manifest.nil?
69
- UI.puts "Update some frameworks"
70
- changes = prebuild_pods_changes
71
- added = changes.added
72
- changed = changes.changed
73
- unchanged = changes.unchanged
74
-
75
- existed_framework_folder.mkdir unless existed_framework_folder.exist?
76
- exsited_framework_pod_names = sandbox.exsited_framework_pod_names
77
-
78
- # additions
79
- missing = unchanged.reject { |pod_name| exsited_framework_pod_names.include?(pod_name) }
80
-
81
- root_names_to_update = (added + changed + missing)
82
- root_names_to_update += PodPrebuild::StateStore.cache_validation.missed
83
-
84
- # transform names to targets
85
- cache = []
86
- targets = root_names_to_update.map do |pod_name|
87
- tars = Pod.fast_get_targets_for_pod_name(pod_name, pod_targets, cache) || []
88
- raise "There's no target named (#{pod_name}) in Pod.xcodeproj" if tars.empty?
89
-
90
- tars
91
- end.flatten
92
-
93
- # add the dendencies
94
- dependency_targets = targets.map(&:recursive_dependent_targets).flatten.uniq || []
95
- targets = (targets + dependency_targets).uniq
96
- else
97
- UI.puts "Rebuild all frameworks"
98
- targets = pod_targets
30
+ def targets_to_prebuild
31
+ to_build = PodPrebuild.config.targets_to_prebuild_from_cli
32
+ if to_build.empty?
33
+ to_build = PodPrebuild.config.prebuild_all_pods? ? @cache_validation.all : @cache_validation.missed
99
34
  end
35
+ pod_targets.select { |target| to_build.include?(target.name) }
36
+ end
100
37
 
101
- targets = targets.reject { |pod_target| should_not_prebuild_vendor_pod(pod_target.name) }
102
- targets = targets.reject { |pod_target| sandbox.local?(pod_target.pod_name) } unless Podfile::DSL.dev_pods_enabled
103
-
104
- # build!
105
- Pod::UI.puts "Prebuild frameworks (total #{targets.count})"
106
- Pod::UI.puts targets.map(&:name)
38
+ def prebuild_frameworks!
39
+ existed_framework_folder = sandbox.generate_framework_path
40
+ sandbox_path = sandbox.root
107
41
 
42
+ targets = PodPrebuild::BuildOrder.order_targets(targets_to_prebuild)
43
+ Pod::UI.puts "Prebuild frameworks (total #{targets.count}): #{targets.map(&:name)}"
108
44
  Pod::Prebuild.remove_build_dir(sandbox_path)
45
+ run_code_gen!(targets)
109
46
  targets.each do |target|
110
- unless target.should_build?
111
- Pod::UI.puts "Skip prebuilding #{target.label} because of no source files".yellow
112
- next
113
- end
114
-
115
47
  output_path = sandbox.framework_folder_path_for_target_name(target.name)
116
48
  output_path.mkpath unless output_path.exist?
117
49
  Pod::Prebuild.build(
118
- sandbox_path,
119
- target,
120
- Pod::Podfile::DSL.prebuild_config,
121
- output_path,
122
- bitcode_enabled,
123
- Pod::Podfile::DSL.custom_device_build_options,
124
- Pod::Podfile::DSL.custom_simulator_build_options
50
+ sandbox: sandbox_path,
51
+ target: target,
52
+ configuration: PodPrebuild.config.prebuild_config,
53
+ output_path: output_path,
54
+ bitcode_enabled: PodPrebuild.config.bitcode_enabled?,
55
+ device_build_enabled: PodPrebuild.config.device_build_enabled?,
56
+ disable_dsym: PodPrebuild.config.disable_dsym?,
57
+ args: PodPrebuild.config.build_args
125
58
  )
126
59
  collect_metadata(target, output_path)
127
60
  end
@@ -135,7 +68,6 @@ module Pod
135
68
  # If target shouldn't build, we copy all the original files
136
69
  # This is for target with only .a and .h files
137
70
  unless target.should_build?
138
- Prebuild::Passer.target_names_to_skip_integration_framework << target.name
139
71
  FileUtils.cp_r(root_path, target_folder, :remove_destination => true)
140
72
  next
141
73
  end
@@ -166,12 +98,12 @@ module Pod
166
98
  all_needed_names.include? name
167
99
  end
168
100
  useless_target_names.each do |name|
169
- UI.puts "Remove: #{name}"
101
+ Pod::UI.message "Remove: #{name}"
170
102
  path = sandbox.framework_folder_path_for_target_name(name)
171
103
  path.rmtree if path.exist?
172
104
  end
173
105
 
174
- if Podfile::DSL.dont_remove_source_code
106
+ if PodPrebuild.config.dont_remove_source_code?
175
107
  # just remove the tmp files
176
108
  path = sandbox.root + "Manifest.lock.tmp"
177
109
  path.rmtree if path.exist?
@@ -182,13 +114,10 @@ module Pod
182
114
  to_delete_files.each { |file| file.rmtree if file.exist? }
183
115
  end
184
116
 
185
- updated_target_names = targets.map { |target| target.label.to_s }
186
- deleted_target_names = useless_target_names
187
- Pod::UI.puts "Targets to prebuild: #{updated_target_names}"
188
- Pod::UI.puts "Targets to cleanup: #{deleted_target_names}"
189
-
190
- prebuild_output.write_delta_file(updated_target_names, deleted_target_names)
191
- prebuild_output.process_prebuilt_dev_pods
117
+ prebuild_output.write_delta_file(
118
+ updated: targets.map { |target| target.label.to_s },
119
+ deleted: useless_target_names
120
+ )
192
121
  end
193
122
 
194
123
  def clean_delta_file
@@ -209,8 +138,14 @@ module Pod
209
138
  metadata.build_settings = pods_project.targets
210
139
  .detect { |native_target| native_target.name == target.name }
211
140
  .build_configurations
212
- .detect { |config| config.name == Pod::Podfile::DSL.prebuild_config }
141
+ .detect { |config| config.name == PodPrebuild.config.prebuild_config }
213
142
  .build_settings
143
+ metadata.source_hash = @lockfile_wrapper && @lockfile_wrapper.dev_pod_hash(target.name)
144
+
145
+ # Store root path for code-coverage support later
146
+ # TODO: update driver code-coverage logic to use path stored here
147
+ project_root = PathUtils.remove_last_path_component(@sandbox.standard_sanbox_path.to_s)
148
+ metadata.project_root = project_root
214
149
  metadata.save!
215
150
  end
216
151
 
@@ -218,7 +153,7 @@ module Pod
218
153
  old_method2 = instance_method(:run_plugins_post_install_hooks)
219
154
  define_method(:run_plugins_post_install_hooks) do
220
155
  old_method2.bind(self).call
221
- prebuild_frameworks! if Pod.is_prebuild_stage && Pod::Podfile::DSL.prebuild_job?
156
+ prebuild_frameworks! if PodPrebuild::Env.prebuild_stage?
222
157
  end
223
158
  end
224
159
  end