Skip to content

Commit

Permalink
⚡ Gradle build optimizations (#3670)
Browse files Browse the repository at this point in the history
* ⚡ enable caching

* ⬆️ upgrade gradle to 6.6 in order to get access to metaInf runtime normalization functionality

* 🐛 fix failing test as a result of a minor change to gradle exception message when plugin cannot be applied

* ⚡ ignore Built-By and Built-Date attributes when examining the runtime classpath for changed values for task caching purposes

* 🔥 remove unneeded caching configuration
  • Loading branch information
ryandens authored May 17, 2022
1 parent 61e08e1 commit 6df635e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ subprojects {
'Built-Gradle': gradle.gradleVersion
}
}
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Built-By")
ignoreAttribute("Built-Date")
}
}
}
/* JAR */

/* MAVEN CENTRAL RELEASES */
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx1024m
org.gradle.caching=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void testCheckJibVersionInvoked() {
// Gradle tests aren't run from a jar and so don't have an identifiable plugin version
assertThat(exception)
.hasMessageThat()
.isEqualTo("Failed to apply plugin [id 'com.google.cloud.tools.jib']");
.isEqualTo("Failed to apply plugin 'com.google.cloud.tools.jib'.");
assertThat(exception.getCause())
.hasMessageThat()
.isEqualTo("Could not determine Jib plugin version");
Expand Down

0 comments on commit 6df635e

Please sign in to comment.