Skip to content

generator needs to support non-integral versions #1357

@jonpryor

Description

@jonpryor

Context: dotnet/android#10438
Context: https://android-developers.googleblog.com/2025/08/android-16-qpr2-beta-1-is-here.html

The world of Android "minor" SDK versions is upon us! Which is a world in which new APIs are added, but the API level is not changed.

Which means integral API level names are inadequate; we need floating-point!

Update generator so that "minor" SDK versions such as "36.1" are now supported:

https://github.com/dotnet/java-interop/blob/main/tools/generator/SourceWriters/Extensions/SourceWriterExtensions.cs#L310-L329

This will likely require a fair bit of "plumbing" across the toolchain, as IIRC API levels are inferred from the merge.SourceFile attribute within API.xml:

<field deprecated="not deprecated" final="true" name="ACTION_CALL_BACK" jni-signature="Ljava/lang/String;" static="true" transient="false" type="java.lang.String" type-generic-aware="java.lang.String" value="&quot;android.telecom.action.CALL_BACK&quot;" visibility="public" volatile="false" merge.SourceFile="/Volumes/Xamarin-Work/src/dotnet/android/build-tools/create-android-api/../../bin/BuildDebug/api/api-CANARY.xml.in" />
<field deprecated="not deprecated" final="true" name="ACTION_CHANGE_DEFAULT_DIALER" jni-signature="Ljava/lang/String;" static="true" transient="false" type="java.lang.String" type-generic-aware="java.lang.String" value="&quot;android.telecom.action.CHANGE_DEFAULT_DIALER&quot;" visibility="public" volatile="false" merge.SourceFile="/Volumes/Xamarin-Work/src/dotnet/android/build-tools/create-android-api/../../bin/BuildDebug/api/api-23.xml.in" />

So we'll need a way to say "CANARY is 36.1" -- which presumably already exists, as e.g. API-BAKLAVA became API-36 -- and also update everything that "infers an API level from merge.SourceFile" to support non-integral values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions