From 354beec69c1ab7cc014b17e4bc7cd713cebc863d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 4 Nov 2020 15:39:02 +0100 Subject: [PATCH] [msbuild] Share the app extensions targets between iOS and Mac. (#10039) * Share the following targets: * _ResolveAppExtensionReferences * _SplitAppExtensionReferencesByExistent * _AssignAppExtensionConfiguration * _SeparateAppExtensionReferences * _CopyAppExtensionsToBundle The first four were pretty much identical between iOS and Mac already, and needed very few changes. The latter, _CopyAppExtensionsToBundle, required a little bit of tweaking to the targets to make sure it works for both iOS and Mac: * Removed the conditions on the Ditto task to check if we have app extensions - this is unnecessary because Inputs/Outputs on the target itself (which weren't there when the Ditto task conditions were written). * Added a '_PlaceAppExtensions' target that calculates where in the container's app bundle extensions should be placed (the '_AppExtensionRoot' property), and the name of the containing folder (the 'ContainerName' metadata). --- .../Xamarin.Mac.Common.targets | 98 --------------- msbuild/Xamarin.Shared/Xamarin.Shared.targets | 118 ++++++++++++++++++ .../Xamarin.iOS.Common.targets | 95 -------------- 3 files changed, 118 insertions(+), 193 deletions(-) diff --git a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets index 49665c3c9e..f7cdab8dba 100644 --- a/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets +++ b/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets @@ -386,106 +386,8 @@ Copyright (C) 2014 Xamarin. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_BuildReferencedExtensionProjects Condition="'$(BuildingInsideVisualStudio)' != 'true'">true - - - - - - - - - - - - - - - - - _CoreArchive diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index 91bd9fd96b..ff564ceb74 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -912,6 +912,124 @@ Copyright (C) 2018 Microsoft. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_BuildReferencedExtensionProjects Condition="'$(BuildingInsideVisualStudio)' != 'true'">true + + + + + + + + + + + + + + + + + + + + + <_ResolvedAppExtensionReferences Condition="'%(_ResolvedAppExtensionReferences.Extension)' == '.appex'"> + PlugIns + + <_ResolvedAppExtensionReferences Condition="'%(_ResolvedAppExtensionReferences.Extension)' == '.xpc'"> + XPCServices + + + + + <_AppExtensionRoot Condition="'$(_PlatformName)' == 'macOS'">$(_AppBundlePath)Contents\ + <_AppExtensionRoot Condition="'$(_PlatformName)' != 'macOS'">$(_AppBundlePath) + + + + + + + + + + + + diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets index 0058ecab0e..3575599369 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets @@ -954,82 +954,6 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_BuildReferencedExtensionProjects Condition="'$(BuildingInsideVisualStudio)' != 'true'">true - - - - - - - - - - - - - - - - - - - - - - - - - - -