Closed rmarma closed 1 year ago
@rmarma Thank you for fix the configuration cache issue. Could you create Pull Request on snapshot-1.3.6
branch on this repository?
@rmarma Thank you. I'm going to release it in a few days. You can try changes at 1.3.6-SNAPSHOT version now.
@cosic, It works, but only on JDK 18:
On JDK 17/11 get error:
> Could not resolve all files for configuration ':classpath'.
> Could not resolve ru.cian:huawei-publish-gradle-plugin:1.3.6-SNAPSHOT.
Required by:
project :
> No matching variant of ru.cian:huawei-publish-gradle-plugin:1.3.6-SNAPSHOT:20230429.205109-1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.1.1' but:
- Variant 'apiElements' capability ru.cian:huawei-publish-gradle-plugin:1.3.6-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 18 and the consumer needed a component for use during runtime, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.1.1')
- Variant 'runtimeElements' capability ru.cian:huawei-publish-gradle-plugin:1.3.6-SNAPSHOT declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 18 and the consumer needed a component, compatible with Java 17
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.1.1')
1.3.6-SNAPSHOT:20230429.205109-1
compiled with JDK 18?
1.3.6-SNAPSHOT:20230429.205109-1 compiled with JDK 18?
Yes, it compiled with JDK 18. I have been prepared new version for AGP 8+. But it seems a better way release configuration cache on JDK 11-17 and upto JDK 18 at next release.
@rmarma So, I've published 2 versions:
1.3.6-SNAPSHOT
– with fix configuration cache issue for JDK11-171.4.0-SNAPSHOT
– with fix configuration cache issue for JDK18+@cosic, thanks)
Why JDK 18? AFAIK, AGP 8 requires JDK17.
@rmarma Actualy you are right. I shoult build it with JDK 17.
@cosic, ok.
1.3.6 - JDK11+ 1.4.0 - JDK17+
The problem is solved, we can close this issue.
Problem
To establish a soft relationship between tasks, the plugin uses the whenTaskAdded method. This breaks the Task Configuration Avoidance. Scan for task
./gradlew :app:help
:Quick fix
Replace
whenTaskAdded
withconfigureEach
. But we are still losing "laziness" for thepublishHuaweiAppGallery
task in this line:Solution
We can be sure that the project contains
assemble
andbundle
tasks, because the plugin is only used together withcom.android.application
:Therefore, we can establish the relationship between the tasks as follows:
Need testing!