Skip to content

Commit dcdcc78

Browse files
authored
Enable stable config cache (#1588)
2 parents d95083d + 7de2dfa commit dcdcc78

File tree

9 files changed

+38
-8
lines changed

9 files changed

+38
-8
lines changed

Diff for: .github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
pull_request:
77
push:
88
branches: [main]
9+
workflow_dispatch:
10+
911
concurrency:
1012
group: ${{ github.workflow }}-${{ github.ref }}
1113
cancel-in-progress: true

Diff for: CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Changes
14+
* We are now opting in to Gradle's new stable configuration cache. ([#1591](https://github.com/diffplug/spotless/pull/1591))
1315

1416
## [2.36.0] - 2023-02-27
1517
### Added

Diff for: _ext/gradle/p2-fat-jar-setup.gradle

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ext {
1212
p2Dependencies = "p2Dependencies not defined in project"
1313
}
1414

15-
// Some JARs may include JARs themselfs, which shall be unpacked and added to the embedded class folder.
15+
// Some JARs may include JARs themselfs, which shall be unpacked and added to the embedded class folder.
1616
if (!project.hasProperty('internalJars')) {
1717
internalJars = []
1818
}
@@ -35,13 +35,13 @@ ext {
3535
'META-INF/*.SF', // ... so all signatures are filtered
3636
]
3737
}
38-
38+
3939
// Map fat-JAR resources path if JAR file name does not correspond to plugin package name (e.g. required for internal plugins)
4040
if (!project.hasProperty('fatJarResourcesMap')) {
4141
fatJarResourcesMap = [:]
4242
}
43-
44-
43+
44+
4545
// The directory contains all external classes for the fat-jar
4646
embeddedClassesDirName = 'build/embeddedClasses'
4747
embeddedClassesDir = project.file(embeddedClassesDirName)
@@ -163,3 +163,7 @@ apply plugin: 'idea'
163163
// Encure that the dependent classes are preovided for compilation if project is build via Eclipse instead of command line
164164
tasks.idea.dependsOn(unjarEmbeddedClasses)
165165

166+
tasks.named('ideaModule') {
167+
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13480")
168+
}
169+

Diff for: gradle.properties

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# To fix metaspace errors
2-
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
2+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
3+
org.gradle.parallel=true
4+
org.gradle.caching=true
5+
org.gradle.unsafe.configuration-cache=true
6+
37
name=spotless
48
description=Spotless - keep your code spotless with Gradle
59
org=diffplug

Diff for: gradle/java-publish.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ if (System.env['JITPACK'] == 'true' || version.endsWith('-SNAPSHOT')) {
200200
}
201201
}
202202

203+
tasks.withType(Sign).configureEach {
204+
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470")
205+
}
206+
203207
tasks.withType(AbstractArchiveTask).configureEach {
204208
preserveFileTimestamps = false
205209
reproducibleFileOrder = true

Diff for: gradle/java-setup.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask).configureEach {
3030
reports {
3131
html.enabled = true
3232
}
33+
notCompatibleWithConfigurationCache("https://github.com/spotbugs/spotbugs-gradle-plugin/issues/670")
3334
}
3435

3536
tasks.named('spotbugsMain') {

Diff for: plugin-gradle/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ gradlePlugin {
7373
}
7474
}
7575
}
76-
if (version.endsWith('-SNAPSHOT')) {
77-
publishPlugins.enabled = false
76+
77+
tasks.named("publishPlugins") {
78+
enabled = !version.endsWith('-SNAPSHOT')
79+
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283")
7880
}
7981

8082
// have to apply java-publish after setting up the pluginBundle

Diff for: plugin-maven/build.gradle

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask
2+
import de.benediktritter.maven.plugin.development.task.GenerateMavenPluginDescriptorTask
3+
14
plugins {
25
// https://www.benediktritter.de/maven-plugin-development/#release-history
36
id 'de.benediktritter.maven-plugin-development' version '0.4.1'
@@ -10,13 +13,19 @@ version = spotlessChangelog.versionNext
1013
apply from: rootProject.file("gradle/java-setup.gradle")
1114
apply from: rootProject.file('gradle/spotless-freshmark.gradle')
1215

13-
apply plugin: 'de.benediktritter.maven-plugin-development'
1416
mavenPlugin {
1517
name = 'Spotless Maven Plugin'
1618
artifactId = project.artifactIdMaven
1719
description = project.description
1820
}
1921

22+
tasks.withType(GenerateMavenPluginDescriptorTask).configureEach {
23+
notCompatibleWithConfigurationCache('https://github.com/britter/maven-plugin-development/issues/8')
24+
}
25+
tasks.withType(GenerateHelpMojoSourcesTask).configureEach {
26+
notCompatibleWithConfigurationCache('https://github.com/britter/maven-plugin-development/issues/8')
27+
}
28+
2029
String VER_MAVEN_API = '3.0'
2130
String VER_ECLIPSE_AETHER = '1.1.0'
2231
String VER_PLEXUS_RESOURCES = '1.2.0'

Diff for: settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ gradleEnterprise {
6868
}
6969
}
7070

71+
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
72+
7173
rootProject.name = 'spotless'
7274

7375
include 'lib' // reusable library with no dependencies

0 commit comments

Comments
 (0)