Fixes to allow Configuration Caching in Gradle 6.6+#591
Fixes to allow Configuration Caching in Gradle 6.6+#591johnrengelman merged 6 commits intoGradleUp:masterfrom
Conversation
We (myself and @britter) believe this PR allows the Shadow Plugin to be used in a Gradle 6.6+ build with --configuration-cache enabled. We unfortunately did not get round to fixing the case where `minimize()` is used, so it does not work if that is called in the build. We're basically looking for suggestions on what we can do to improve it, or whether it is good enough to go in as-is Cheers Tim (and Benedikt)
|
(upcoming configuration cache feature is described here https://docs.gradle.org/release-candidate/userguide/configuration_cache.html) |
|
@eskatos I think you only need to call def "configuration caching supports minimize"() {
given:
buildFile << """
shadowJar {
minimize()
}
""".stripIndent()
when:
runner.withArguments('--configuration-cache', 'shadowJar').build()
output.delete()
def result = runner.withArguments('--configuration-cache', 'shadowJar').build()
then:
contains(output, ['a.properties', 'b.properties'])
and:
doesNotContain(output, ['a2.properties'])
result.output.contains("Reusing configuration cache.")
} |
Signed-off-by: Paul Merlin <paul@gradle.com>
Signed-off-by: Paul Merlin <paul@gradle.com>
1cc82aa to
a45502d
Compare
Signed-off-by: Paul Merlin <paul@gradle.com>
Signed-off-by: Paul Merlin <paul@gradle.com>
Signed-off-by: Paul Merlin <paul@gradle.com>
|
With the latest changes above, the Here are some links about configuration caching in Gradle:
@johnrengelman this should be ready for review, could you please take a look? BTW it looks like the circleci build is broken |
| jar.inputs.property('mainClassName', classNameProvider) | ||
| jar.doFirst { | ||
| manifest.attributes 'Main-Class': pluginConvention.mainClassName | ||
| manifest.attributes 'Main-Class': classNameProvider.get() |
There was a problem hiding this comment.
manifest.attributes support providers: https://twitter.com/VladimirSitnikv/status/1260952932981313544
We (myself and @britter) believe this PR allows the Shadow Plugin to be used
in a Gradle 6.6+ build with --configuration-cache enabled.
We unfortunately did not get round to fixing the case where
minimize()isused, so it does not work if that is called in the build.
We're basically looking for suggestions on what we can do to improve it,
or whether it is good enough to go in as-is
Cheers
Tim (and Benedikt)