Skip to content

Commit a5d51a7

Browse files
committed
[One .NET] Fix KnownFrameworkReference for API 33
1 parent 184e89a commit a5d51a7

File tree

2 files changed

+39
-50
lines changed

2 files changed

+39
-50
lines changed

build-tools/create-packs/Microsoft.Android.Sdk.proj

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -102,56 +102,11 @@ core workload SDK packs imported by WorkloadManifest.targets.
102102
<BundledVersionsFileName>Microsoft.Android.Sdk.BundledVersions.targets</BundledVersionsFileName>
103103
</PropertyGroup>
104104

105-
<ItemGroup>
106-
<_AndroidNETAppRuntimePackRids Include="android-arm;android-arm64;android-x86;android-x64" />
107-
</ItemGroup>
108-
109-
<PropertyGroup>
110-
<BundledVersionsContent>
111-
<![CDATA[
112-
<!--
113-
***********************************************************************************************
114-
$(BundledVersionsFileName)
115-
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
116-
created a backup copy. Incorrect changes to this file will make it
117-
impossible to load or build your projects from the command-line or the IDE.
118-
***********************************************************************************************
119-
-->
120-
<Project>
121-
<PropertyGroup>
122-
<AndroidNETSdkVersion>$(AndroidPackVersionLong)</AndroidNETSdkVersion>
123-
<XamarinAndroidVersion>$(AndroidPackVersionLong)</XamarinAndroidVersion>
124-
</PropertyGroup>
125-
<PropertyGroup Condition=" '%24(TargetPlatformVersion)' == '31.0' ">
126-
<_AndroidTargetingPackId>31</_AndroidTargetingPackId>
127-
</PropertyGroup>
128-
<PropertyGroup>
129-
<_AndroidTargetingPackId Condition=" '%24(_AndroidTargetingPackId)' == '' ">$(AndroidLatestStableApiLevel)</_AndroidTargetingPackId>
130-
<_AndroidTargetingPackVersion Condition=" '%24(_AndroidTargetingPackVersion)' == '' ">**FromWorkload**</_AndroidTargetingPackVersion>
131-
<_AndroidRuntimePackId Condition=" '%24(_AndroidRuntimePackId)' == '' ">$(AndroidLatestStableApiLevel)</_AndroidRuntimePackId>
132-
<_AndroidRuntimePackVersion Condition=" '%24(_AndroidRuntimePackVersion)' == '' ">**FromWorkload**</_AndroidRuntimePackVersion>
133-
</PropertyGroup>
134-
<ItemGroup>
135-
<KnownFrameworkReference
136-
Include="Microsoft.Android"
137-
TargetFramework="$(_AndroidNETAppTargetFramework)"
138-
RuntimeFrameworkName="Microsoft.Android"
139-
LatestRuntimeFrameworkVersion="%24(_AndroidRuntimePackVersion)"
140-
TargetingPackName="Microsoft.Android.Ref.%24(_AndroidTargetingPackId)"
141-
TargetingPackVersion="%24(_AndroidTargetingPackVersion)"
142-
RuntimePackNamePatterns="Microsoft.Android.Runtime.%24(_AndroidRuntimePackId).**RID**"
143-
RuntimePackRuntimeIdentifiers="@(_AndroidNETAppRuntimePackRids, '%3B')"
144-
Profile="Android"
145-
/>
146-
</ItemGroup>
147-
</Project>
148-
]]>
149-
</BundledVersionsContent>
150-
</PropertyGroup>
151-
152-
<WriteLinesToFile File="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.Android.Sdk\targets\$(BundledVersionsFileName)"
153-
Lines="$(BundledVersionsContent)"
154-
Overwrite="true" />
105+
<ReplaceFileContents
106+
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.Android.Sdk\input\Microsoft.Android.Sdk.BundledVersions.in.targets"
107+
DestinationFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.Android.Sdk\targets\$(BundledVersionsFileName)"
108+
Replacements="@AndroidPackVersionLong@=$(AndroidPackVersionLong)" >
109+
</ReplaceFileContents>
155110
</Target>
156111

157112
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
***********************************************************************************************
3+
Microsoft.Android.Sdk.BundledVersions.targets
4+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
5+
created a backup copy. Incorrect changes to this file will make it
6+
impossible to load or build your projects from the command-line or the IDE.
7+
***********************************************************************************************
8+
-->
9+
<Project>
10+
<PropertyGroup>
11+
<AndroidNETSdkVersion>@AndroidPackVersionLong@</AndroidNETSdkVersion>
12+
<XamarinAndroidVersion>@AndroidPackVersionLong@</XamarinAndroidVersion>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(TargetPlatformVersion)' == '31.0' ">
15+
<_AndroidRuntimePackId>32</_AndroidRuntimePackId>
16+
</PropertyGroup>
17+
<PropertyGroup>
18+
<_AndroidTargetingPackId>$(TargetPlatformVersion.TrimEnd('.0'))</_AndroidTargetingPackId>
19+
<_AndroidRuntimePackId Condition=" '$(_AndroidRuntimePackId)' == '' ">$(_AndroidTargetingPackId)</_AndroidRuntimePackId>
20+
</PropertyGroup>
21+
<ItemGroup>
22+
<KnownFrameworkReference
23+
Include="Microsoft.Android"
24+
TargetFramework="net6.0"
25+
RuntimeFrameworkName="Microsoft.Android"
26+
LatestRuntimeFrameworkVersion="**FromWorkload**"
27+
TargetingPackName="Microsoft.Android.Ref.$(_AndroidTargetingPackId)"
28+
TargetingPackVersion="**FromWorkload**"
29+
RuntimePackNamePatterns="Microsoft.Android.Runtime.$(_AndroidRuntimePackId).**RID**"
30+
RuntimePackRuntimeIdentifiers="android-arm;android-arm64;android-x86;android-x64"
31+
Profile="Android"
32+
/>
33+
</ItemGroup>
34+
</Project>

0 commit comments

Comments
 (0)