Skip to content

Commit b96df83

Browse files
Merge pull request #73 from gradle/cjohnson/enable-config-cache
Enable configuration caching
2 parents a13b337 + ed8aafb commit b96df83

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

build.gradle.kts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,16 @@ val copyGradleScripts = tasks.register<Copy>("copyGradleScripts") {
9393
group = "build"
9494
description = "Copies the Gradle source and generated scripts to output directory."
9595

96-
inputs.property("project.version", appVersion)
96+
val projectVersion = appVersion // local variable required for configuration cache compatibility
97+
inputs.property("project.version", projectVersion)
9798

9899
from(layout.projectDirectory.file("LICENSE"))
99100
from(layout.projectDirectory.dir("release").file("version.txt"))
100101
rename("version.txt", "VERSION")
101102

102103
from(layout.projectDirectory.dir("components/scripts/gradle")) {
103104
exclude("gradle-init-scripts")
104-
filter { line: String -> line.replace("<HEAD>", appVersion) }
105+
filter { line: String -> line.replace("<HEAD>", projectVersion) }
105106
}
106107
from(layout.projectDirectory.dir("components/scripts/gradle")) {
107108
include("gradle-init-scripts/**")
@@ -111,7 +112,7 @@ val copyGradleScripts = tasks.register<Copy>("copyGradleScripts") {
111112
include("README.md")
112113
include("lib/**")
113114
exclude("lib/cli-parsers")
114-
filter { line: String -> line.replace("<HEAD>", appVersion) }
115+
filter { line: String -> line.replace("<HEAD>", projectVersion) }
115116
}
116117
from(applyArgbash.map { it.outputDir.file("lib/cli-parsers/gradle") }) {
117118
into("lib/")
@@ -126,20 +127,21 @@ val copyMavenScripts = tasks.register<Copy>("copyMavenScripts") {
126127
group = "build"
127128
description = "Copies the Maven source and generated scripts to output directory."
128129

129-
inputs.property("project.version", appVersion)
130+
val projectVersion = appVersion // local variable required for configuration cache compatibility
131+
inputs.property("project.version", projectVersion)
130132

131133
from(layout.projectDirectory.file("LICENSE"))
132134
from(layout.projectDirectory.dir("release").file("version.txt"))
133135
rename("version.txt", "VERSION")
134136

135137
from(layout.projectDirectory.dir("components/scripts/maven")) {
136-
filter { line: String -> line.replace("<HEAD>", appVersion) }
138+
filter { line: String -> line.replace("<HEAD>", projectVersion) }
137139
}
138140
from(layout.projectDirectory.dir("components/scripts/")) {
139141
include("README.md")
140142
include("lib/**")
141143
exclude("lib/cli-parsers")
142-
filter { line: String -> line.replace("<HEAD>", appVersion) }
144+
filter { line: String -> line.replace("<HEAD>", projectVersion) }
143145
}
144146
from(applyArgbash.map { it.outputDir.file("lib/cli-parsers/maven") }) {
145147
into("lib/")
@@ -262,6 +264,10 @@ tasks.named("githubRelease") {
262264
dependsOn("createReleaseTag")
263265
}
264266

267+
tasks.withType(Sign::class).configureEach {
268+
notCompatibleWithConfigurationCache("$name task does not support configuration caching")
269+
}
270+
265271
fun gitHubReleaseName(): String {
266272
if (isDevelopmentRelease) {
267273
return "Development Build"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ org.gradle.vfs.watch=true
22
org.gradle.daemon=true
33
org.gradle.parallel=true
44
org.gradle.caching=true
5-
org.gradle.unsafe.configuration-cache=false
5+
org.gradle.unsafe.configuration-cache=true
66
org.gradle.jvmargs=-Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8

0 commit comments

Comments
 (0)