Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the platform directly for apple products #55381

Merged
merged 3 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@

<PropertyGroup>
<WorkloadManifestPath>$(IntermediateOutputPath)WorkloadManifest.json</WorkloadManifestPath>
<WorkloadManifestTargetsPath>$(IntermediateOutputPath)WorkloadManifest.targets</WorkloadManifestTargetsPath>
</PropertyGroup>

<ItemGroup>
<PackageFile Include="$(WorkloadManifestPath)" TargetPath="data" />
<PackageFile Include="WorkloadManifest.targets" TargetPath="data" />
<PackageFile Include="$(WorkloadManifestTargetsPath)" TargetPath="data" />
</ItemGroup>
</Target>

Expand All @@ -37,6 +38,10 @@
TemplateFile="WorkloadManifest.json.in"
Properties="@(_WorkloadManifestValues)"
OutputPath="$(WorkloadManifestPath)" />
<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.targets.in"
Properties="@(_WorkloadManifestValues)"
OutputPath="$(WorkloadManifestTargetsPath)" />
</Target>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.ios-arm",
"Microsoft.NETCore.App.Runtime.Mono.ios-arm64",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
Expand All @@ -58,8 +60,22 @@
"abstract": true,
"description": "MacCatalyst Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst",
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst"
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64",
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-x64"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-macos": {
"abstract": true,
"description": "MacOS CoreCLR and Mono Runtime Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64",
"Microsoft.NETCore.App.Runtime.Mono.osx-x64",
"Microsoft.NETCore.App.Runtime.osx-arm64",
"Microsoft.NETCore.App.Runtime.osx-x64"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
Expand All @@ -69,9 +85,11 @@
"description": "tvOS Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.tvos-arm64",
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator",
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator-arm64",
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator-x64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator"
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-x64"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
Expand Down Expand Up @@ -154,13 +172,29 @@
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst": {
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64": {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst-64": {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64": {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.Mono.osx-x64": {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.osx-arm64": {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.osx-x64": {
"kind": "framework",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.ios-arm" : {
"kind": "framework",
Expand All @@ -170,20 +204,17 @@
"kind": "framework",
"version": "${PackageVersion}"
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator" : {
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64" : {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64" : {
"kind": "framework",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86" : {
"kind": "framework",
"version": "${PackageVersion}",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64": {
"kind": "Sdk",
Expand All @@ -197,27 +228,43 @@
"kind": "framework",
"version": "${PackageVersion}"
},
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator" : {
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator-arm64" : {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator-x64" : {
"kind": "framework",
"version": "${PackageVersion}",
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-arm64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-x64"
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst": {
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-x64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-x64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator": {
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-arm64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-arm64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-x64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-x64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-x64"
}
},
Expand All @@ -237,18 +284,27 @@
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64",
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator": {
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-arm64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-arm64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x64": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86": {
"kind": "Sdk",
"version": "${PackageVersion}",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x86",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x86"
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project>
<PropertyGroup>
<RuntimePackInWorkloadVersion>${PackageVersion}</RuntimePackInWorkloadVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm' AND '$(UsingBrowserRuntimeWorkload)' == ''">
<UsingBrowserRuntimeWorkload Condition="'$(RunAOTCompilation)' == 'true' or '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true'" >true</UsingBrowserRuntimeWorkload>
<UsingBrowserRuntimeWorkload Condition="'$(UsingBrowserRuntimeWorkload)' == ''" >$(WasmNativeWorkload)</UsingBrowserRuntimeWorkload>
Expand All @@ -21,31 +24,47 @@
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64" />
</ImportGroup>

<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'ios' and $([MSBuild]::IsOSPlatform('osx'))">
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'macOS'">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>
<!--
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'macOS' and $([MSBuild]::IsOSPlatform('osx'))">
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.osx-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.osx-x64" />
</ImportGroup>
-->

<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst' and $([MSBuild]::IsOSPlatform('osx'))">
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'ios'">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'ios' and $([MSBuild]::IsOSPlatform('osx'))">
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86" />
</ImportGroup>

<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'tvos' and $([MSBuild]::IsOSPlatform('osx'))">
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst' and $([MSBuild]::IsOSPlatform('osx'))">
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-x64" />
</ImportGroup>

<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'tvossimulator'">
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'tvos'">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>
<ImportGroup Condition="'$(TargetPlatformIdentifier)' == 'tvos' and $([MSBuild]::IsOSPlatform('osx'))">
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-arm64" />
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator-x64" />
</ImportGroup>

<ImportGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm' and '$(UsingBrowserRuntimeWorkload)' == 'true'">
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
Expand All @@ -54,4 +73,43 @@
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>

<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == 'android' or '$(TargetPlatformIdentifier)' == 'macOS' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'maccatalyst' or '$(TargetPlatformIdentifier)' == 'tvos' or ('$(RuntimeIdentifier)' == 'browser-wasm' and '$(UsingBrowserRuntimeWorkload)' == 'true')">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a strict enough check on macOS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it wasn't at first, but I believe macOS is the TFM for xam.mac. So, we wouldn't be interfering w/ anything else.

<_MonoWorkloadTargetsMobile>true</_MonoWorkloadTargetsMobile>
<_MonoWorkloadRuntimePackPackageVersion>$(RuntimePackInWorkloadVersion)</_MonoWorkloadRuntimePackPackageVersion>
</PropertyGroup>

<ItemGroup Condition="'$(_MonoWorkloadTargetsMobile)' == 'true'">
<MonoRuntimePackRids Include="
linux-x64;
win-x64;
osx-x64;
osx-arm64;
maccatalyst-x64;
maccatalyst-arm64;
browser-wasm;
ios-arm64;
ios-arm;
iossimulator-arm64;
iossimulator-x64;
iossimulator-x86;
tvos-arm64;
tvossimulator-arm64;
tvossimulator-x64;
android-arm64;
android-arm;
android-x64;
android-x86;
" />

<KnownRuntimePack Remove="Microsoft.NETCore.App" />
<KnownRuntimePack Include="Microsoft.NETCore.App"
TargetFramework="net6.0"
Copy link
Member

@akoeplinger akoeplinger Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lewing @steveisok while this works for now, it'll break once we move to net7.0. Can you try whether doing this instead of the Remove works:

<KnownRuntimePack Update="Microsoft.NETCore.App"
                  LatestRuntimeFrameworkVersion="$(_MonoWorkloadRuntimePackPackageVersion)"
                  Condition="'%(RuntimePackLabels)' == 'Mono' and '%(TargetFramework)' == 'net$(TargetFrameworkVersion)'"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing

RuntimeFrameworkName="Microsoft.NETCore.App"
LatestRuntimeFrameworkVersion="$(_MonoWorkloadRuntimePackPackageVersion)"
RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.Mono.**RID**"
RuntimePackRuntimeIdentifiers="@(MonoRuntimePackRids, '%3B')"
RuntimePackLabels="Mono"
/>
</ItemGroup>

</Project>