Skip to content

Commit acda497

Browse files
authored
[fix] Configuration cache for groovy (#2797)
2 parents f0c55d1 + 97a9511 commit acda497

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

plugin-gradle/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
77
- Add a `expandWildcardImports` API for java ([#2679](https://github.com/diffplug/spotless/issues/2594))
88
- Add the ability to specify a wildcard version (`*`) for external formatter executables. ([#2757](https://github.com/diffplug/spotless/issues/2757))
99
### Fixed
10+
- configuration cache for groovy. ([#2797](https://github.com/diffplug/spotless/pull/2797))
1011
- [fix] `NPE` due to workingTreeIterator being null for git ignored files. #911 ([#2771](https://github.com/diffplug/spotless/issues/2771))
1112
- Prevent race conditions when multiple npm-based formatters launch the server process simultaneously while sharing the same `node_modules` directory. ([#2786](https://github.com/diffplug/spotless/pull/2786))
1213
### Changes

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GroovyExtension.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2025 DiffPlug
2+
* Copyright 2016-2026 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,12 +60,13 @@ protected void setupTask(SpotlessTask task) {
6060
if (!getProject().getPlugins().hasPlugin(GroovyBasePlugin.class)) {
6161
throw new GradleException(message);
6262
}
63+
final boolean excludeJavaValue = excludeJava;
6364
target = getSources(getProject(),
6465
message,
6566
sourceSet -> sourceSet.getExtensions().getByType(GroovySourceDirectorySet.class),
6667
file -> {
6768
final String name = file.getName();
68-
if (excludeJava) {
69+
if (excludeJavaValue) {
6970
return name.endsWith(".groovy");
7071
} else {
7172
return name.endsWith(".groovy") || name.endsWith(".java");

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ develocity {
6060
termsOfUseUrl = "https://gradle.com/terms-of-service"
6161
termsOfUseAgree = "yes"
6262
publishing {
63-
onlyIf { providers.environmentVariable('CI').present }
63+
onlyIf { getenv('CI') != null }
6464
}
6565
}
6666
}

0 commit comments

Comments
 (0)