Skip to content

Commit

Permalink
[Mono.Android] Android API-29 enumification and stabilization (#3305)
Browse files Browse the repository at this point in the history
API-29/v10.0 is now stable.

Bumps to xamarin/xamarin-android-api-compatibility@336eedaa.

Bump Targets/`$(TargetSdkVersion)` to v10.0 (API-29).

Add `src/Mono.Android/Profiles/api-29.params.txt` for parameter names.

Add new enums and fix method signatures (`map.csv`, `methodmap.csv`).

Fix metadata whitespace formatting. 

Update Android Emulator to use 29 image

Bump test timeouts.

Fix test issues:

  * [build-tools] Update the logcat timing patterns for API-29
  * [logcat processing] Update activity displayed detection
  * Fixing some deploy/undeploy apks to emulator
  * Ignore exit code for `adb logcat -c`
  * Allow BuildTest.BuildHasNoWarnings to have up to 1 warning due to
    be incompatible with Api level 29

Remove `#if !ANDROID_29` condition from `StringBuffer.cs` and
`StringBuilder.cs`, added in 2cace0b, to preserve API compatibility.
  • Loading branch information
gugavaro authored and jonpryor committed Jul 31, 2019
1 parent feb9ea2 commit 936a09d
Show file tree
Hide file tree
Showing 35 changed files with 3,016 additions and 1,611 deletions.
8 changes: 4 additions & 4 deletions Configuration.Override.props.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
kept consistent with each other, lest Bad Things Happen™
-->
<!-- The default Android API level to bind in src/Mono.Android -->
<AndroidApiLevel>28</AndroidApiLevel>
<AndroidApiLevel>29</AndroidApiLevel>
<!-- The Xamarin.Android $(TargetFrameworkVersion) value that corresponds to $(AndroidApiLevel) -->
<AndroidFrameworkVersion>v9.0</AndroidFrameworkVersion>
<AndroidFrameworkVersion>v10.0</AndroidFrameworkVersion>
<!-- The default Android API "id" that corresponds to $(AndroidApiLevel) -->
<AndroidPlatformId>28</AndroidPlatformId>
<AndroidPlatformId>29</AndroidPlatformId>

<!--
Colon-separated list of ABIs to build the mono JIT for.
Expand All @@ -24,7 +24,7 @@
<AndroidSupportedTargetJitAbis>armeabi-v7a:arm64-v8a:x86:x86_64</AndroidSupportedTargetJitAbis>

<!--
Colon-separated list of ABIs to build AOT cross-compilers for.
Colon-separated list of ABIs to build AOT cross-compilers for.
There doesn't need to be any parity between the AOT targets and the JIT ABIs above.
Supported targets are:
Expand Down
10 changes: 3 additions & 7 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@
<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' And '$(_StandardLibraryPath)' != '' ">v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v4.7.1</TargetFrameworkVersion>
<!-- Used by the `build-tools/create-vsix` build so that `Mono.Android.Export.dll`/etc. are only included *once* -->
<!-- Should correspond to the first value from `$(API_LEVELS)` in `build-tools/scripts/BuildEverything.mk` -->
<!-- Should correspond to the first value from `$(API_LEVELS)` in `build-tools/api-xml-adjuster/Makefile` -->
<AndroidFirstFrameworkVersion Condition="'$(AndroidFirstFrameworkVersion)' == ''">v4.4</AndroidFirstFrameworkVersion>
<AndroidFirstApiLevel Condition="'$(AndroidFirstApiLevel)' == ''">19</AndroidFirstApiLevel>
<AndroidFirstPlatformId Condition="'$(AndroidFirstPlatformId)' == ''">$(AndroidFirstApiLevel)</AndroidFirstPlatformId>
<_IsRunningNuGetRestore Condition="$(RestoreTaskAssemblyFile.EndsWith('NuGet.exe', StringComparison.InvariantCultureIgnoreCase))">True</_IsRunningNuGetRestore>
<!-- *Latest* *stable* API level binding that we support; used when building src/Xamarin.Android.Build.Tasks -->
<AndroidLatestStableApiLevel Condition="'$(AndroidLatestStableApiLevel)' == ''">28</AndroidLatestStableApiLevel>
<AndroidLatestStableApiLevel Condition="'$(AndroidLatestStableApiLevel)' == ''">29</AndroidLatestStableApiLevel>
<AndroidLatestStablePlatformId Condition="'$(AndroidLatestStablePlatformId)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestStablePlatformId>
<AndroidLatestStableFrameworkVersion Condition="'$(AndroidLatestStableFrameworkVersion)'==''">v9.0</AndroidLatestStableFrameworkVersion>
<!-- *Latest* (possibly unstable) API level binding that we support; for informational purposes -->
<AndroidLatestApiLevel Condition="'$(AndroidLatestApiLevel)' == ''">29</AndroidLatestApiLevel>
<AndroidLatestPlatformId Condition=" '$(AndroidLatestPlatformId)' == '' ">Q</AndroidLatestPlatformId>
<AndroidLatestFrameworkVersion Condition="'$(AndroidLatestFrameworkVersion)' == ''">v9.0.99</AndroidLatestFrameworkVersion>
<AndroidLatestStableFrameworkVersion Condition="'$(AndroidLatestStableFrameworkVersion)'==''">v10.0</AndroidLatestStableFrameworkVersion>
<!-- The API level and TargetFrameworkVersion for the default Mono.Android.dll build -->
<AndroidApiLevel Condition=" '$(AndroidApiLevel)' == '' ">$(AndroidLatestStableApiLevel)</AndroidApiLevel>
<AndroidPlatformId Condition=" '$(AndroidPlatformId)' == '' ">$(AndroidLatestStablePlatformId)</AndroidPlatformId>
Expand Down
2 changes: 1 addition & 1 deletion Documentation/building/windows/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ After the solution has built successfully, you can [use your
build][using-your-build] to build Xamarin.Android application and library
projects. Note that by default `Xamarin.Android.sln` only builds support for
the `$(TargetFrameworkVersion)` specified in the `$(AndroidFrameworkVersion)`
property of the [`Configuration.props`][configprops-master] file (`v9.0` when
property of the [`Configuration.props`][configprops-master] file (`v10.0` when
this guide was last updated), so you will need to ensure that your application
and library projects are configured to use that particular target framework
version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public override bool Execute ()

new CommandInfo {
ArgumentsString = $"{AdbTarget} {AdbOptions} logcat -c",
IgnoreExitCode = true,
},

new CommandInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected override void AfterCommand (int commandIndex, CommandInfo info)

new CommandInfo {
ArgumentsString = $"{AdbTarget} {AdbOptions} logcat -c",
IgnoreExitCode = true,
},

};
Expand Down
3 changes: 1 addition & 2 deletions build-tools/api-xml-adjuster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ API_XML_TOOL = $(BUILDBIN)/api-xml-adjuster.exe
RUNTIME = mono --debug
RUN_CLASS_PARSE = $(RUNTIME) $(CLASS_PARSE)
RUN_API_XML_TOOL = $(RUNTIME) $(API_XML_TOOL)
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Q
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

XML_OUTPUT_DIR = .

Expand Down Expand Up @@ -125,4 +125,3 @@ $(DOCS_DIR)/docs-api-25: docs-25_web.zip # Google hadn't published docs componen

$(DOCS_DIR)/docs-api-26: docs-O_web.zip # No preview docs yet
$(call extract-docs,$<,docs)

7 changes: 0 additions & 7 deletions build-tools/api-xml-adjuster/api-xml-adjuster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\android-toolchain\android-toolchain.csproj">
<Project>{8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA}</Project>
<Name>android-toolchain</Name>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="api-xml-adjuster.targets" />
</Project>
8 changes: 4 additions & 4 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ stages:
solution: tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj
configuration: $(ApkTestConfiguration)
msbuildArguments: >
/t:AcquireAndroidTarget,SignAndroidPackage,UndeployTestApks,DeployTestApks,RunTestApks,ReportComponentFailures
/t:AcquireAndroidTarget,SignAndroidPackage,DeployTestApks,RunTestApks,UndeployTestApks,ReportComponentFailures
/bl:$(System.DefaultWorkingDirectory)/bin/Test$(ApkTestConfiguration)/XamarinFormsPerf.binlog
condition: succeededOrFailed()

Expand All @@ -441,7 +441,7 @@ stages:
solution: tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj
configuration: $(ApkTestConfiguration)
msbuildArguments: >
/t:AcquireAndroidTarget,SignAndroidPackage,UndeployTestApks,DeployTestApks,RunTestApks,ReportComponentFailures
/t:AcquireAndroidTarget,SignAndroidPackage,DeployTestApks,RunTestApks,UndeployTestApks,ReportComponentFailures
/bl:$(System.DefaultWorkingDirectory)/bin/Test$(ApkTestConfiguration)/XamarinFormsPerf-Aot.binlog
/p:AotAssemblies=true
condition: succeededOrFailed()
Expand All @@ -452,7 +452,7 @@ stages:
solution: tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj
configuration: $(ApkTestConfiguration)
msbuildArguments: >
/t:AcquireAndroidTarget,SignAndroidPackage,UndeployTestApks,DeployTestApks,RunTestApks,ReportComponentFailures
/t:AcquireAndroidTarget,SignAndroidPackage,DeployTestApks,RunTestApks,UndeployTestApks,ReportComponentFailures
/bl:$(System.DefaultWorkingDirectory)/bin/Test$(ApkTestConfiguration)/XamarinFormsPerf-Profiled.binlog
/p:AndroidEnableProfiledAot=true
condition: succeededOrFailed()
Expand All @@ -463,7 +463,7 @@ stages:
solution: tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj
configuration: $(ApkTestConfiguration)
msbuildArguments: >
/t:AcquireAndroidTarget,SignAndroidPackage,UndeployTestApks,DeployTestApks,RunTestApks,ReportComponentFailures
/t:AcquireAndroidTarget,SignAndroidPackage,DeployTestApks,RunTestApks,UndeployTestApks,ReportComponentFailures
/bl:$(System.DefaultWorkingDirectory)/bin/Test$(ApkTestConfiguration)/XamarinFormsPerf-Bundle.binlog
/p:BundleAssemblies=true
condition: succeededOrFailed()
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ timestamps {
}
}

