lib/cocoapods-binary/Integration.rb in cocoapods-binary-0.1.2 vs lib/cocoapods-binary/Integration.rb in cocoapods-binary-0.2
- old
+ new
@@ -1,9 +1,15 @@
require_relative 'podfile_options'
require_relative 'feature_switches'
require_relative 'prebuild_sandbox'
+# NOTE:
+# This file will only be loaded on normal pod install step
+# so there's no need to check is_prebuild_stage
+
+
+
# Provide a special "download" process for prebuilded pods.
#
# As the frameworks is already exsited in local folder. We
# just create a symlink to the original target folder.
#
@@ -39,16 +45,24 @@
# Remove the old target files if prebuild frameworks changed
def remove_target_files_if_needed
changes = Pod::Prebuild.framework_changes
- return if changes == nil
- added = changes[:added] || []
- changed = changes[:changed] || []
- deleted = changes[:removed] || []
+ updated_names = []
+ if changes == nil
+ puts "aaaaa"
+ updated_names = PrebuildSandbox.from_standard_sandbox(self.sandbox).exsited_framework_names
+ else
+ puts "bbbbb"
+ puts changes
+ added = changes[:added] || []
+ changed = changes[:changed] || []
+ deleted = changes[:removed] || []
+ updated_names = added + changed + deleted
+ end
- (added + changed + deleted).each do |name|
+ updated_names.each do |name|
root_name = Specification.root_name(name)
next if self.sandbox.local?(root_name)
# delete the cached files
target_path = self.sandbox.pod_dir(root_name)
@@ -60,36 +74,30 @@
# Modify specification to use only the prebuild framework after analyzing
old_method2 = instance_method(:resolve_dependencies)
define_method(:resolve_dependencies) do
- if Pod.is_prebuild_stage
- old_method2.bind(self).()
- else
- # Remove the old target files, else it will not notice file changes
- self.remove_target_files_if_needed
- old_method2.bind(self).()
+ puts "ddddddddd"
- self.analysis_result.specifications.each do |spec|
- next unless self.prebuild_pod_names.include? spec.name
- spec.attributes_hash["vendored_frameworks"] = "#{spec.name}.framework"
- spec.attributes_hash["source_files"] = []
+ # Remove the old target files, else it will not notice file changes
+ self.remove_target_files_if_needed
+ old_method2.bind(self).()
- # to avoid the warning of missing license
- spec.attributes_hash["license"] = {}
- end
+ self.analysis_result.specifications.each do |spec|
+ next unless self.prebuild_pod_names.include? spec.name
+ spec.attributes_hash["vendored_frameworks"] = "#{spec.name}.framework"
+ spec.attributes_hash["source_files"] = []
+
+ # to avoid the warning of missing license
+ spec.attributes_hash["license"] = {}
end
end
# Override the download step to skip download and prepare file in target folder
old_method = instance_method(:install_source_of_pod)
define_method(:install_source_of_pod) do |pod_name|
-
- if Pod.is_prebuild_stage
- return old_method.bind(self).(pod_name)
- end
# copy from original
pod_installer = create_pod_installer(pod_name)
# \copy from original