Skip to content

Commit f2ddc6d

Browse files
committed
Set UseMonoRuntime property so the dotnet SDK can pull the mono runtime packs
This is necessary after the changes from dotnet/sdk#16909.
1 parent 77da330 commit f2ddc6d

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

eng/Subsets.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
4040
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
4141
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
42+
43+
<!-- this property is used by the SDK to pull in mono-based runtime packs -->
44+
<UseMonoRuntime Condition="'$(UseMonoRuntime)' == '' and '$(RuntimeFlavor)' == 'Mono'">true</UseMonoRuntime>
4245
</PropertyGroup>
4346

4447
<PropertyGroup>

eng/targetingpacks.targets

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,22 @@
1515
<ItemGroup Condition="'$(UseLocalTargetingRuntimePack)' == 'true'">
1616
<KnownFrameworkReference Include="$(LocalFrameworkOverrideName)"
1717
DefaultRuntimeFrameworkVersion="$(ProductVersion)"
18-
IsTrimmable="true"
1918
LatestRuntimeFrameworkVersion="$(ProductVersion)"
2019
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
2120
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**"
22-
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;ios-arm64;iossimulator-arm64;ios-arm;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;maccatalyst-x64;maccatalyst-arm64;android-arm64;android-arm;android-x64;android-x86;browser-wasm;osx-arm64"
21+
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64"
2322
TargetFramework="$(NetCoreAppCurrent)"
2423
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
2524
TargetingPackVersion="$(ProductVersion)"
2625
Condition="'@(KnownFrameworkReference)' == '' or !@(KnownFrameworkReference->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
26+
<KnownRuntimePack Include="$(LocalFrameworkOverrideName)"
27+
TargetFramework="$(NetCoreAppCurrent)"
28+
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
29+
LatestRuntimeFrameworkVersion="$(ProductVersion)"
30+
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
31+
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;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"
32+
RuntimePackLabels="Mono"
33+
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
2734
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
2835
AppHostPackNamePattern="$(LocalFrameworkOverrideName).Host.**RID**"
2936
AppHostPackVersion="$(ProductVersion)"

eng/testing/linker/SupportFiles/Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@
2121

2222
<ItemGroup>
2323
<FrameworkReference Include="Microsoft.NETCore.App" />
24+
<FrameworkReference Update="Microsoft.NETCore.App"
25+
RuntimePackLabels="Mono"
26+
Condition="'$(UseMonoRuntime)' == 'true'" />
2427
</ItemGroup>
2528
</Project>

eng/testing/linker/project.csproj.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<RepositoryEngineeringDir>{RepositoryEngineeringDir}</RepositoryEngineeringDir>
1111
<TargetFramework>{NetCoreAppCurrent}</TargetFramework>
1212
<RuntimeIdentifier>{RuntimeIdentifier}</RuntimeIdentifier>
13+
<UseMonoRuntime>{UseMonoRuntime}</UseMonoRuntime>
1314
<TargetingPackDir>{TargetingPackDir}</TargetingPackDir>
1415
<NETCoreAppMaximumVersion>{NetCoreAppMaximumVersion}</NETCoreAppMaximumVersion>
1516
<MicrosoftNETCoreAppVersion>{MicrosoftNETCoreAppVersion}</MicrosoftNETCoreAppVersion>

eng/testing/linker/trimmingTests.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
.Replace('{NetCoreAppMaximumVersion}', '$(NetCoreAppMaximumVersion)')
7575
.Replace('{TargetingPackDir}','$(MicrosoftNetCoreAppRefPackDir)')
7676
.Replace('{RuntimeIdentifier}','%(TestConsoleApps.TestRuntimeIdentifier)')
77+
.Replace('{UseMonoRuntime}','$(UseMonoRuntime)')
7778
.Replace('{MicrosoftNETILLinkTasksVersion}', '$(MicrosoftNETILLinkTasksVersion)')
7879
.Replace('{ExtraTrimmerArgs}', '%(TestConsoleApps.ExtraTrimmerArgs)')
7980
.Replace('{AdditionalProjectReferences}', '$(_additionalProjectReferencesString)')

src/mono/sample/Android/AndroidSampleApp.csproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
<ForceAOT Condition="'$(ForceAOT)' == ''">false</ForceAOT>
1111
</PropertyGroup>
1212

13-
<!-- Redirect 'dotnet publish' to in-tree runtime pack -->
14-
<Target Name="TrickRuntimePackLocation" AfterTargets="ProcessFrameworkReferences">
15-
<ItemGroup>
16-
<RuntimePack>
17-
<PackageDirectory>$(ArtifactsBinDir)microsoft.netcore.app.runtime.$(RuntimeIdentifier)\$(Configuration)</PackageDirectory>
18-
</RuntimePack>
19-
</ItemGroup>
20-
<Message Text="Packaged ID: %(RuntimePack.PackageDirectory)" Importance="high" />
21-
</Target>
22-
2313
<Import Project="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.props" />
2414
<UsingTask TaskName="AndroidAppBuilderTask" AssemblyFile="$(AndroidAppBuilderTasksAssemblyPath)"/>
2515
<UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />

0 commit comments

Comments
 (0)