gradle-xjc-plugin icon indicating copy to clipboard operation
gradle-xjc-plugin copied to clipboard

Support for Gradle configuration cache

Open jprinet opened this issue 3 years ago • 2 comments

The Gradle configuration cache can't be enabled when using org.unbroken-dome.xjc Gradle plugin.

Quoting from the doc:

Gradle model types (e.g. Gradle, Settings, Project, SourceSet, Configuration etc…​) are usually used to carry some task input that should be explicitly and precisely declared instead.

Using a reference to the Configuration object is not supported: https://github.com/unbroken-dome/gradle-xjc-plugin/blob/82c1d69e0de91d11a61ae6153f89491adafa3a84/src/main/kotlin/org/unbrokendome/gradle/plugins/xjc/XjcGenerate.kt#L114

jprinet avatar Nov 26 '21 09:11 jprinet

catalogResolutionClasspath could be a ConfigurableFileCollection instead, which is supported by the configuration cache.

eskatos avatar Nov 26 '21 09:11 eskatos

@eskatos thanks for your comment on this concerning making the plugin work with Gradle configuration cache

When you say this could be a ConfigurableFileCollection are you aware the MavenUriResolver feature does need an absolutePath to the JAR file, but it also needs the original Maven style GAV coordinate information such as org.groupId:artifactId:jar:classifier:1.2.3.4 as to the reason why that specific JAR file was selected.

So unfortunately this Property is not just a standard list of file: scheme URL JARs list

However good news, after surveying the landscape for solutions and understanding of the problem it appears @ryandens has successfully produced a clean commit (in the past month) that understands the feature of this plugin.

https://github.com/ryandens/gradle-xjc-plugin/commit/8956a7e2d79777aa34c6cc3f67012842116bc2cd https://github.com/ryandens/gradle-xjc-plugin/commit/f488e10903bd5ac57a40458be40dd8094bb6a5b3

At this time and updated change-set https://github.com/dlmiles/gradle-xjc-plugin/tree/master is undergoing CI testing before being added to PR #47 (or its successor)

dlmiles avatar Dec 10 '23 01:12 dlmiles