lib/cocoapods-jxedt/binary/Intergation.rb in cocoapods-jxedt-0.0.19 vs lib/cocoapods-jxedt/binary/Intergation.rb in cocoapods-jxedt-0.0.20
- old
+ new
@@ -16,12 +16,12 @@
module Pod
class Installer
class PodSourceInstaller
def install_for_prebuild!(standard_sanbox)
- check_sandbox = Jxedt::Sandbox.from_sandbox(standard_sanbox)
- target_names = check_sandbox.existed_target_names(self.name)
+ binary_sandbox = Jxedt::BinarySandbox.from_sandbox(standard_sanbox)
+ target_names = binary_sandbox.existed_target_names(self.name)
def walk(path, &action)
return unless path.exist?
path.children.each do |child|
result = action.call(child, &action)
@@ -51,11 +51,11 @@
end
target_names.each do |name|
# symbol link copy all substructure
- real_file_folder = check_sandbox.framework_folder_path_for_target_name(name)
+ real_file_folder = binary_sandbox.framework_folder_path_for_target_name(name)
# If have only one platform, just place int the root folder of this pod.
# If have multiple paths, we use a sperated folder to store different
# platform frameworks. e.g. AFNetworking/AFNetworking-iOS/AFNetworking.framework
@@ -130,12 +130,15 @@
spec.attributes_hash[plat]["public_header_files"] = []
spec.attributes_hash[plat]["private_header_files"] = []
end
end
end
+
+ # 设置使用二进制的targets标识
+ prebuilt_pod_targets.each { |target| target.use_binary = true }
- check_sandbox = Jxedt::Sandbox.from_sandbox(self.sandbox)
+ binary_sandbox = Jxedt::BinarySandbox.from_sandbox(self.sandbox)
specs = self.analysis_result.specifications
prebuilt_specs = (specs.select do |spec|
# rmtree
target_prebuild_files = self.sandbox.pod_dir(spec.name) + "_Prebuild"
@@ -173,21 +176,21 @@
spec.attributes_hash["resources"] ||= []
resources = spec.attributes_hash["resources"] || []
resources = [resources] if resources.kind_of?(String)
spec.attributes_hash["resources"] = resources
# spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
- prebuild_bundles = check_sandbox.prebuild_bundles(spec.root.name).each.map { |bundle_path| "_Prebuild/" + bundle_path }
+ prebuild_bundles = binary_sandbox.prebuild_bundles(spec.root.name).each.map { |bundle_path| "_Prebuild/" + bundle_path }
prebuild_bundles = [] if checked_specs[spec.root.name].size > 1 # spec.root.name相同的只添加一次bundle文件
spec.attributes_hash["resources"] += prebuild_bundles
end
# Use the prebuild framworks as vendered frameworks
# get_corresponding_targets
targets = Pod.fast_get_targets_for_pod_name(spec.root.name, self.pod_targets, cache)
targets.each do |target|
# the framework_file_path rule is decided when `install_for_prebuild`,
# as to compitable with older version and be less wordy.
- check_sandbox.prebuild_vendored_frameworks(spec.root.name).each do |frame_file_path|
+ binary_sandbox.prebuild_vendored_frameworks(spec.root.name).each do |frame_file_path|
framework_file_path = "_Prebuild/" + frame_file_path
framework_file_path = nil if checked_specs[spec.root.name].size > 1 # spec.root.name相同的只添加一次framework文件
add_vendered_framework(spec, target.platform.name.to_s, framework_file_path)
end