From 6168523b0cb0f7acf3daf3f2f88ab6230b373bb9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 30 Apr 2026 12:24:56 +0200 Subject: [PATCH 1/2] [msbuild] Introduce SdkIsDesktop property for macOS/MacCatalyst checks. Introduce a new 'SdkIsDesktop' property that is true when building for macOS or Mac Catalyst. Replace the repeated pattern of checking both '_PlatformName == macOS Or _PlatformName == MacCatalyst' with 'SdkIsDesktop == true' (and the negated form) across all MSBuild targets, props, and test project files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/building-apps/build-properties.md | 12 ++++++ dotnet/targets/Microsoft.Sdk.Desktop.targets | 2 +- dotnet/targets/Microsoft.Sdk.Mobile.targets | 4 +- .../Xamarin.Shared.Sdk.Publish.targets | 4 +- dotnet/targets/Xamarin.Shared.Sdk.props | 3 ++ dotnet/targets/Xamarin.Shared.Sdk.targets | 24 +++++------ msbuild/Xamarin.Shared/Xamarin.Shared.props | 10 ++--- msbuild/Xamarin.Shared/Xamarin.Shared.targets | 42 +++++++++---------- tests/dotnet/BundleStructure/shared.csproj | 4 +- .../CustomizedCodeSigning/shared.csproj | 4 +- tests/monotouch-test/dotnet/shared.csproj | 8 ++-- 11 files changed, 66 insertions(+), 51 deletions(-) diff --git a/docs/building-apps/build-properties.md b/docs/building-apps/build-properties.md index ab6a1742229a..876811e83da1 100644 --- a/docs/building-apps/build-properties.md +++ b/docs/building-apps/build-properties.md @@ -1234,6 +1234,18 @@ $ dotnet run -p:StandardInputPath=stdin.txt Note: this can also be accomplished by passing `--stdin ...` using the [OpenArguments](#openarguments) property. +## SdkIsDesktop + +This property is a read-only property (setting it will have no effect) that +specifies whether we're building for a desktop platform (macOS or Mac Catalyst). + +This property is `true` when the target platform is macOS or Mac Catalyst, +and is not set for iOS or tvOS builds. + +Like `SdkIsSimulator`, this property is only set after [imports and +properties](/visualstudio/msbuild/build-process-overview#evaluate-imports-and-properties) +have been evaluated. + ## SdkIsDevice This property is a read-only property (setting it will have no effect) that diff --git a/dotnet/targets/Microsoft.Sdk.Desktop.targets b/dotnet/targets/Microsoft.Sdk.Desktop.targets index 276822e3c2e4..d8d90ab7c46d 100644 --- a/dotnet/targets/Microsoft.Sdk.Desktop.targets +++ b/dotnet/targets/Microsoft.Sdk.Desktop.targets @@ -4,7 +4,7 @@ Name="_PrepareRunDesktop" BeforeTargets="ComputeRunArguments" DependsOnTargets="_ValidateHotReloadConfiguration" - Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'"> + Condition="'$(SdkIsDesktop)' == 'true'"> @@ -145,7 +145,7 @@ Name="_PrepareRunMobile" BeforeTargets="ComputeRunArguments" DependsOnTargets="_ValidateHotReloadConfiguration;_InstallMobile;ComputeMlaunchRunArguments" - Condition="'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'"> + Condition="'$(SdkIsDesktop)' != 'true'"> $(PublishDir) @@ -22,6 +22,6 @@ - + diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index ae5137fbbf76..4e2f25c71071 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -151,6 +151,9 @@ true + + true + iPhoneSimulator iPhone diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 341e08ac0808..9d4317f425f5 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -102,7 +102,7 @@ - + @@ -532,7 +532,7 @@ --> managed-static managed-static - managed-static + managed-static partial-static dynamic @@ -1249,7 +1249,7 @@ - <_RunAotCompiler Condition="'$(_SdkIsSimulator)' != 'true' And '$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'">true + <_RunAotCompiler Condition="'$(_SdkIsSimulator)' != 'true' And '$(SdkIsDesktop)' != 'true'">true <_RunAotCompiler Condition="'$(MtouchInterpreter)' != '' And '$(_PlatformName)' != 'macOS'">true @@ -1273,9 +1273,9 @@ <_IntermediateFrameworksDir>$(DeviceSpecificIntermediateOutputPath)frameworks <_IntermediateDecompressionDir>$([MSBuild]::EnsureTrailingSlash('$(DeviceSpecificIntermediateOutputPath)decompressed')) <_NativeExecutablePublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ - <_NativeExecutablePublishDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(_RelativeAppBundlePath)\Contents\MacOS\ + <_NativeExecutablePublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\MacOS\ <_AppBundleFrameworksDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\Frameworks\ - <_AppBundleFrameworksDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(_RelativeAppBundlePath)\Contents\Frameworks\ + <_AppBundleFrameworksDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\Frameworks\ <_AOTInputDirectory>$(_IntermediateNativeLibraryDir)aot-input/ <_AOTOutputDirectory>$(_IntermediateNativeLibraryDir)aot-output/ @@ -1309,10 +1309,10 @@ <_LibXamarinName Condition="'$(_LibXamarinName)' == ''">libxamarin-dotnet$(_LibXamarinRuntime)$(_LibXamarinDebug).$(_LibXamarinExtension) <_DylibRPath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path - <_DylibRPath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">@executable_path/../$(_CustomBundleName)/ + <_DylibRPath Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../$(_CustomBundleName)/ <_EmbeddedFrameworksRPath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path/Frameworks - <_EmbeddedFrameworksRPath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">@executable_path/../Frameworks/ + <_EmbeddedFrameworksRPath Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../Frameworks/ <_RuntimeConfigurationFile>runtimeconfig.bin @@ -1321,7 +1321,7 @@ <_CustomLinkFlags Include="-rpath" /> <_CustomLinkFlags Include="@executable_path/../../Frameworks" Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'" /> - <_CustomLinkFlags Include="@executable_path/../../../../Frameworks" Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'" /> + <_CustomLinkFlags Include="@executable_path/../../../../Frameworks" Condition="'$(SdkIsDesktop)' == 'true'" /> @@ -1904,7 +1904,7 @@ <_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path/ - <_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">@executable_path/../../ + <_ExecutablePathPrefix Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../../ @@ -2073,9 +2073,9 @@ > <_AssemblyPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ - <_AssemblyPublishDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ + <_AssemblyPublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ <_DylibPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ - <_DylibPublishDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ + <_DylibPublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ <_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$(DeviceSpecificIntermediateOutputPath)$(_RuntimeConfigurationFile) @@ -2105,7 +2105,7 @@ + Condition="('$(_SdkIsSimulator)' != 'false' Or '$(SdkIsDesktop)' == 'true') And ('%(Extension)' == '.dylib' Or '%(Extension)' == '.so') " /> <_CanArchive>false - <_CanArchive Condition="('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst') And '$(OutputType)' == 'Exe' And '$(IsAppExtension)' == 'false'">true + <_CanArchive Condition="'$(SdkIsDesktop)' == 'true' And '$(OutputType)' == 'Exe' And '$(IsAppExtension)' == 'false'">true <_CanArchive Condition="'$(OutputType)' == 'Exe' And '$(SdkIsDevice)' == 'true' And '$(IsAppExtension)' == 'false'">true @@ -122,7 +122,7 @@ Copyright (C) 2020 Microsoft. All rights reserved. $(MtouchNoSymbolStrip) true - true + true true false @@ -131,7 +131,7 @@ Copyright (C) 2020 Microsoft. All rights reserved. $(MtouchNoDSymUtil) - true + true true false @@ -182,7 +182,7 @@ Copyright (C) 2020 Microsoft. All rights reserved. <_EmbeddedResourcePrefix Condition="'$(_PlatformName)' == 'macOS'">xammac <_EmbeddedResourcePrefix Condition="'$(_PlatformName)' != 'macOS'">monotouch - <_AppBundleManifestRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents/ + <_AppBundleManifestRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents/ .xpc .appex @@ -191,7 +191,7 @@ Copyright (C) 2020 Microsoft. All rights reserved. all - <_AppBundleName Condition="'$(_AppBundleName)' == '' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 10.0)) And ('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst')">$(ApplicationTitle) + <_AppBundleName Condition="'$(_AppBundleName)' == '' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 10.0)) And '$(SdkIsDesktop)' == 'true'">$(ApplicationTitle) <_AppBundleName Condition="'$(_AppBundleName)' == ''">$(AssemblyName) diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index c5139ca6acc1..59c63ac4ab54 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -294,7 +294,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. - + @@ -302,7 +302,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. @@ -320,7 +320,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. @@ -348,7 +348,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. - + @@ -1278,7 +1278,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. will apply to Xamarin.Mac as well. --> - <_PkgInfoPath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(_AppBundlePath)Contents\PkgInfo + <_PkgInfoPath Condition="'$(SdkIsDesktop)' == 'true'">$(_AppBundlePath)Contents\PkgInfo <_PkgInfoPath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">$(_AppBundlePath)PkgInfo @@ -2082,7 +2082,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. - <_EmbeddedProvisionProfilePath Condition="'$(_EmbeddedProvisionProfilePath)' == '' And ('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst')">$(_AppBundlePath)Contents\embedded.provisionprofile + <_EmbeddedProvisionProfilePath Condition="'$(_EmbeddedProvisionProfilePath)' == '' And '$(SdkIsDesktop)' == 'true'">$(_AppBundlePath)Contents\embedded.provisionprofile <_EmbeddedProvisionProfilePath Condition="'$(_EmbeddedProvisionProfilePath)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS')">$(_AppBundlePath)embedded.mobileprovision @@ -2790,12 +2790,12 @@ Copyright (C) 2018 Microsoft. All rights reserved. <_NativeExecutableRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">$(_ExecutableName) - <_NativeExecutableRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\MacOS\$(_ExecutableName) + <_NativeExecutableRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\MacOS\$(_ExecutableName) <_NativeExecutable>$(_AppBundlePath)$(_NativeExecutableRelativePath) - - + @@ -3252,30 +3252,30 @@ Copyright (C) 2018 Microsoft. All rights reserved. <_AppBundlePath>$(AppBundleDir) <_AppBundlePath Condition="$([System.IO.Path]::IsPathRooted('$(AppBundleDir)'))">$([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)','$(AppBundleDir)')) <_AppBundlePath>$([MSBuild]::EnsureTrailingSlash('$(_AppBundlePath)')) - <_AppResourcesRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\Resources\ + <_AppResourcesRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\Resources\ <_AppResourcesRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'"> <_AppResourcesPath>$(_AppBundlePath)$(_AppResourcesRelativePath) - <_AppContentsRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\$(_CustomBundleName) + <_AppContentsRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\$(_CustomBundleName) <_AppContentsRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'"> <_AppContentsPath>$(_AppBundlePath)$(_AppContentsRelativePath) - <_AppFrameworksRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\Frameworks\ + <_AppFrameworksRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\Frameworks\ <_AppFrameworksRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">Frameworks\ <_AppFrameworksPath>$(_AppBundlePath)$(_AppFrameworksRelativePath) - <_AppCodeSignatureRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\ + <_AppCodeSignatureRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\ <_AppCodeSignatureRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'"> <_AppCodeSignaturePath>$(_AppBundlePath)$(_AppCodeSignatureRelativePath) - <_AppPlugInsRelativeLocation Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\ + <_AppPlugInsRelativeLocation Condition="'$(SdkIsDesktop)' == 'true'">Contents\ <_AppPlugInsRelativeLocation Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'"> <_AppPlugInsRelativePath>$(_AppPlugInsRelativeLocation)PlugIns\ <_AppExtensionRoot>$(_AppBundlePath)$(_AppPlugInsRelativeLocation) <_AppPlugInsPath>$(_AppBundlePath)$(_AppPlugInsRelativePath) - <_AppXpcServicesRelativePath Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">Contents\XPCServices\ + <_AppXpcServicesRelativePath Condition="'$(SdkIsDesktop)' == 'true'">Contents\XPCServices\ <_AppXpcServicesRelativePath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">XPCServices\ <_AppXpcServicesPath>$(_AppBundlePath)$(_AppXpcServicesRelativePath) @@ -3375,7 +3375,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. - + diff --git a/tests/dotnet/BundleStructure/shared.csproj b/tests/dotnet/BundleStructure/shared.csproj index 2f8ad66ed705..e94d15aacf61 100644 --- a/tests/dotnet/BundleStructure/shared.csproj +++ b/tests/dotnet/BundleStructure/shared.csproj @@ -162,7 +162,7 @@ - + @@ -177,7 +177,7 @@ - + diff --git a/tests/dotnet/CustomizedCodeSigning/shared.csproj b/tests/dotnet/CustomizedCodeSigning/shared.csproj index 5e0d08bca288..f2cbc49178e2 100644 --- a/tests/dotnet/CustomizedCodeSigning/shared.csproj +++ b/tests/dotnet/CustomizedCodeSigning/shared.csproj @@ -18,12 +18,12 @@ $(CreateAppBundleDependsOn);CopyCustomFiles; - + Contents/SharedSupport Contents/MacOS Contents/MonoBundle - + SharedSupport diff --git a/tests/monotouch-test/dotnet/shared.csproj b/tests/monotouch-test/dotnet/shared.csproj index 37437089b7fe..38b4a9409280 100644 --- a/tests/monotouch-test/dotnet/shared.csproj +++ b/tests/monotouch-test/dotnet/shared.csproj @@ -46,8 +46,8 @@ - - + + @@ -238,11 +238,11 @@ - Contents/Resources/ + Contents/Resources/ - + <_SmeltingSdk Condition="'$(_PlatformName)' == 'iOS'">iphoneos <_SmeltingSdk Condition="'$(_PlatformName)' == 'tvOS'">appletvos From 9a8b6465893f13347d966c8032126327c0dd255c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 May 2026 09:00:06 +0200 Subject: [PATCH 2/2] [msbuild] Introduce SdkIsMobile property for iOS/tvOS checks. Add a new SdkIsMobile property that is true when building for a mobile platform (iOS or tvOS). Update all pure iOS/tvOS platform checks to use this property, simplifying conditions throughout the build system. Deliberately not updated: - Checks that also include watchOS (bundle structure paths, PkgInfo, etc.) - The DynamicCodeSupport check (also includes MacCatalyst) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/building-apps/build-properties.md | 12 ++++++++++ dotnet/targets/Microsoft.Sdk.Mobile.targets | 2 +- .../Xamarin.Shared.Sdk.Publish.targets | 4 ++-- dotnet/targets/Xamarin.Shared.Sdk.props | 7 ++++-- dotnet/targets/Xamarin.Shared.Sdk.targets | 22 +++++++++---------- msbuild/Xamarin.Shared/Xamarin.Shared.targets | 4 ++-- tests/monotouch-test/dotnet/shared.csproj | 6 ++--- 7 files changed, 36 insertions(+), 21 deletions(-) diff --git a/docs/building-apps/build-properties.md b/docs/building-apps/build-properties.md index 876811e83da1..589531ba0902 100644 --- a/docs/building-apps/build-properties.md +++ b/docs/building-apps/build-properties.md @@ -1259,6 +1259,18 @@ Like `SdkIsSimulator`, this property is only set after [imports and properties](/visualstudio/msbuild/build-process-overview#evaluate-imports-and-properties) have been evaluated. +## SdkIsMobile + +This property is a read-only property (setting it will have no effect) that +specifies whether we're building for a mobile platform (iOS or tvOS). + +This property is `true` when the target platform is iOS or tvOS, and is not +set for macOS or Mac Catalyst builds. + +Like `SdkIsSimulator`, this property is only set after [imports and +properties](/visualstudio/msbuild/build-process-overview#evaluate-imports-and-properties) +have been evaluated. + ## SdkIsSimulator This property is a read-only property (setting it will have no effect) that diff --git a/dotnet/targets/Microsoft.Sdk.Mobile.targets b/dotnet/targets/Microsoft.Sdk.Mobile.targets index 2a39e6efa038..249dea203877 100644 --- a/dotnet/targets/Microsoft.Sdk.Mobile.targets +++ b/dotnet/targets/Microsoft.Sdk.Mobile.targets @@ -162,7 +162,7 @@ --> <_FilterDevicesToRuntimeIdentifier Condition="'$(_XamarinUsingDefaultRuntimeIdentifier)' != 'true'">$(RuntimeIdentifier) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.Publish.targets b/dotnet/targets/Xamarin.Shared.Sdk.Publish.targets index 9c883512d61f..c053793baf15 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.Publish.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.Publish.targets @@ -2,7 +2,7 @@ - true + true true @@ -21,7 +21,7 @@ /> - + diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index 4e2f25c71071..e5d725090214 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -148,8 +148,11 @@ $(_SdkIsSimulator) + + true + - true + true true @@ -202,7 +205,7 @@ but the MtouchUseLlvm value is ignored when using the simulator, so it doesn't matter if we set it in all cases. --> - + true diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 9d4317f425f5..08a4cd3775bf 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -101,7 +101,7 @@ - + @@ -531,7 +531,7 @@ - Otherwise set 'dynamic' --> managed-static - managed-static + managed-static managed-static partial-static dynamic @@ -597,7 +597,7 @@ <_LinkerCacheDirectory Condition="'$(BuildSessionId)' != ''">$(IntermediateOutputPath)linker-cache - <_IsSimulatorFeature Condition="('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS') And '$(_SdkIsSimulator)' == 'true'">true + <_IsSimulatorFeature Condition="'$(SdkIsMobile)' == 'true' And '$(_SdkIsSimulator)' == 'true'">true <_IsSimulatorFeature Condition="'$(_IsSimulatorFeature)' == ''">false @@ -1272,9 +1272,9 @@ <_IntermediateNativeLibraryDir>$(IntermediateOutputPath)nativelibraries/ <_IntermediateFrameworksDir>$(DeviceSpecificIntermediateOutputPath)frameworks <_IntermediateDecompressionDir>$([MSBuild]::EnsureTrailingSlash('$(DeviceSpecificIntermediateOutputPath)decompressed')) - <_NativeExecutablePublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ + <_NativeExecutablePublishDir Condition="'$(SdkIsMobile)' == 'true'">$(_RelativeAppBundlePath)\ <_NativeExecutablePublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\MacOS\ - <_AppBundleFrameworksDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\Frameworks\ + <_AppBundleFrameworksDir Condition="'$(SdkIsMobile)' == 'true'">$(_RelativeAppBundlePath)\Frameworks\ <_AppBundleFrameworksDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\Frameworks\ <_AOTInputDirectory>$(_IntermediateNativeLibraryDir)aot-input/ @@ -1308,10 +1308,10 @@ <_LibXamarinDebug Condition="'$(_BundlerDebug)' == 'true'">-debug <_LibXamarinName Condition="'$(_LibXamarinName)' == ''">libxamarin-dotnet$(_LibXamarinRuntime)$(_LibXamarinDebug).$(_LibXamarinExtension) - <_DylibRPath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path + <_DylibRPath Condition="'$(SdkIsMobile)' == 'true'">@executable_path <_DylibRPath Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../$(_CustomBundleName)/ - <_EmbeddedFrameworksRPath Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path/Frameworks + <_EmbeddedFrameworksRPath Condition="'$(SdkIsMobile)' == 'true'">@executable_path/Frameworks <_EmbeddedFrameworksRPath Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../Frameworks/ <_RuntimeConfigurationFile>runtimeconfig.bin @@ -1320,7 +1320,7 @@ <_CustomLinkFlags Include="-rpath" /> - <_CustomLinkFlags Include="@executable_path/../../Frameworks" Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'" /> + <_CustomLinkFlags Include="@executable_path/../../Frameworks" Condition="'$(SdkIsMobile)' == 'true'" /> <_CustomLinkFlags Include="@executable_path/../../../../Frameworks" Condition="'$(SdkIsDesktop)' == 'true'" /> @@ -1903,7 +1903,7 @@ - <_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">@executable_path/ + <_ExecutablePathPrefix Condition="'$(SdkIsMobile)' == 'true'">@executable_path/ <_ExecutablePathPrefix Condition="'$(SdkIsDesktop)' == 'true'">@executable_path/../../ @@ -2072,9 +2072,9 @@ Condition="'$(_CanOutputAppBundle)' == 'true'" > - <_AssemblyPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ + <_AssemblyPublishDir Condition="'$(SdkIsMobile)' == 'true'">$(_RelativeAppBundlePath)\ <_AssemblyPublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ - <_DylibPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'">$(_RelativeAppBundlePath)\ + <_DylibPublishDir Condition="'$(SdkIsMobile)' == 'true'">$(_RelativeAppBundlePath)\ <_DylibPublishDir Condition="'$(SdkIsDesktop)' == 'true'">$(_RelativeAppBundlePath)\Contents\$(_CustomBundleName)\ <_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$(DeviceSpecificIntermediateOutputPath)$(_RuntimeConfigurationFile) diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index 59c63ac4ab54..904b1965ab3b 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -2574,7 +2574,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. > - true + true false @@ -3269,7 +3269,7 @@ Copyright (C) 2018 Microsoft. All rights reserved. <_AppCodeSignaturePath>$(_AppBundlePath)$(_AppCodeSignatureRelativePath) <_AppPlugInsRelativeLocation Condition="'$(SdkIsDesktop)' == 'true'">Contents\ - <_AppPlugInsRelativeLocation Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'"> + <_AppPlugInsRelativeLocation Condition="'$(SdkIsMobile)' == 'true'"> <_AppPlugInsRelativePath>$(_AppPlugInsRelativeLocation)PlugIns\ <_AppExtensionRoot>$(_AppBundlePath)$(_AppPlugInsRelativeLocation) diff --git a/tests/monotouch-test/dotnet/shared.csproj b/tests/monotouch-test/dotnet/shared.csproj index 38b4a9409280..447dd3f4e2b0 100644 --- a/tests/monotouch-test/dotnet/shared.csproj +++ b/tests/monotouch-test/dotnet/shared.csproj @@ -49,9 +49,9 @@ - - - + + +