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

Support AGP 4.2 #350

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Support AGP 4.2 #350

merged 2 commits into from
Jan 12, 2021

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Dec 8, 2020

Goal

Adds support for 4.2 of the Android Gradle Plugin. This changeset alters the plugin to use a new API for manipulating the manifest when the AGP version is high enough. This is necessary as the previous API added in 4.1 was removed entirely. Further details of the API change can be found here

Changeset

  • Extracted logic for registering manifest manipulation task into ManifestUuidTaskV2Compat
  • Setup the plugin to compile groovy before kotlin, so that the plugin can call into Groovy compatibility shims whenever AGP breaks its API
  • Updated BAGP to compile against AGP 4.2, and used the new androidComponents.onVariants API when it is available
  • Projects using AGP 4.1 now call into the Groovy compatibility shim which can access the obsolete API
  • Cherry picked a commit that temporarily disables failing NDK E2E tests due to a Travis CI environment change

Testing

Ran E2E tests on AGP 4.2 on Travis CI.

Altered the PluginExtension unit test to use a mocked version of AGP. This is necessary as AGP 4.2 has started using shared build services which are difficult to setup in a test target.

@fractalwrench fractalwrench force-pushed the PLAT-5222/agp-420-support branch 3 times, most recently from b1bac26 to fa5a70b Compare December 14, 2020 11:52
@fractalwrench fractalwrench force-pushed the PLAT-5222/agp-420-support branch 15 times, most recently from 626c13a to f251b9b Compare January 11, 2021 16:43
@fractalwrench fractalwrench changed the title [WIP] AGP 4.2 support Support AGP 4.2 Jan 11, 2021
@fractalwrench fractalwrench marked this pull request as ready for review January 12, 2021 11:13
@fractalwrench fractalwrench merged commit 89bcb4c into next Jan 12, 2021
@fractalwrench fractalwrench deleted the PLAT-5222/agp-420-support branch January 12, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants