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

[Dependency Analysis] Add Android Gradle Plugin #31

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

ParaskP7
Copy link
Contributor

@ParaskP7 ParaskP7 commented Jul 4, 2024

Project Thread: paaHJt-6yU-p2
Required By: FluxC#TODO

Description

Adds Dependency Analysis plugin to be used for the WordPress-FluxC-Android repo (see Required By).

To test (FluxC PR):

  1. Based on this commit, verify that all the CI checks are successful.
  2. Smoke test the example app.

ParaskP7 added 2 commits July 4, 2024 17:05
FYI: This commit adds a previous version of the plugin (1.28.0) and not
the latest version (1.32.0). This is because the latest version gets
stuck during the 'computeActualUsage' phase and increases the build time
of the 'buildHealth' task by as much as five times (5x).

For more info see: Stuck in computeActualUsageDebug for many minutes
#1186 (https://github.com/autonomousapps/
dependency-analysis-gradle-plugin/issues/1186)
As per the documentation, this change follows the below step within the
'Adding a new dependency' section:

"If this is a new plugin, add it under plugins section in
example/build.gradle.kts - make sure to add .apply(false). This step is
necessary because we use the example module to generate a dependency
cache we use to speed up CI in other projects. We are able to
automatically add the library dependencies, so this step is not
necessary, but plugins need to be added manually."
@ParaskP7 ParaskP7 added the enhancement New feature or request label Jul 4, 2024
@ParaskP7 ParaskP7 requested a review from wzieba July 4, 2024 14:17
@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jul 4, 2024

Closing this as the Dependency Analysis plugin cannot be applied to FluxC just yet. This is because FluxC is currently using Kotlin 1.6.20, which makes it incompatible with the plugin, see exception below:

Could not initialize class org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices
> Exception java.lang.NoSuchFieldError: KOTLIN_STAT_ENABLED_PROPERTY [in thread "Daemon worker Thread 10"]

FYI: I went and really quickly tried to update FluxC to Kotlin 1.9.22, mainly because both JP/WPAndroid and WCAndroid is using this version too, which then produced another exception, see below:

* Where:
Build file '/Users/petros.paraskevopoulos/AndroidStudioProjects/automattic/library/WordPress-FluxC-Android/fluxc-processor/build.gradle' line: 1

* What went wrong:
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.jvm', version: '1.9.22']
> Failed to apply plugin 'org.jetbrains.kotlin.jvm'.
   > Kotlin source set not found. Please report on detekt's issue tracker

In general, I wouldn't recommend bumping Kotlin just for this plugin to work. Updating Kotlin should be considered another major task for FluxC and should be done in isolation to anything else.

@ParaskP7 ParaskP7 closed this Jul 4, 2024
@ParaskP7 ParaskP7 reopened this Jul 24, 2024
ParaskP7 added a commit to wordpress-mobile/WordPress-FluxC-Android that referenced this pull request Jul 24, 2024
FYI: This change was done for testing purposes and until the below
'Android Dependency Catalog' #32 PR gets merged to 'trunk'. When that's
done, the 'catalogVersion' will be updated to '1.19.0' instead.

------------------------------------------------------------------------

Android Dependency Catalog PR: [Migrate] [Dependency Analysis] Add
Android Gradle Plugin #31
- Automattic/android-dependency-catalog#31

------------------------------------------------------------------------

FYI: This commit adds a previous version of the plugin (1.28.0) and not
the latest version (1.32.0). This is because the latest version gets
stuck during the 'computeActualUsage' phase and increases the build time
of the 'buildHealth' task by as much as five times (5x).

For more info see: Stuck in computeActualUsageDebug for many minutes
#1186 (https://github.com/autonomousapps/
dependency-analysis-gradle-plugin/issues/1186)
@ParaskP7
Copy link
Contributor Author

👋 @wzieba and FYI that I reopened this PR and it is now ready for another go! 🙏

@ParaskP7 ParaskP7 merged commit a2f1152 into trunk Jul 25, 2024
6 checks passed
@ParaskP7 ParaskP7 deleted the build/dependency-analysis-android-gradle-plugin branch July 25, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants