File tree Expand file tree Collapse file tree 5 files changed +21
-13
lines changed
gradle-palantir-java-format/src
main/java/com/palantir/javaformat/gradle
test/groovy/com/palantir/javaformat/gradle Expand file tree Collapse file tree 5 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1+ type : improvement
2+ improvement :
3+ description : Update spotless to 5.7.0
4+ links :
5+ - https://github.com/palantir/palantir-java-format/pull/358
Original file line number Diff line number Diff line change 1515 */
1616package com .palantir .javaformat .gradle ;
1717
18+ import com .google .common .collect .ImmutableList ;
1819import org .gradle .api .Plugin ;
1920import org .gradle .api .Project ;
2021
2122public class PalantirJavaFormatSpotlessPlugin implements Plugin <Project > {
23+ // The spotless gradle plugin got renamed to 'com.diffplug.spotless' at version 5.0.0
24+ private static final ImmutableList <String > SPOTLESS_PLUGINS =
25+ ImmutableList .of ("com.diffplug.gradle.spotless" , "com.diffplug.spotless" );
26+
2227 @ Override
2328 public void apply (Project project ) {
2429 project .getRootProject ().getPluginManager ().apply (PalantirJavaFormatProviderPlugin .class );
2530
2631 project .getPluginManager ().withPlugin ("java" , plugin -> {
27- project .getPluginManager ().withPlugin ("com.diffplug.gradle.spotless" , spotlessPlugin -> {
28- SpotlessInterop .addSpotlessJavaStep (project , PalantirJavaFormatProviderPlugin .CONFIGURATION_NAME );
29- });
32+ SPOTLESS_PLUGINS .forEach (
33+ spotlessPluginId -> project .getPluginManager ().withPlugin (spotlessPluginId , spotlessPlugin -> {
34+ SpotlessInterop .addSpotlessJavaStep (
35+ project , PalantirJavaFormatProviderPlugin .CONFIGURATION_NAME );
36+ }));
3037 });
3138 }
3239}
Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ class PalantirJavaFormatSpotlessPluginTest extends IntegrationTestKitSpec {
2323
2424 void setup () {
2525 buildFile << """
26- buildscript {
27- dependencies {
28- classpath "com.diffplug.spotless:spotless-plugin-gradle:3.26.1"
29- }
30- }
26+ // The 'com.diffplug.spotless:spotless-plugin-gradle' dependency is already added by palantir-java-format
3127 plugins {
3228 id 'java'
3329 id 'com.palantir.java-format'
@@ -41,7 +37,7 @@ class PalantirJavaFormatSpotlessPluginTest extends IntegrationTestKitSpec {
4137
4238 def " formats with spotless when spotless is applied" () {
4339 buildFile << """
44- apply plugin: 'com.diffplug.gradle. spotless'
40+ apply plugin: 'com.diffplug.spotless'
4541 """ . stripIndent()
4642
4743 file(' src/main/java/Main.java' ). text = invalidJavaFile
Original file line number Diff line number Diff line change 22com.diffplug.durian:durian-collect:1.2.0 (3 constraints: 4d313bd2)
33com.diffplug.durian:durian-core:1.2.0 (4 constraints: 2640ae56)
44com.diffplug.durian:durian-io:1.2.0 (1 constraints: 1313c62d)
5- com.diffplug.spotless:spotless-lib:2.1 .0 (2 constraints: 822455a4 )
6- com.diffplug.spotless:spotless-lib-extra:2.1 .0 (1 constraints: 1313c82d )
7- com.diffplug.spotless:spotless-plugin-gradle:4.5.1 (1 constraints: 0c050f36 )
5+ com.diffplug.spotless:spotless-lib:2.9 .0 (2 constraints: 92242da6 )
6+ com.diffplug.spotless:spotless-lib-extra:2.9 .0 (1 constraints: 1b13e02d )
7+ com.diffplug.spotless:spotless-plugin-gradle:5.7.0 (1 constraints: 0e051936 )
88com.fasterxml.jackson.core:jackson-annotations:2.11.1 (1 constraints: 85123021)
99com.fasterxml.jackson.core:jackson-core:2.11.1 (3 constraints: 5e41611c)
1010com.fasterxml.jackson.core:jackson-databind:2.11.1 (3 constraints: 10341167)
Original file line number Diff line number Diff line change 1- com.diffplug.spotless:spotless-plugin-gradle = 4.5.1
1+ com.diffplug.spotless:spotless-plugin-gradle = 5.7.0
22com.github.ben-manes.caffeine:caffeine = 2.8.5
33com.google.auto.service:auto-service = 1.0-rc6
44com.google.code.findbugs:jsr305 = 3.0.2
You can’t perform that action at this time.
0 commit comments