Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new api R preview 2 with enumeration #4468

Merged
merged 2 commits into from
Mar 29, 2020
Merged

Add new api R preview 2 with enumeration #4468

merged 2 commits into from
Mar 29, 2020

Conversation

gugavaro
Copy link
Contributor

Updating Api R to preview 2
Adding Enumification based on preview 2

Due to a bug on generator, dotnet/java-interop#613
we can't enumify VibrationEffectEffectType using the "enumificator tool", instead we need to manually add it for now.

@gugavaro gugavaro requested a review from jonpryor March 26, 2020 22:18
@gugavaro gugavaro requested a review from grendello as a code owner March 26, 2020 22:18
@jonpryor
Copy link
Member

/azp run

@jonpryor
Copy link
Member

…in the vain hope that the Windows build error will just disappear if we rebuild...

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor
Copy link
Member

The Windows build failure did disappear on rebuild.

@jonpryor
Copy link
Member

Squash-and-merge subject:

[Mono.Android] Android API-R Developer Preview 2 Binding (#4468)

Body:

Context: https://web.archive.org/web/20200307182928/https://developer.android.com/preview/overview

Android 11 [Developer Preview 2 has been released][0].

  * [API diff vs. Developer Preview 1][1]
  * [API diff vs. API-29][2]

Google's documented timeline for Android 11 is unchanged wrt a20be392:

  * Developer Preview 3 in April
  * Beta 1 in May
  * Beta 2 in June
    This contains the final APIs and official SDK.
  * Beta 3 and final release sometime in Q3, 2019.

For a change vs. previous releases, we are testing out some new
workflows and tooling around enumification, and the updated API-R
binding in `Mono.Android.dll` v10.0.99 has been enumified.

Note: due to a [generator bug][3], the
`Android.OS.VibrationEffectEffectType` enum must be manually bound.

[0]: https://android-developers.googleblog.com/2020/03/android-11-developer-preview-2.html
[1]: https://developer.android.com/sdk/api_diff/r-dp2-incr/changes
[2]: https://developer.android.com/sdk/api_diff/r-dp2/changes
[3]: https://github.com/xamarin/java.interop/issues/613

@gugavaro
Copy link
Contributor Author

Squash-and-merge subject:

[Mono.Android] Android API-R Developer Preview 2 Binding (#4468)

Body:

Context: https://web.archive.org/web/20200307182928/https://developer.android.com/preview/overview

Android 11 [Developer Preview 2 has been released][0].

  * [API diff vs. Developer Preview 1][1]
  * [API diff vs. API-29][2]

Google's documented timeline for Android 11 is unchanged wrt a20be392:

  * Developer Preview 3 in April
  * Beta 1 in May
  * Beta 2 in June
    This contains the final APIs and official SDK.
  * Beta 3 and final release sometime in Q3, 2019.

For a change vs. previous releases, we are testing out some new
workflows and tooling around enumification, and the updated API-R
binding in `Mono.Android.dll` v10.0.99 has been enumified.

Note: due to a [generator bug][3], the
`Android.OS.VibrationEffectEffectType` enum must be manually bound.

[0]: https://android-developers.googleblog.com/2020/03/android-11-developer-preview-2.html
[1]: https://developer.android.com/sdk/api_diff/r-dp2-incr/changes
[2]: https://developer.android.com/sdk/api_diff/r-dp2/changes
[3]: https://github.com/xamarin/java.interop/issues/613

Doc looks great!!!

@jonpryor jonpryor merged commit 3ca2a07 into master Mar 29, 2020
@jonpryor jonpryor deleted the gugavaro-xa_enum branch March 29, 2020 01:16
jonpryor pushed a commit that referenced this pull request Mar 30, 2020
Context: https://web.archive.org/web/20200307182928/https://developer.android.com/preview/overview

Android 11 [Developer Preview 2 has been released][0].

  * [API diff vs. Developer Preview 1][1]
  * [API diff vs. API-29][2]

Google's documented timeline for Android 11 is unchanged wrt a20be39:

  * Developer Preview 3 in April
  * Beta 1 in May
  * Beta 2 in June
    This contains the final APIs and official SDK.
  * Beta 3 and final release sometime in Q3, 2019.

For a change vs. previous releases, we are testing out some new
workflows and tooling around enumification, and the updated API-R
binding in `Mono.Android.dll` v10.0.99 has been enumified.

Note: due to a [generator bug][3], the
`Android.OS.VibrationEffectEffectType` enum must be manually bound.

[0]: https://android-developers.googleblog.com/2020/03/android-11-developer-preview-2.html
[1]: https://developer.android.com/sdk/api_diff/r-dp2-incr/changes
[2]: https://developer.android.com/sdk/api_diff/r-dp2/changes
[3]: dotnet/java-interop#613
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 30, 2020
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3594952&view=results

Cherry-picking PR dotnet#4468 to d16-6 resulted in a build break:

	error : CompatApi command: /Users/builder/azdo/_work/92/s/xamarin-android/packages/microsoft.dotnet.apicompat/5.0.0-beta.20162.4/tools/net472/Microsoft.DotNet.ApiCompat.exe "/Users/builder/azdo/_work/92/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/ApiCompatTemp" -i "/Users/builder/azdo/_work/92/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0.99/ApiCompatTemp" --allow-default-interface-methods --exclude-attributes ../../tests/api-compatibility/api-compat-exclude-attributes.txt
	error : CheckApiCompatibility found nonacceptable Api breakages for ApiLevel: v10.0.99.
	error : Compat issues with assembly Mono.Android:
	error : MembersMustExist : Member 'public void Android.Telecom.Connection.SetVideoState(Android.Telecom.VideoProfileState)' does not exist in the implementation but it does exist in the contract.
	error : Total Issues: 2

The problem is that API-R added a new `Connection.getVideoState()`
method, which `generator` then attempted to merge with the existing
`Connection.setVideoState()` method added in API-23.

As we don't create "set-only" properties, `Connection.setVideoState()`
was bound as `Connection.SetVideoState()`, but in "merging" it with
`Connection.getVideoState()` to create a new `Connection.VideoState`
property, we *removed* `Connection.SetVideoState()`, resulting in a
compatibility break.

Disable "property-ification" of `Connection.setVideoState()` by adding
the `propertyName` attribute, setting it to an empty string.
jonpryor added a commit that referenced this pull request Mar 30, 2020
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3594952&view=results

Cherry-picking PR #4468 to d16-6 resulted in a build break:

	error : CompatApi command: /Users/builder/azdo/_work/92/s/xamarin-android/packages/microsoft.dotnet.apicompat/5.0.0-beta.20162.4/tools/net472/Microsoft.DotNet.ApiCompat.exe "/Users/builder/azdo/_work/92/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/ApiCompatTemp" -i "/Users/builder/azdo/_work/92/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0.99/ApiCompatTemp" --allow-default-interface-methods --exclude-attributes ../../tests/api-compatibility/api-compat-exclude-attributes.txt
	error : CheckApiCompatibility found nonacceptable Api breakages for ApiLevel: v10.0.99.
	error : Compat issues with assembly Mono.Android:
	error : MembersMustExist : Member 'public void Android.Telecom.Connection.SetVideoState(Android.Telecom.VideoProfileState)' does not exist in the implementation but it does exist in the contract.
	error : Total Issues: 2

The problem is that API-R added a new `Connection.getVideoState()`
method, which `generator` then attempted to merge with the existing
`Connection.setVideoState()` method added in API-23.

As we don't create "set-only" properties, `Connection.setVideoState()`
was bound as `Connection.SetVideoState()`, but in "merging" it with
`Connection.getVideoState()` to create a new `Connection.VideoState`
property, we *removed* `Connection.SetVideoState()`, resulting in a
compatibility break.

Disable "property-ification" of `Connection.setVideoState()` by adding
the `propertyName` attribute, setting it to an empty string.
@brendanzagaeski
Copy link
Contributor

Draft release notes

Here is the note I'm planning to include for this pull request for the Xamarin.Android 10.3 Previews:

### Preview bindings for Android 11 Developer Preview 2

This version includes preview bindings for the [second Developer Preview of
Android 11][android-11-preview-2] from Google.  See the [Android 11 Developer
Preview documentation][android-11-upstream] for additional information about the
behavior and API changes in this new Android version.  To try the bindings for
the new APIs in a Xamarin.Android project, set **Compile using Android version:
(Target Framework)** to **Android 10.0.99 (R)** under the **Application** tab of
the Visual Studio project property pages.  This sets the
`TargetFrameworkVersion` property to `v10.0.99` in the *.csproj* file:

```xml
<TargetFrameworkVersion>v10.0.99</TargetFrameworkVersion>
```

[android-11-preview-2]: https://android-developers.googleblog.com/2020/03/android-11-developer-preview-2.html

This note will be merged with the section for Developer Preview 1 when the Preview notes are combined into the final Xamarin.Android 10.3 general availability Release notes.

To suggest something different, feel free to reply in this PR or add a Documentation/release-notes/4468.md file with the new suggestion. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants