Skip to content

Allow installing the SDK if one doesn't exist - #4003

Merged
jonathanpeppers merged 4 commits into
dotnet:masterfrom
dellis1972:Issue3996
Dec 9, 2019
Merged

jonathanpeppers merged 4 commits into
dotnet:masterfrom
dellis1972:Issue3996

Conversation

@dellis1972

@dellis1972 dellis1972 commented Dec 7, 2019 •

Copy link
Copy Markdown
Contributor

Fixes #3996

Commit 008ba98 did not go far enough. Both ValidateJavaVersion and ResolveSdks also needed the same ContinueOnError setting. While the commit did allow users to install components which were missing, it did NOT allow users to install the entire SDK. This is because even when calling's the InstallAndroidDependencies target the build would still fail with

error XA5300: The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory.

What we need to do in this case was include the ContinueOnError property on ValidateJavaVersion and ResolveSdks. This allows the build to continue and call the targets to install the required sdk. This is very handy for CI environments as it means we can install the Android SDK from scratch on a clean machine.

@dellis1972
dellis1972 marked this pull request as ready for review December 8, 2019 18:29
@dellis1972
dellis1972 requested a review from jonpryor December 9, 2019 12:45
@jonathanpeppers

Copy link
Copy Markdown
Member

There are 2 tests failures:

  • 1 NuGet releated
  • 1 JLO-change perf test

I'll look into the second one, I bet that the manifest merger feature is causing it:

Building target "_ManifestMerger" completely.
Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

@jonathanpeppers
jonathanpeppers merged commit 68324d0 into dotnet:master Dec 9, 2019
@dellis1972
dellis1972 deleted the Issue3996 branch December 9, 2019 16:14
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Dec 9, 2019
Context: dotnet#4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml`.

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Dec 10, 2019
Context: dotnet#4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml`.

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
jonathanpeppers added a commit that referenced this pull request Dec 11, 2019
Context: #4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml` when the activity's name is changed:

    -<activity android:name=".MainActivity">
    +<activity android:name=".MainActivity2">

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
jonpryor pushed a commit that referenced this pull request Dec 12, 2019
…xist (#4003)

Fixes #3996

Commit 008ba98 did not go far enough. Both `ValidateJavaVersion` and `ResolveSdks` also needed the same `ContinueOnError` setting. While the commit did allow users to install components which were missing, it did NOT allow users to install the entire SDK. This is because even when calling's the `InstallAndroidDependencies` target the build would still fail with 

```
error XA5300: The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory.
```

What we need to do in this case was include the `ContinueOnError` property on `ValidateJavaVersion` and `ResolveSdks`. This allows the build to continue and call the targets to install the required SDK. This is very handy for CI environments as it means we can install the Android SDK from scratch on a clean machine.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Dec 17, 2019
Context: dotnet#4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml` when the activity's name is changed:

    -<activity android:name=".MainActivity">
    +<activity android:name=".MainActivity2">

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Dec 17, 2019
Context: dotnet#4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml` when the activity's name is changed:

    -<activity android:name=".MainActivity">
    +<activity android:name=".MainActivity2">

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
jonpryor pushed a commit that referenced this pull request Dec 18, 2019
Context: #4003 (comment)

Since 2c6f5cd, I believe we are hitting a performance regression in
the `Build_JLO_Change` test:

    Building target "_ManifestMerger" completely.
    Input file "obj/Debug/AndroidManifest.xml" is newer than output file "obj/Debug/android/AndroidManifest.xml".

Fortunately, I think we just need to change the test. The test itself
alters `AndroidManifest.xml` when the activity's name is changed:

    -<activity android:name=".MainActivity">
    +<activity android:name=".MainActivity2">

I added a new test that specifically times a `AndroidManifest.xml`
change vs a `Java.Lang.Object` subclass change.
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Travis-CI: error XA5300: The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory.

3 participants