Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
<AndroidLatestStableApiLevel2 Condition="'$(AndroidLatestStableApiLevel2)' == ''">37.1</AndroidLatestStableApiLevel2>
-->
<!-- *Latest* *unstable* API level binding that we support; this can be the same as *stable* -->
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">36.1</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">$(AndroidLatestUnstableApiLevel)</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v16.1</AndroidLatestUnstableFrameworkVersion>
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">37</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">CinnamonBun</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v17.0</AndroidLatestUnstableFrameworkVersion>
<!-- The default API level used for $(TargetPlatformVersion) -->
<AndroidDefaultTargetDotnetApiLevel Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' == '' ">$(AndroidLatestStableApiLevel)</AndroidDefaultTargetDotnetApiLevel>
<!-- The API level and TargetFrameworkVersion for the default Mono.Android.dll build -->
Expand Down
23 changes: 23 additions & 0 deletions Documentation/workflow/HowToAddNewApiLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,42 @@ Run the following command to create a merged `api.xml`:

This will create a `api-XX.xml` file in `/src/Mono.Android/Profiles/` that needs to be committed.

*Note*: the generated `api-XX.xml` file will contain *local filesystem paths* in the `//*/@merge.SourceFile` attribute.
You should search-and-replace instances of your local directory name with `..\..\bin\BuildDebug\api\` to minimize private information disclosure and reduce comparison sizes.

### Other Infrastructure Changes

- Add level to `/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs`
to enable running ApiCompat against the new level. (ex: `{ "v11.0.99", "v11.0" }`)
- Add level to `/build-tools/api-xml-adjuster/Makefile`
[TODO: remove? `$(API_LEVELS)` was last touched for API-34!]
- Add level to `DefaultTestSdkPlatforms` in `/build-tools/automation/yaml-templates/variables.yaml`
- Update `WorkloadManifest.in.json` to generate .NET SDK Workload Packs for the new API level.
- Update `DotNetInstallAndRunPreviewAPILevels` in `InstallAndRunTests.cs` to try to access a member added in the new API level.
- If (when) the new API level is unstable, update `Configuration.props` and modify the `*Unstable*` MSBuild properties to match the new unstable API level:
```xml
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">36.1</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">CANARY</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v16.1</AndroidLatestUnstableFrameworkVersion>
```
- LOCAL ONLY: Update `Configuration.props` or `Configuration.Override.props` to specify building the new level:
- `<AndroidApiLevel>31</AndroidApiLevel>`
- `<AndroidPlatformId>S</AndroidPlatformId>`
- `<AndroidFrameworkVersion>v11.0.99</AndroidFrameworkVersion>`

Or specify them on the command-line for one-off local builds.

### Create `PublicAPI*.txt` for the new API level

This is required in order to build the new `Mono.Android.dll`, as API compatibility checks are part of the build.

Simply copy the files from the previous API level. Note that the directory is the "version"-based API level, *not* the Id.

```sh
mkdir -p src/Mono.Android/PublicAPI/API-36.1
cp src/Mono.Android/PublicAPI/API-36/* src/Mono.Android/PublicAPI/API-36.1
```

### Building the New Mono.Android

- Build `Xamarin.Android.sln` with your usual mechanism, and the new `Mono.Android.dll` should be built
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public sealed class CheckApiCompatibility : Task
{ "v15.0", "v14.0" },
{ "v16.0", "v15.0" },
{ "v16.1", "v16.0" },
{ "v17.0", "v16.1" },
};

static readonly string assemblyToValidate = "Mono.Android.dll";
Expand Down
3 changes: 2 additions & 1 deletion build-tools/api-merge/merge-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<File Path="api-35.xml.in" Level="35" />
<File Path="api-36.xml.in" Level="36" />
<File Path="api-36.1.xml.in" Level="36.1" />
<File Path="api-CinnamonBun.xml.in" Level="37" />
</Inputs>
<Outputs>
<File Path="api-36.1.xml" LastLevel="36.1" />
<File Path="api-CinnamonBun.xml" LastLevel="37" />
</Outputs>
</Configuration>
2 changes: 1 addition & 1 deletion build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ variables:
- name: IsRelOrTargetingRel
value: $[or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['System.PullRequest.TargetBranch'], 'release/'))]
- name: DefaultTestSdkPlatforms # Comma-separated SDK Platform(s) to install on test agents (no spaces)
value: 35,36,36.1
value: 35,36,36.1,CinnamonBun
- name: DefaultJavaSdkMajorVersion
value: 17
- name: LatestJavaSdkMajorVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class BuildAndroidPlatforms
new AndroidPlatform (apiName: "VanillaIceCream", apiLevel: 35, platformID: "35", include: "v15.0", framework: "v15.0"),
new AndroidPlatform (apiName: "Baklava", apiLevel: 36, platformID: "36", include: "v16.0", framework: "v16.0"),
new AndroidPlatform (apiName: "CANARY", apiLevel: new Version (36, 1), platformID: "36.1", include: "v16.1", framework: "v16.1", stable: true),
new AndroidPlatform (apiName: "CinnamonBun", apiLevel: new Version (37, 0), platformID: "CinnamonBun", include: "v17.0", framework: "v17.0", stable: false),
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public AndroidToolchain ()
new AndroidPlatformComponent ("platform-35_r02", apiLevel: "35", pkgRevision: "2"),
new AndroidPlatformComponent ("platform-36_r02", apiLevel: "36", pkgRevision: "2"),
new AndroidPlatformComponent ("platform-36.1_r01", apiLevel: "36.1", pkgRevision: "1", isLatestStable: true),
new AndroidPlatformComponent ("platform-CinnamonBun_r01", apiLevel: "CinnamonBun", pkgRevision: "1", isLatestStable: false, isPreview: true),

new AndroidToolchainComponent ("source-36_r01",
destDir: Path.Combine ("sources", "android-36"),
Expand Down
Loading
Loading