Commit 51151d7
authored
[Xamarin.Android.Build.Tasks] Rethink default property values (#9155)
Context: 5d1ac0a
Context: dotnet/android-tools@a6a23bb
Context: https://learn.microsoft.com/en-us/visualstudio/mac/what-happened-to-vs-for-mac?view=vsmac-2022
Commit 5d1ac0a had a brilliant idea:
> Of particular note is dotnet/android-tools@a6a23bb:
> [ed note: now dotnet/android-tools@a6a23bb]
>
> In order to ensure that both Xamarin.Android and the macOS installer
> use the same default version numbers for Android SDK components, we are
> now using `Xamarin.Android.Tools.Versions.props` to contain default
> version number information. This file is maintained in the
> xamarin/xamarin-android-tools repo and will be imported via
> `external/xamarin-android-tools`:
In the intervening four years (!), we've learned something, and the
environment has changed.
What we've learned is that this approach is "bump-heavy": in order to
update the default value of e.g. `$(AndroidSdkPlatformVersion)`,
we'd need to update:
1. dotnet/android-tools
2. xamarin/androidtools
3. Plus other repos that depend on (1) or (2) that are used by (4)
4. xamarin/monodroid
5. dotnet/android
This is, to put it mildly, cumbersome.
Additionally, it's no longer necessary: Visual Studio for Mac will be
retired on 2024-Aug-31, so there is no longer a need to have a common
file shared between the .NET for Android SDK and Visual Studio for Mac.
Instead of considering `Xamarin.Android.Tools.Versions.props` as the
canonical source of truth:
1. Update `Xamarin.Android.Common.targets` to now optionally include
a new `Xamarin.Installer.Common.props` file, if present.
This will allow e.g. xamarin/android-sdk-installer to eventually
provide default property values which are tied to the in-use
"Xamarin Manifest" for package installation, e.g.
`$(AndroidCommandLineToolsVersion)`, `$(JavaSdkVersion)`.
2. Update `Xamarin.Android.Common.props.in` so that the following
properties are set *before* importing
`Xamarin.Android.Tools.Versions.props`:
* `$(AndroidCommandLineToolsVersion)`
* `$(AndroidNdkVersion)`
* `$(AndroidSdkBuildToolsVersion)`
* `$(AndroidSdkEmulatorVersion)`
* `$(AndroidSdkPlatformVersion)`
* `$(AndroidSdkPlatformToolsVersion)`
* `$(JavaSdkVersion)`
This will allow us to update these values when this repo ads
support for these versions.
Finally, the ["Xamarin" manifest][0] is used by the
`InstallAndroidDependencies` target from xamarin/android-sdk-installer,
and contains only a select number of Android SDK and JDK versions.
Until android-sdk-installer provides `Xamarin.Installer.Common.props`,
the versions we use need to be in harmony with the Xamarin manifest,
so that the `InstallAndroidDependencies` tests can pass.
Partially revert 0aede13 and provision JDK 17.0.8 instead of 17.0.11,
as 17.0.8 is in the Xamarin manifest.
Explicitly set `$(AndroidNdkVersion)`=26.3.11579264, as that's the
latest version in the manifest.
[0]: https://aka.ms/AndroidManifestFeed/d17-121 parent 6be8531 commit 51151d7
File tree
9 files changed
+40
-12
lines changed- build-tools
- scripts
- xaprepare/xaprepare
- ConfigAndData
- Resources
- Steps
- src/Xamarin.Android.Build.Tasks
- Tests/Xamarin.Android.Build.Tests
9 files changed
+40
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 220 | + | |
226 | 221 | | |
227 | 222 | | |
228 | 223 | | |
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
199 | 215 | | |
200 | 216 | | |
201 | 217 | | |
202 | | - | |
| 218 | + | |
203 | 219 | | |
204 | 220 | | |
205 | 221 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | 13 | | |
6 | 14 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
0 commit comments