-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Support cmdline-tools (#4778)
Context: #4567 The Android SDK `lint` utility is now in *two* Android SDK packages: the `tools` package, and the `cmdline-tools` package, e.g. as of commit d99facb, *both* of these exist on e.g. macOS: * `$HOME/android-toolchain/sdk/tools/bin/lint` * `$HOME/android-toolchain/sdk/cmdline-tools/1.0/bin/lint` There are two important differences of interest: 1. `tools/bin/lint` will not run on OpenJDK 11. 2. `cmdline-tools/1.0/bin/lint` has a *lower version* than `tools/bin/lint`. *Much* lower: % ~/android-toolchain/sdk/tools/bin/lint --version lint: version 26.1.1 % ~/android-toolchain/sdk/cmdline-tools/1.0/bin/lint --version lint: version 3.6.0 (1) means that we can't use the previous `lint` in an OpenJDK11 world, and thus we should migrate to the cmdline-tools `lint`. Support this by adding a new `$(AndroidCommandLineToolsVersion)` MSBuild property to `Xamarin.Android.Common.props.in` and `Microsoft.Android.Sdk.props`, which allows controlling which `cmdline-tools` package version to use, if more than one is present. The default value is `1.0`. (2) means that the `<Lint/>` Task is *broken* when using the cmdline-tools version of `lint`, becasuse certain `lint --disable` flags are protected by version checks, which are now all "wrong" when we "expect" >= 26.1.1 and instead get 3.6.0. Attempt to address (2) by assuming that we're using the cmdline-tools package if `ToolPath` contains `cmdline-tools`, in which case we treat `lint` as newer than any previous version. (This may be less than ideal.)
- Loading branch information
Showing
10 changed files
with
32 additions
and
6 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
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
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
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
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
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