File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
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 {
You can’t perform that action at this time.
0 commit comments