forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] API-26 Enumification (dotnet#662)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=30909 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=51293 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=55473 Bump to xamarin-android-api-compatibility/master/6fe9b17f. Add `Documentation/HowToAddNewApiLevel.md`, to describe the process for binding new API levels, including enumification. Enumify API-26. Update `build-tools/enumification-helpers` to support the latest droiddoc `packages.html` format. API-26 changed `Activity.findViewById(int)` to be a generic method. Remove the `<typeParameters/>` element and "fix" the return type so that we don't break API compatibility, as `generator` doesn't currently do anything sane here. (Specifically, all generic paramaters are currently bound as `Java.Lang.Object`, *even if* the type parameter has a constraint which provides a more specific type!) Fix binding of `Java.Nio.FileChannel` so it can be actually bound, related `SeekableByteChannel` support fixes. Remove `//implements[@name='AutoCloseable']` and `//implements[@name='Destryable']`, as they add Java `default` interface methods which can't be sanely supported at this time. Update `api-merge` to change `default` interface methods to non-`default` methods when merging with an older API level which contained the non-`default` interface method. This preserves backward compatibility with existing assemblies and source code. Remove the associated workarounds. Bump xamarin-android-api-compatibility to check against the latest-and-greatest API-26 binding.
- Loading branch information
1 parent
5139ec7
commit d05fd17
Showing
22 changed files
with
1,241 additions
and
11,247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# How to deal with new API Level | ||
|
||
## This documentation is incomplete | ||
|
||
In Xamarin ages, we used to have (more complete) API upgrade guide internally. But since then we switched to new xamarin-android repository which entirely changed the build system from Makefile to MSBuild solution, as well as the managed API for manipulating Android SDK, the old documentation almost does not make sense anymore. Even though I am writing this documentation, I don't know everything required (nor those who changed the build system didn't care about API upgrades). | ||
|
||
Hence, this documentation is written from the ground, exploring everything around. | ||
|
||
And since the build system has changed between the first preview of Android O and the latest Android O preview (3), and it is quite possible that the build system changes over and over again, it might still not make much sense in the future. | ||
|
||
## Steps | ||
|
||
Anyhow, this commit would tell you what needs to be changed when the new API preview arrives (and that becomes stable): https://github.com/xamarin/xamarin-android/pull/642 | ||
|
||
1) Add/update new download to build-tools/android-toolchain. | ||
The new API archive should be found on the web repository description | ||
that Google Android SDK Manager uses (which can be now shown as part | ||
of SDK Manager options in Android Studio). | ||
|
||
As of Android O ages, it could be found at https://dl-ssl.google.com/android/repository/repository2-1.xml . It used to be different repository description URL, and it will be different URL in the future. | ||
|
||
2) Create and add api-O.xml.in under src/Mono.Android/Profile directory. | ||
It can be done from within `build-tools/api-xml-adjuster` directory. See `README.md` in that directory for details. You will have to make changes to Makefile in that directory to generate it. Also note that it often happens that Google does not ship documentation archive (!) and in such case we will have to scrape DroidDoc from the web and create our own docs archive. | ||
|
||
3) Review new API (or review the changes in case of API updates). | ||
|
||
Some of the changes are caused by API removal. Usually they come with | ||
"deprecated" state in the previous API Level first, but that's not always true. | ||
|
||
4) enumification: See `build-tools/enumification-helpers/README`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
map.ext.csv | ||
const-list-*.xml | ||
remaining-int-methods.txt | ||
*.exe | ||
*.mdb | ||
*.pdb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.