Automattic / Automattic-Tracks-Android

Client library for tracking user events for later analysis
GNU General Public License v2.0
30 stars 13 forks source link

[Build] Upgrade Gradle to 8.2.1 and AGP to 8.1.0 #185

Closed ParaskP7 closed 1 year ago

ParaskP7 commented 1 year ago

Platform Request: pdnsEh-13V-p2 Project Thread: paaHJt-57Z-p2

This PR upgraded Gradle to 8.2.1 and AGP to 8.0.2.

PS: This Gradle and AGP upgrade was done in order to align this repo with the rest of such WordPress-Mobile Android library related repos. However, mind the fact that this work here is not necessary to complete the aforementioned project, just some extra work to help with the wider alignment efforts.


🚫 Blocked By:

CI Failure ``` [2023-07-18T13:04:04Z] FAILURE: Build failed with an exception. --   | [2023-07-18T13:04:04Z]   | [2023-07-18T13:04:04Z] * Where:   | [2023-07-18T13:04:04Z] Build file '/var/lib/buildkite-agent/builds/ci-android-i-098082138775f5d9d-1/automattic/automattic-tracks-android/AutomatticTracks/build.gradle' line: 2   | [2023-07-18T13:04:04Z]   | [2023-07-18T13:04:04Z] * What went wrong:   | [2023-07-18T13:04:04Z] An exception occurred applying plugin request [id: 'com.android.library', version: '8.0.2']   | [2023-07-18T13:04:04Z] > Failed to apply plugin 'com.android.internal.library'.   | [2023-07-18T13:04:04Z] > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.   | [2023-07-18T13:04:04Z] Your current JDK is located in /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.amzn2.0.1.x86_64   | [2023-07-18T13:04:04Z] You can try some of the following options:   | [2023-07-18T13:04:04Z] - changing the IDE settings.   | [2023-07-18T13:04:04Z] - changing the JAVA_HOME environment variable.   | [2023-07-18T13:04:04Z] - changing `org.gradle.java.home` in `gradle.properties`. ```

Breaking Change List:

  1. Move package from android manifest to build files
  2. Enable build config build feature for editor and wordpress
  3. Fix compile java and kotlin jvm target compat. build failure

AGP Upgrade Assistant List:

  1. Remove ignored configuration properties
  2. Migrate dsl properties from lint options to lint

Gradle Configuration List:

  1. Update org gradle jvmargs gradle property to xmx 6g

Lint Configuration List:

  1. Configure lint on all modules to adhere to lint xml file
  2. Move lint and baseline xml files to dedicated config lint dir

Dependency Versions Refactor List:

  1. Extract all sdk version to a separate ext block
  2. Extract sentry bom version to root build gradle
  3. Extract androidx annotation version to root build gradle
  4. Extract squareup okhttp version to root build gradle
  5. Extract kotlinx coroutines version to root build gradle
  6. Extract junit version to root build gradle
  7. Extract assertj version to root build gradle
  8. Extract mockito kotlin version to root build gradle
  9. Extract wordPress fluxc version to root build gradle
  10. Extract wordPress utils version to root build gradle
  11. Extract androidx core version to root build gradle
  12. Extract androidx appcompat version to root build gradle
  13. Extract google material version to root build gradle
  14. Add versions groups to root build gradle
  15. Add com android application plugin to plugin management
  16. Extract agp version to settings build gradle
  17. Extract kotlin version to settings build gradle
  18. Extract automattic publish to s3 version to settings build gradle

Associated clients (N/A)

FYI: Automattic-Tracks-Android is not part of a composite build, neither for WPAndroid, WCAndroid clients or the FluxC library.


To test:


Merge instructions

ParaskP7 commented 1 year ago

Awesome @oguzkocer , thanks for adding JDK17 support to this repo, then reviewing and tentatively approving the changes, pending some extra testing! 🙇 ❤️ 🚀

FYI: I went ahead, marked this PR as Ready for review and removed the [PR] Not Ready for Merge label. The last nice to have thing for us to do is to coordinate the merge wit with all the other library and client PRs, merging this PR only when every other such PR is ready to be merged as well.

ParaskP7 commented 1 year ago

Thanks for updating the publish-to-s3 Gradle plugin @oguzkocer , LGTM, you rock! 🙇 ❤️ 🚀