From cb998a35895086cd93cd6b2568ddb7ddb461b28c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 9 Sep 2021 09:11:25 +0200 Subject: [PATCH] [msbuild/dotnet] Don't use the built-in publishing logic in .NET to copy frameworks to the app bundle. Fixes #12369. (#12656) .NET/MSBuild don't handle symlinks properly [1], which means that we can't ask .NET to copy frameworks to the app bundle, since frameworks may contain symlinks. In our case, the symptom was that instead of copying symlinks, the file the symlink pointed to was copied instead, and then codesign complained about invalid bundle format when we tried to sign the framework. We fix this by having our own target (_CopyFrameworksToBundle) to copy frameworks to the app bundle (instead of adding all the files in the frameworks to the ResolvedFileToPublish item group), and then using 'ditto' to copy the frameworks. In order to create a test case for this, I also made the macOS and Mac Catalyst versions of the XTest framework use symlinks: * Create a proper XTest framework bundle hierarchy for macOS and Mac Catalyst by using the typical symlink structure (actual files in the Versions/A subdirectory, and then symlinks pointing into that directory). * Create a separate Info.plist for each platform for XTest.framework, since using an otherwise correct framework makes tooling (such as codesign) complain if the Info.plist isn't correct too. This made our existing tests show the bug. Finally I had to fix signing frameworks where the executable is a symlink. We were first resolving symlinks for the input - say we had an Example.framework/Example symlink to Example.framework/Versions/A/Example - and then checking the parent directory if it's a framework. The parent directory of 'Example.framework/Versions/A/Example' is 'A', which did not meet our framewrok condition (if it ends with '.framework'). The fix is to adjust the logic to resolve symlinks after checking if the input is a framework or not. [1]: https://github.com/dotnet/msbuild/issues/6821 Fixes https://github.com/xamarin/xamarin-macios/issues/12369. --- dotnet/targets/Xamarin.Shared.Sdk.targets | 54 +++++---- .../Tasks/CodesignTaskBase.cs | 4 +- tests/test-libraries/Makefile | 107 +++++++++++++++--- ...t-Info.plist => XTest-Info-iphoneos.plist} | 3 +- .../XTest-Info-iphonesimulator.plist | 57 ++++++++++ .../XTest-Info-maccatalyst.plist | 48 ++++++++ tests/test-libraries/XTest-Info-macos.plist | 48 ++++++++ tests/test-libraries/XTest-Info-tvos.plist | 56 +++++++++ .../XTest-Info-tvsimulator.plist | 56 +++++++++ tests/test-libraries/XTest-Info-watchos.plist | 56 +++++++++ .../XTest-Info-watchsimulator.plist | 56 +++++++++ .../Steps/ExtractBindingLibrariesStep.cs | 20 ++-- 12 files changed, 514 insertions(+), 51 deletions(-) rename tests/test-libraries/{XTest-Info.plist => XTest-Info-iphoneos.plist} (98%) create mode 100644 tests/test-libraries/XTest-Info-iphonesimulator.plist create mode 100644 tests/test-libraries/XTest-Info-maccatalyst.plist create mode 100644 tests/test-libraries/XTest-Info-macos.plist create mode 100644 tests/test-libraries/XTest-Info-tvos.plist create mode 100644 tests/test-libraries/XTest-Info-tvsimulator.plist create mode 100644 tests/test-libraries/XTest-Info-watchos.plist create mode 100644 tests/test-libraries/XTest-Info-watchsimulator.plist diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 746d79d09f..026a792021 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -233,6 +233,7 @@ _LinkNativeExecutable; _ComputePublishLocation; CopyFilesToPublishDirectory; + _CopyFrameworksToBundle; _CopyAppExtensionsToBundle; @@ -561,30 +562,39 @@ - + - - - <_FrameworkFilesToPublish Include="%(_FrameworkNativeReference.RootDir)%(_FrameworkNativeReference.Directory)/**/*" Condition="'%(_FrameworkNativeReference.Kind)' == 'Framework' And '%(_FrameworkNativeReference.CopyToAppBundle)' != 'false'"> - <_FrameworkIdentity>%(RootDir)%(Directory) - <_FrameworkPath>$(_AppBundleFrameworksDir)\%(Filename).framework - PreserveNewest - + + <_FrameworkToPublish Include="@(_FrameworkNativeReference)" Condition="'%(_FrameworkNativeReference.Kind)' == 'Framework' And '%(_FrameworkNativeReference.CopyToAppBundle)' != 'false'" /> - - <_FrameworkFilesToPublish Update="@(_FrameworkFilesToPublish)"> - <_FrameworkRelativePath>$([System.String]::Copy('%(Identity)').Substring($([System.String]::Copy('%(_FrameworkIdentity)').Length))) - - - - - %(_FrameworkFilesToPublish._FrameworkPath)\%(_FrameworkFilesToPublish._FrameworkRelativePath) - PreserveNewest - + + <_FrameworkToPublish Update="@(_FrameworkToPublish)"> + $(_RelativePublishDir)$(_AppBundleFrameworksDir)\%(Filename).framework + %(RootDir)%(Directory) + + + + + + @@ -642,9 +652,9 @@ - - - + + + @@ -723,6 +733,8 @@ <_AbsolutePublishDir>$(PublishDir) <_AbsolutePublishDir Condition="!$([System.IO.Path]::IsPathRooted ('$(_AbsolutePublishDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(PublishDir)')) + + <_RelativePublishDir>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(_AbsolutePublishDir))) <_RelativeAppBundlePath>$([MSBuild]::MakeRelative($(_AbsolutePublishDir),$(MSBuildProjectDirectory)/$(_AppBundlePath))) diff --git a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CodesignTaskBase.cs b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CodesignTaskBase.cs index 4e9b384d31..bc9de376b5 100644 --- a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CodesignTaskBase.cs +++ b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CodesignTaskBase.cs @@ -146,12 +146,14 @@ namespace Xamarin.MacDev.Tasks // signing a framework and a file inside a framework is not *always* identical // on macOS apps {item.ItemSpec} can be a symlink to `Versions/Current/{item.ItemSpec}` // and `Current` also a symlink to `A`... and `_CodeSignature` will be found there - var path = PathUtils.ResolveSymbolicLinks (item.ItemSpec); + var path = item.ItemSpec; var parent = Path.GetDirectoryName (path); // so do not don't sign `A.framework/A`, sign `A.framework` which will always sign the *bundle* if ((Path.GetExtension (parent) == ".framework") && (Path.GetFileName (path) == Path.GetFileNameWithoutExtension (parent))) path = parent; + + path = PathUtils.ResolveSymbolicLinks (path); args.Add (Path.GetFullPath (path)); return args; diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile index 3d6bb99ff5..f77a8544f1 100644 --- a/tests/test-libraries/Makefile +++ b/tests/test-libraries/Makefile @@ -34,11 +34,50 @@ $(GENERATED_FILES_PATTERN): testgenerator.exe libtest-object.m libtest-ar.m: $(Q) ln -fhs libtest.m $@ +MACOS_INFO_PLIST_INFIX=/Versions/A/Resources +MACOS_BINARY_INFIX=/Versions/A +MACCATALYST_INFO_PLIST_INFIX=/Versions/A/Resources +MACCATALYST_BINARY_INFIX=/Versions/A + +define SymlinksTemplate + +$(1)_XTEST_TARGETS += \ + .libs/$(1)/XTest.framework/XTest \ + .libs/$(1)/XTest.framework/Resources \ + .libs/$(1)/XTest.framework/Versions/Current \ + .libs/$(1)/XTest.framework/Versions/A/Resources/Info.plist \ + +.libs/$(1)/XTest.framework$($(2)_BINARY_INFIX) .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX): + $$(Q) mkdir -p $$@ + +.libs/$(1)/XTest.framework/XTest: | .libs/$(1)/XTest.framework + $$(Q) ln -fs Versions/A/XTest $$@ + +.libs/$(1)/XTest.framework/Resources: | .libs/$(1)/XTest.framework + $$(Q) ln -fs Versions/Current/Resources $$@ + +.libs/$(1)/XTest.framework/Versions/Current: | .libs/$(1)/XTest.framework/Versions + $$(Q) ln -fs A $$@ + +x:: + @echo $(1)_XTEST_TARGETS=$$($(1)_XTEST_TARGETS) + +endef +ifdef INCLUDE_MAC +$(eval $(call SymlinksTemplate,macos,MACOS)) +endif +ifdef INCLUDE_MACCATALYST +$(eval $(call SymlinksTemplate,maccatalyst,MACCATALYST)) +endif + define Template +$(1)_XTEST_TARGETS += \ + .libs/$(1)/XTest.framework$($(2)_BINARY_INFIX)/XTest \ + .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist \ + $(2)_TARGETS = \ - .libs/$(1)/XTest.framework/XTest \ - .libs/$(1)/XTest.framework/Info.plist \ + $$($(1)_XTEST_TARGETS) \ .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ .libs/$(1)/XStaticArTest.framework/XStaticArTest \ .libs/$(1)/libtest.dylib \ @@ -50,9 +89,13 @@ $(2)_TARGETS = \ $$(foreach arch,$(3),.libs/$(1)/libtest-object.$$(arch).a) \ $$(foreach arch,$(3),.libs/$(1)/libtest-ar.$$(arch).a) \ .libs/$(1)/XTest.framework \ + .libs/$(1)/XTest.framework.stamp \ all-local:: $$($(2)_TARGETS) $(GENERATED_FILES) +.libs/$(1)/XTest.framework.stamp: $$($(1)_XTEST_TARGETS) + $$(Q) touch $$@ + clean-$(1): rm -Rf .libs/$(1) @@ -99,11 +142,11 @@ COMMON_DYLIB_ARGS=-g -dynamiclib -gdwarf-2 -fms-extensions libframework.m -o $$@ $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ # XTest is a framework where the binary code is a (fat) dynamic library -.libs/$(1)/XTest.framework/XTest: .libs/$(1)/libtest.dylib | .libs/$(1)/XTest.framework +.libs/$(1)/XTest.framework$($(2)_BINARY_INFIX)/XTest: .libs/$(1)/libtest.dylib | .libs/$(1)/XTest.framework$($(2)_BINARY_INFIX) $$(Q) $(CP) $$^ $$@ $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/XTest.framework/XTest $$@ -.libs/$(1)/XTest.framework/Info.plist: XTest-Info.plist | .libs/$(1)/XTest.framework +.libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist: XTest-Info-$(1).plist | .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX) $$(Q) $(CP) $$^ $$@ # XStaticObjectTest is a framework where the binary code is a (fat) object file @@ -116,7 +159,13 @@ COMMON_DYLIB_ARGS=-g -dynamiclib -gdwarf-2 -fms-extensions libframework.m -o $$@ $(Q) rm -f $$@ $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ -.libs/$(1)/XTest.framework .libs/$(1)/XStaticObjectTest.framework .libs/$(1)/XStaticArTest.framework: +$(1)_DIRECTORIES = \ + .libs/$(1)/XTest.framework \ + .libs/$(1)/XTest.framework/Versions \ + .libs/$(1)/XStaticObjectTest.framework \ + .libs/$(1)/XStaticArTest.framework \ + +$$($(1)_DIRECTORIES): $$(Q) mkdir -p $$@ endef @@ -185,11 +234,11 @@ define FatFrameworkTemplate $(Q) mkdir -p $$(dir $$@) $(Q) lipo -create -output $$@ $$^ -.libs/$(1)/XTest.framework/XTest: .libs/$(2)/XTest.framework/XTest .libs/$(3)/XTest.framework/XTest | .libs/$(1) +.libs/$(1)/XTest.framework$($(4)_BINARY_INFIX)/XTest: .libs/$(2)/XTest.framework$($(4)_BINARY_INFIX)/XTest .libs/$(3)/XTest.framework$($(4)_BINARY_INFIX)/XTest | .libs/$(1) $(Q) mkdir -p $$(dir $$@) $(Q) lipo -create -output $$@ $$^ -.libs/$(1)/XTest.framework/Info.plist: .libs/$(2)/XTest.framework/Info.plist .libs/$(3)/XTest.framework/Info.plist +.libs/$(1)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist: .libs/$(2)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist .libs/$(3)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist $(Q) mkdir -p $$(dir $$@) ifneq ($(2),$(3)) @# Check if the Info.plists are identical @@ -208,7 +257,8 @@ endif $(Q) lipo -create -output $$@ $$^ $(3)_TARGETS += \ - .libs/$(1)/XTest.framework/XTest .libs/$(1)/XTest.framework/Info.plist \ + .libs/$(1)/XTest.framework$($(4)_BINARY_INFIX)/XTest \ + .libs/$(1)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist \ .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ .libs/$(1)/XStaticArTest.framework/XStaticArTest \ .libs/$(1)/libtest.dylib \ @@ -218,18 +268,46 @@ $(3)_TARGETS += \ all-local:: $$($(3)_TARGETS) endef -$(eval $(call FatFrameworkTemplate,ios-fat,iphoneos,iphonesimulator)) +$(eval $(call FatFrameworkTemplate,ios-fat,iphoneos,iphonesimulator,IPHONESIMULATOR)) ifdef INCLUDE_TVOS -$(eval $(call FatFrameworkTemplate,tvos-fat,tvos,tvsimulator)) +$(eval $(call FatFrameworkTemplate,tvos-fat,tvos,tvsimulator,TVSIMULATOR)) endif ifdef INCLUDE_WATCH -$(eval $(call FatFrameworkTemplate,watchos-fat,watchos,watchsimulator)) +$(eval $(call FatFrameworkTemplate,watchos-fat,watchos,watchsimulator,WATCHSIMULATOR)) endif ifdef INCLUDE_MACCATALYST -$(eval $(call FatFrameworkTemplate,maccatalyst-fat,maccatalyst,maccatalyst)) +$(eval $(call FatFrameworkTemplate,maccatalyst-fat,maccatalyst,maccatalyst,MACCATALYST)) endif ifdef INCLUDE_MAC -$(eval $(call FatFrameworkTemplate,macos-fat,macos,macos)) +$(eval $(call FatFrameworkTemplate,macos-fat,macos,macos,MACOS)) +endif + +define FatFrameworkSymlinksTemplate +.libs/$(1)/XTest.framework/XTest: | .libs/$(1) + $(Q) mkdir -p $$(dir $$@) + $(Q) ln -fs Versions/A/XTest $$@ + +.libs/$(1)/XTest.framework/Resources: | .libs/$(1) + $(Q) mkdir -p $$(dir $$@) + $(Q) ln -fs Versions/A/Resources $$@ + +.libs/$(1)/XTest.framework/Versions/Current: | .libs/$(1) + $(Q) mkdir -p $$(dir $$@) + $(Q) ln -fs A $$@ + +$(3)_TARGETS += \ + .libs/$(1)/XTest.framework/XTest \ + .libs/$(1)/XTest.framework/Resources \ + .libs/$(1)/XTest.framework/Versions/Current \ + +all-local:: $$($(3)_TARGETS) +endef + +ifdef INCLUDE_MACCATALYST +$(eval $(call FatFrameworkSymlinksTemplate,maccatalyst-fat,maccatalyst,maccatalyst,MACCATALYST)) +endif +ifdef INCLUDE_MAC +$(eval $(call FatFrameworkSymlinksTemplate,macos-fat,macos,macos,MACOS)) endif ifdef INCLUDE_IOS @@ -250,8 +328,7 @@ endif XTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework) XTEST_XCTARGETS += \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework/XTest) \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework/Info.plist) \ + $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework.stamp) \ .libs/XTest.xcframework: $(XTEST_XCTARGETS) Makefile $(Q) rm -rf $@ diff --git a/tests/test-libraries/XTest-Info.plist b/tests/test-libraries/XTest-Info-iphoneos.plist similarity index 98% rename from tests/test-libraries/XTest-Info.plist rename to tests/test-libraries/XTest-Info-iphoneos.plist index 9ba3ed6a32..0c115e996f 100644 --- a/tests/test-libraries/XTest-Info.plist +++ b/tests/test-libraries/XTest-Info-iphoneos.plist @@ -9,7 +9,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Mono + XTest CFBundlePackageType FMWK CFBundleShortVersionString @@ -22,7 +22,6 @@ CFBundleExecutable XTest - BuildMachineOSBuild 13F34 CFBundleDevelopmentRegion diff --git a/tests/test-libraries/XTest-Info-iphonesimulator.plist b/tests/test-libraries/XTest-Info-iphonesimulator.plist new file mode 100644 index 0000000000..0c115e996f --- /dev/null +++ b/tests/test-libraries/XTest-Info-iphonesimulator.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + iPhoneOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + iphoneos + DTPlatformVersion + 8.2 + DTSDKBuild + 12D508 + DTSDKName + iphoneos8.2 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 8.1 + UIDeviceFamily + + 1 + 2 + + + diff --git a/tests/test-libraries/XTest-Info-maccatalyst.plist b/tests/test-libraries/XTest-Info-maccatalyst.plist new file mode 100644 index 0000000000..74416d9e39 --- /dev/null +++ b/tests/test-libraries/XTest-Info-maccatalyst.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.15 + DTSDKBuild + 12D508 + DTSDKName + macosx10.15 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 10.15 + + diff --git a/tests/test-libraries/XTest-Info-macos.plist b/tests/test-libraries/XTest-Info-macos.plist new file mode 100644 index 0000000000..48b02f9c6e --- /dev/null +++ b/tests/test-libraries/XTest-Info-macos.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.9 + DTSDKBuild + 12D508 + DTSDKName + macosx10.9 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 10.9 + + diff --git a/tests/test-libraries/XTest-Info-tvos.plist b/tests/test-libraries/XTest-Info-tvos.plist new file mode 100644 index 0000000000..6714125a24 --- /dev/null +++ b/tests/test-libraries/XTest-Info-tvos.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + AppleTVOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + appletvos + DTPlatformVersion + 9.0 + DTSDKBuild + 12D508 + DTSDKName + appletvos9.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 9.0 + UIDeviceFamily + + 3 + + + diff --git a/tests/test-libraries/XTest-Info-tvsimulator.plist b/tests/test-libraries/XTest-Info-tvsimulator.plist new file mode 100644 index 0000000000..6714125a24 --- /dev/null +++ b/tests/test-libraries/XTest-Info-tvsimulator.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + AppleTVOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + appletvos + DTPlatformVersion + 9.0 + DTSDKBuild + 12D508 + DTSDKName + appletvos9.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 9.0 + UIDeviceFamily + + 3 + + + diff --git a/tests/test-libraries/XTest-Info-watchos.plist b/tests/test-libraries/XTest-Info-watchos.plist new file mode 100644 index 0000000000..f75bf9cfd3 --- /dev/null +++ b/tests/test-libraries/XTest-Info-watchos.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + WatchOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + watchos + DTPlatformVersion + 2.0 + DTSDKBuild + 12D508 + DTSDKName + watchos2.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 2.0 + UIDeviceFamily + + 4 + + + diff --git a/tests/test-libraries/XTest-Info-watchsimulator.plist b/tests/test-libraries/XTest-Info-watchsimulator.plist new file mode 100644 index 0000000000..f75bf9cfd3 --- /dev/null +++ b/tests/test-libraries/XTest-Info-watchsimulator.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + WatchOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + watchos + DTPlatformVersion + 2.0 + DTSDKBuild + 12D508 + DTSDKName + watchos2.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 2.0 + UIDeviceFamily + + 4 + + + diff --git a/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs b/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs index a816401527..0dc39bed5f 100644 --- a/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs +++ b/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs @@ -57,7 +57,7 @@ namespace Xamarin.Linker { } Configuration.WriteOutputForMSBuild ("_BindingLibraryFrameworks", frameworks); - var frameworkFilesToPublish = new List (); + var frameworksToPublish = new List (); foreach (var asm in Configuration.Target.Assemblies) { var fwks = new HashSet (); fwks.UnionWith (asm.Frameworks); @@ -70,19 +70,15 @@ namespace Xamarin.Linker { if (!Configuration.Application.VerifyDynamicFramework (fwk)) continue; - foreach (var file in Directory.GetFiles (fwk, "*", SearchOption.AllDirectories)) { - var item = new MSBuildItem { - Include = file, - Metadata = new Dictionary { - { "_FrameworkIdentity", fwk }, - { "_FrameworkPath", Path.Combine (Configuration.RelativeAppBundlePath, Configuration.Application.RelativeFrameworksPath, Path.GetFileName (fwk)) }, - }, - }; - frameworkFilesToPublish.Add (item); - } + var executable = Path.Combine (fwk, Path.GetFileNameWithoutExtension (fwk)); + + var item = new MSBuildItem { + Include = executable, + }; + frameworksToPublish.Add (item); } } - Configuration.WriteOutputForMSBuild ("_FrameworkFilesToPublish", frameworkFilesToPublish); + Configuration.WriteOutputForMSBuild ("_FrameworkToPublish", frameworksToPublish); var dynamicLibraryToPublish = new List (); foreach (var asm in Configuration.Target.Assemblies) {