-
Notifications
You must be signed in to change notification settings - Fork 433
Fix Android Support with recent AGP versions #3498
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
base: main
Are you sure you want to change the base?
Fix Android Support with recent AGP versions #3498
Conversation
Can one of the admins verify this patch? |
eb7a694
to
711814d
Compare
- Move getAndroidSDKFile into project.afterEvaluate - Update test project for Android tests to AGP 8.3.2 - Handle ANDROID_SDK_ROOT in Android project tests too - Update tests for no buildConfig files in classpath - Fixes eclipse-jdtls#3181 - Fixes eclipse-jdtls#3284 - Related to redhat-developer/vscode-java#3682 Signed-off-by: Ryan Niebur <[email protected]>
711814d
to
a6f095d
Compare
// android SDK is not detected, plugin will do nothing | ||
assertEquals(2, classpathEntries.length); | ||
} else { | ||
// android SDK is detected, android project should be imported successfully | ||
assertEquals(6, classpathEntries.length); | ||
assertEquals(5, classpathEntries.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only 5 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mickaelistria it is only 5 now because of the other change you commented on being missing from the results
// broken in tests only: buildConfig files are added to classpath correctly | ||
//assertTrue(Arrays.stream(classpathEntries).anyMatch(cpe -> { | ||
// return "/app/build/generated/source/buildConfig/standard/debug".equals(cpe.getPath().toString()); | ||
//})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently not broken as far as I know, so is this PR creating a regression?
Or maybe the test result depend on some environment configuration leading to a failure on your machine but would work on CI.
Anyway, I don't think that a check should be removed, removing checks from a tests is likely to lead to regressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mickaelistria it definitely could be some environment difference on my machine, but when I manually run gradle with these init files on the test project, it does generate a .classpath file with this buildConfig entry included.
It does not introduce a regression. If I revert the test project upgrade back to AGP 7.4.0, the test still gets all 6. Without the code changes in this PR, the upgrade to AGP 8.3.2 would only get 2, so the 5 is an improvement.
I was assuming it was something about the test harness that is interfering with the environment now leading to the failure. Would you like me to put the test back and we can see whether it works on CI after the PR merges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you think it's AGP 8.x that requires/adds 1 less entry in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mickaelistria yes, but only in the test results - when I run manually, it generates with all 6 entries.
I am not sure why it is behaving differently under the test harness, I did not have time to dig into that.
Uh oh!
There was an error while loading. Please reload this page.