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

[Xamarin.Android.Build.Tasks] Rethink default property values #9155

Merged
merged 7 commits into from
Aug 16, 2024

Commits on Jul 29, 2024

  1. [Xamarin.Android.Build.Tasks] Rethink default property values

    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, consider it as the *fallback* source:
    
     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`:
    
          * `$(AndroidSdkBuildToolsVersion)`
          * `$(AndroidSdkPlatformVersion)`
          * `$(AndroidSdkPlatformToolsVersion)`
    
        This will allow us to update these values when this repo ads
        support for these versions.
    
        TODO: Should these actually be located in (1)?
        Regardless, as `Xamarin.Installer.Common.props` is imported first,
        it can always override these values.
    jonpryor committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    bd3cfc1 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    60acfbc View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Configuration menu
    Copy the full SHA
    f37f14e View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. Configuration menu
    Copy the full SHA
    4498e5f View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. Doh!

    jonpryor committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    d01d4bb View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Fix condition on $(AndroidNdkPkgRevision)

    The condition was wrong, meaning `$(AndroidNdkPkgRevision)` was never
    defined, which meant that within Xamarin.Android.Common.props the
    $(AndroidNdkVersion) value was the empty string, which caused the
    `GetDependencyNdkRequiredConditions("EnableLLVM",True)` test to fail.
    jonpryor committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    ab6ddb0 View commit details
    Browse the repository at this point in the history
  2. android-sdk-installer version harmonization

    Context: https://aka.ms/AndroidManifestFeed/d17-12
    
    The "Xamarin" manifest used the `InstallAndroidDependencies` task
    from android-sdk-installer, and contains only a select number of
    Android SDK and JDK package versions.
    
    Until android-sdk-installer provides a `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.
    
    Explicitly set `$(AndroidNdkVersion)`=26.3.11579264, as that's the
    latest version in the manifest.
    jonpryor committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    9933284 View commit details
    Browse the repository at this point in the history