File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.diffplug.spotless'
22spotless {
3- def noInternalDepsClosure = {
4- String text = it
5- /*
6- * No good way to get around using this import:
7- * https://github.com/gradle/gradle/issues/3191
8- */
9- String regex = " import org\\ .gradle\\ .api\\ .internal\\ .(?!plugins\\ .DslObject)(?!project\\ .ProjectInternal)"
10- if ((text. contains(' import org.gradle.internal.' ) || text. find(regex)) &&
11- ! text. contains(' def noInternalDepsClosure' )) {
12- throw new AssertionError (" Accidental internal import" )
13- }
14- }
153 if (project != rootProject) {
164 // the rootProject doesn't have any java
175 java {
@@ -22,9 +10,9 @@ spotless {
2210 eclipse(). configFile rootProject. file(' gradle/spotless.eclipseformat.xml' )
2311 trimTrailingWhitespace()
2412 removeUnusedImports()
25- removeWildcardImports()
2613 formatAnnotations()
27- custom ' noInternalDeps' , noInternalDepsClosure
14+ forbidWildcardImports()
15+ forbidRegex(' ForbidGradleInternal' , ' import org\\ .gradle\\ .api\\ .internal\\ .(.*)' , " Don't use Gradle's internal API" )
2816 }
2917 }
3018 groovyGradle {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pluginManagement {
66}
77
88plugins {
9- id ' com.diffplug.spotless' version ' 7.2.1 ' apply false
9+ id ' com.diffplug.spotless' version ' 8.0.0 ' apply false
1010 // https://plugins.gradle.org/plugin/com.gradle.plugin-publish
1111 id ' com.gradle.plugin-publish' version ' 2.0.0' apply false
1212 // https://github.com/gradle-nexus/publish-plugin/releases
You can’t perform that action at this time.
0 commit comments