utils.stageWithTimeout('run all tests', 240, 'MINUTES', XADir, false) { // Typically takes 1hr and 50 minutes (or 110 minutes)
utils.stageWithTimeout('run all tests', 360, 'MINUTES', XADir, false) { // Typically takes 6hr
if (skipTest) {
echo "Skipping 'run all tests' stage. Clear the SkipTest variable setting to build and run tests"
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
solution: ${{ parameters.project }}
configuration: ${{ parameters.configuration }}
msbuildArguments: >
/t:AcquireAndroidTarget,SignAndroidPackage,UndeployTestApks,DeployTest${{ parameters.packageType }}s,RunTestApks,RenameApkTestCases,ReportComponentFailures
/t:AcquireAndroidTarget,SignAndroidPackage,DeployTest${{ parameters.packageType }}s,RunTestApks,UndeployTestApks,RenameApkTestCases,ReportComponentFailures
/bl:$(System.DefaultWorkingDirectory)/bin/Test${{ parameters.configuration }}/run${{ parameters.testName }}.binlog
${{ parameters.extraBuildArgs }}
condition: succeededOrFailed()
Expand Down
19 changes: 14 additions & 5 deletions build-tools/enumification-helpers/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
topdir = ../..

API_LEVEL = 28
API_LEVEL_NAME = 28
API_LEVEL = 29
API_LEVEL_NAME = 29

CSCOMPILE = csc -debug:portable

Expand All @@ -26,8 +26,8 @@ generate-const-mapping.exe: $(CONST_MAPPER_SOURCES)
map.ext.csv: generate-const-mapping.exe enum-conversion-mappings.xml const-list-$(API_LEVEL).xml
mono --debug generate-const-mapping.exe enum-conversion-mappings.xml const-list-$(API_LEVEL).xml > map.ext.csv || rm map.ext.csv

remaining-int-consts.txt: ../../src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw/*.cs
grep "const int " ../../src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw/*.cs \
remaining-int-consts.txt: $(topdir)/src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw/*.cs
find $(topdir)/src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw -name "*.cs" | xargs grep "const int " \
| grep -v Javax.Microedition \
| grep -v Dalvik.Bytecode \
| grep -v Android.Resource.cs \
Expand All @@ -42,7 +42,16 @@ remaining-int-methods-filtered.txt: remaining-int-methods.txt reduction_rules.tx
grep "int[\[ ]" remaining-int-methods.txt > remaining-int-methods-filtered.txt

remaining-int-methods.txt: $(topdir)/src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw/*.cs
grep "public" $(topdir)/src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw/*.cs | grep -v "const" | grep "int" | grep "[({]" | grep -v GLES | grep -v Android.R. | grep -v Khronos | sort | sed 's/android-[0-9]*/android-XXX/' > remaining-int-methods.txt
find $(topdir)/src/Mono.Android/obj/$(CONFIGURATION)/android-$(API_LEVEL)/mcw -name "*.cs" | xargs grep "public" \
| grep -v "const" \
| grep "int" \
| grep "[({]" \
| grep -v GLES \
| grep -v Android.R. \
| grep -v Khronos \
| sort \
| sed 's/android-[0-9]*/android-XXX/' \
> remaining-int-methods.txt

clean::
-rm -rf tmp.xml const-list-$(API_LEVEL).xml \
Expand Down
Loading

0 comments on commit 936a09d

Please sign in to comment.