Skip to content

Commit

Permalink
CocoaPods#10111 - Update XCFramework installation to support debug sy…
Browse files Browse the repository at this point in the history
…mbols placed as siblings of the .framework inside each arhictecture's directory
  • Loading branch information
johntmcintosh committed Oct 5, 2020
1 parent a3632cc commit f01d9d0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -35,6 +35,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Wes Campaigne](https://github.com/Westacular)
[#10071](https://github.com/CocoaPods/CocoaPods/issues/10071)

* Add support for automatically embeddeding XCFramework debug symbols for XCFrameworks generated with Xcode 12
[johntmcintosh](https://github.com/johntmcintosh)
[#10111](https://github.com/CocoaPods/CocoaPods/issues/10111)

## 1.10.0.rc.1 (2020-09-15)

##### Enhancements
Expand Down
15 changes: 3 additions & 12 deletions lib/cocoapods/generator/copy_xcframework_script.rb
Expand Up @@ -194,12 +194,8 @@ def script
mkdir -p "$destination"
fi
if [[ "$package_type" == "library" ]]; then
# Libraries can contain headers, module maps, and a binary, so we'll copy everything in the folder over
copy_dir "$source/" "$destination"
elif [[ "$package_type" == "framework" ]]; then
copy_dir "$source" "$destination"
fi
copy_dir "$source/" "$destination"
echo "Copied $source to $destination"
}
Expand All @@ -226,12 +222,7 @@ def install_xcframework_args(xcframework, slices)
is_framework = xcframework.build_type.framework?
args << shell_escape(is_framework ? 'framework' : 'library')
slices.each do |slice|
args << if is_framework
shell_escape(slice.path.relative_path_from(root))
else
# We don't want the path to the library binary, we want the dir that contains it
shell_escape(slice.path.dirname.relative_path_from(root))
end
args << shell_escape(slice.path.dirname.relative_path_from(root))
end
args.join(' ')
end
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/generator/copy_xcframeworks_script_spec.rb
Expand Up @@ -6,27 +6,27 @@ module Pod
xcframework = Xcode::XCFramework.new(fixture('CoconutLib.xcframework'))
generator = CopyXCFrameworksScript.new([xcframework], temporary_sandbox.root, Platform.ios)
generator.send(:script).should.include <<-SH.strip_heredoc
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "ios-armv7_arm64/CoconutLib.framework" "ios-i386_x86_64-simulator/CoconutLib.framework"
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "ios-armv7_arm64" "ios-i386_x86_64-simulator"
SH
end

it 'installs xcframeworks using the correct platform' do
xcframework = Xcode::XCFramework.new(fixture('CoconutLib.xcframework'))
generator = CopyXCFrameworksScript.new([xcframework], temporary_sandbox.root, Platform.macos)
generator.send(:script).should.include <<-SH.strip_heredoc
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "macos-x86_64/CoconutLib.framework"
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "macos-x86_64"
SH
generator = CopyXCFrameworksScript.new([xcframework], temporary_sandbox.root, Platform.ios)
generator.send(:script).should.include <<-SH.strip_heredoc
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "ios-armv7_arm64/CoconutLib.framework" "ios-i386_x86_64-simulator/CoconutLib.framework"
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "ios-armv7_arm64" "ios-i386_x86_64-simulator"
SH
generator = CopyXCFrameworksScript.new([xcframework], temporary_sandbox.root, Platform.watchos)
generator.send(:script).should.include <<-SH.strip_heredoc
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "watchos-i386-simulator/CoconutLib.framework" "watchos-armv7k_arm64_32/CoconutLib.framework"
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "watchos-i386-simulator" "watchos-armv7k_arm64_32"
SH
generator = CopyXCFrameworksScript.new([xcframework], temporary_sandbox.root, Platform.tvos)
generator.send(:script).should.include <<-SH.strip_heredoc
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "tvos-x86_64-simulator/CoconutLib.framework" "tvos-arm64/CoconutLib.framework"
install_xcframework "${PODS_ROOT}/../../spec/fixtures/CoconutLib.xcframework" "CoconutLib" "framework" "tvos-x86_64-simulator" "tvos-arm64"
SH
end

Expand Down

0 comments on commit f01d9d0

Please sign in to comment.