diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index 8ef76e1..9bef836 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -169,6 +169,11 @@ def add_vendered_framework(spec, platform, added_framework_file_path) vendored_frameworks = [vendored_frameworks] if vendored_frameworks.kind_of?(String) vendored_frameworks += [added_framework_file_path] spec.attributes_hash[platform]["vendored_frameworks"] = vendored_frameworks + + preserve_paths = spec.attributes_hash[platform]["preserve_paths"] || [] + preserve_paths = [preserve_paths] if preserve_paths.kind_of?(String) + preserve_paths += ["**/*.bcsymbolmap"] + spec.attributes_hash[platform]["preserve_paths"] = preserve_paths end def empty_source_files(spec) spec.attributes_hash["source_files"] = [] diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index 10c8571..0f78211 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -40,8 +40,12 @@ def build_for_iosish_platform(sandbox, # paths target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms. module_name = target.product_module_name - device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" - simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" + + device_results_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}" + device_framework_path = "#{device_results_path}/#{module_name}.framework" + + simulator_results_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}" + simulator_framework_path = "#{simulator_results_path}/#{module_name}.framework" device_binary = device_framework_path + "/#{module_name}" simulator_binary = simulator_framework_path + "/#{module_name}" @@ -84,6 +88,12 @@ def build_for_iosish_platform(sandbox, File.write(device_generated_swift_header_path, combined_header_content.strip) end + # Preserve bcsymbolmap files + bcsymbolmap_output_path = "#{output_path}/" + FileUtils.mkdir_p(bcsymbolmap_output_path) unless File.exists?(bcsymbolmap_output_path) + FileUtils.mv Dir.glob("#{device_results_path}/*.bcsymbolmap"), "#{bcsymbolmap_output_path}/", :force => true + FileUtils.mv Dir.glob("#{simulator_results_path}/*.bcsymbolmap"), "#{bcsymbolmap_output_path}/", :force => true + # handle the dSYM files device_dsym = "#{device_framework_path}.dSYM" if File.exist? device_dsym