Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2072
Description
Upgrade Android Gradle Plugin from 7.1.1 to 8.1.0 to allow us to update our other dependencies, that rely on having a newer AGP. For example, for the new work manager library to work, it needs to compile on SDK level 33, which the AGP 7.1.1 has not been tested on.
Additionally, we were setting the source compilation to Java 8, but in the AGP that we had, it did not respect that and compiled the source files to whatever the Java version Gradle ran on (usually the default installed on the machine). Our code can't compile to Java 8 as the version of the HAPI FHIR libraries stopped supporting Java 8.
With AGP 8, we have had to make a few changes. First we enforce the usage of Java 11 for compilation. If Java 11 does not exist on the machine, Gradle automatically downloads it. We still support backwards compatibility via desugaring. WIth AGP 8, we are required to have the
namespace
field in the module-level build script, and not in theAndroidManifest.xml
file. This means we can delete a bunch of XML files from our codebase.Finally, in JaCoCo we disable the need to transform the files for dexing when running instrumentation tests. In each version of AGP after 7.1.1, the API to transform files changed, breaking our instrumentation. However. we do not use JaCoCo for instrumentation when running our CI tool, instead, we use Firebase. Locally, we also do not need JaCoCo to run its transformation when running tests.
Please set the JDK version Gradle uses to Java 17
Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.