Skip to content

Commit 25b76c3

Browse files
pjcollinsjpobst
authored andcommitted
[Mono.Android] Add target to build additional API levels
Commit e4a75a8 removed some make magic that ensured Mono.Android.dll would be built multiple times for additional supported API levels. A couple of MSBuild tasks used to build multiple versions of Mono.Android.dll have been moved out of the `PackDotNet` target used by the Windows build and into the Mono.Android build to fix this. (cherry picked from commit c1d3e8e)
1 parent b8f89a8 commit 25b76c3

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

build-tools/scripts/BuildEverything.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ endif
1313

1414
leeroy:
1515
$(call DOTNET_BINLOG,leeroy) $(SOLUTION) $(_MSBUILD_ARGS)
16-
$(call DOTNET_BINLOG,preview-monoandroid) src/Mono.Android/Mono.Android.csproj -p:BuildLatestPreview=true
1716
$(call DOTNET_BINLOG,setup-workload) -t:ConfigureLocalWorkload build-tools/create-packs/Microsoft.Android.Sdk.proj

build-tools/scripts/DotNet.targets

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@
3030
</Target>
3131

3232
<Target Name="PackDotNet">
33-
<!-- Build extra versions of Mono.Android.dll if necessary -->
34-
<MSBuild
35-
Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' != '$(AndroidLatestStableApiLevel)' "
36-
Projects="$(_Root)src\Mono.Android\Mono.Android.csproj"
37-
Properties="TargetFramework=$(DotNetTargetFramework);AndroidApiLevel=$(AndroidDefaultTargetDotnetApiLevel);AndroidPlatformId=$(AndroidDefaultTargetDotnetApiLevel);DisableApiCompatibilityCheck=true"
38-
/>
39-
<MSBuild
40-
Condition=" '$(AndroidLatestUnstableApiLevel)' != '$(AndroidLatestStableApiLevel)' "
41-
Projects="$(_Root)src\Mono.Android\Mono.Android.csproj"
42-
Properties="TargetFramework=$(DotNetTargetFramework);AndroidApiLevel=$(AndroidLatestUnstableApiLevel);AndroidPlatformId=$(AndroidLatestUnstablePlatformId);DisableApiCompatibilityCheck=true"
43-
/>
4433
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="CreateAllPacks" />
4534
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="ExtractWorkloadPacks" />
4635
<!-- Clean up old, previously restored packages -->

src/Mono.Android/Mono.Android.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33

4-
<PropertyGroup Condition=" '$(BuildLatestPreview)' == 'true' ">
5-
<AndroidApiLevel>36</AndroidApiLevel>
6-
<AndroidPlatformId>Baklava</AndroidPlatformId>
7-
<AndroidFrameworkVersion>v15.0.99</AndroidFrameworkVersion>
8-
</PropertyGroup>
9-
104
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
115
<Import Project="..\..\Configuration.props" />
126
<Import Project="$(XamarinAndroidSourcePath)\build-tools\trim-analyzers\trim-analyzers.props" />
@@ -406,6 +400,7 @@
406400
<PropertyGroup Condition=" '$(AndroidApiLevel)' &gt;= '$(AndroidDefaultTargetDotnetApiLevel)' ">
407401
<BuildDependsOn>
408402
$(BuildDependsOn);
403+
_BuildAdditionalApiLevels;
409404
_ExportMsxDoc;
410405
_CopyToPackDirs;
411406
</BuildDependsOn>

src/Mono.Android/Mono.Android.targets

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,19 @@
235235
</ItemGroup>
236236
</Target>
237237

238+
<!-- Build Mono.Android.dll for additional API levels if necessary -->
239+
<Target Name="_BuildAdditionalApiLevels">
240+
<MSBuild
241+
Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' != '$(AndroidLatestStableApiLevel)' "
242+
Projects="$(XamarinAndroidSourcePath)src\Mono.Android\Mono.Android.csproj"
243+
Properties="AndroidApiLevel=$(AndroidDefaultTargetDotnetApiLevel);AndroidPlatformId=$(AndroidDefaultTargetDotnetApiLevel)"
244+
/>
245+
<MSBuild
246+
Condition=" '$(AndroidLatestUnstableApiLevel)' != '$(AndroidLatestStableApiLevel)' "
247+
Projects="$(XamarinAndroidSourcePath)src\Mono.Android\Mono.Android.csproj"
248+
Properties="AndroidApiLevel=$(AndroidLatestUnstableApiLevel);AndroidPlatformId=$(AndroidLatestUnstablePlatformId)"
249+
/>
250+
</Target>
238251

239252
<PropertyGroup>
240253
<!-- Override these properties to generate docs against a specific API level -->

0 commit comments

Comments
 (0)