diff --git a/build.gradle b/build.gradle index 00b9ee503..f38ada6d0 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,7 @@ plugins { id "com.moowork.node" version "1.2.0" id 'idea' + id 'com.diffplug.gradle.spotless' version '3.18.0' } apply plugin: google.registry.gradle.plugin.ReportUploaderPlugin @@ -205,4 +206,3 @@ subprojects { } } } - diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 4c58e9600..3bb7937fd 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -8,14 +8,13 @@ buildscript { } plugins { -// Java static analysis plugins. Keep versions consistent with ../build.gradle + // Java static analysis plugins. Keep versions consistent with ../build.gradle id 'nebula.lint' version '10.4.2' // Config helper for annotation processors such as AutoValue and Dagger. // Ensures that source code is generated at an appropriate location. id 'net.ltgt.apt' version '0.19' apply false id 'net.ltgt.errorprone' version '0.6.1' id 'checkstyle' - id 'com.diffplug.gradle.spotless' version '3.18.0' } @@ -53,26 +52,6 @@ checkstyle { configDir file('../config/checkstyle') } -// To check or fix file formats, run the following commands from this directory: -// - Check: ../gradlew spotlessCheck -// - Format in place: ../gradlew spotlessApply -spotless { - java { - target project.fileTree("${project.rootDir}/") { - include "src/main/java/**/*.java" - include "src/test/java/**/*.java" - } - googleJavaFormat('1.7') - } - format 'misc', { - target '**/*.gradle' - - trimTrailingWhitespace() - indentWithSpaces(2) - endWithNewline() - } -} - dependencies { def deps = dependencyMap compile deps['com.google.auth:google-auth-library-credentials'] diff --git a/core/build.gradle b/core/build.gradle index 9e32ce71c..5e241b459 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -677,5 +677,3 @@ createUberJar('nomulus', 'nomulus', 'google.registry.tools.RegistryTool') createUberJar('gtechTool', 'gtech_tool', 'google.registry.tools.GtechTool') project.nomulus.dependsOn project(':third_party').jar project.gtechTool.dependsOn project(':third_party').jar - - diff --git a/dependencies.gradle b/dependencies.gradle index 1792fa2de..068fd2930 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -158,4 +158,3 @@ ext { [key, it] } } - diff --git a/gradle/dependency-locks/buildscript-classpath.lockfile b/gradle/dependency-locks/buildscript-classpath.lockfile index f997b0b0d..3bb813baf 100644 --- a/gradle/dependency-locks/buildscript-classpath.lockfile +++ b/gradle/dependency-locks/buildscript-classpath.lockfile @@ -1,14 +1,21 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -antlr:antlr:2.7.7 cglib:cglib-nodep:3.2.2 +com.diffplug.durian:durian-collect:1.2.0 +com.diffplug.durian:durian-core:1.2.0 +com.diffplug.durian:durian-io:1.2.0 +com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:3.18.0 +com.diffplug.spotless:spotless-lib-extra:1.18.0 +com.diffplug.spotless:spotless-lib:1.18.0 +com.diffplug.spotless:spotless-plugin-gradle:3.18.0 com.github.jengelman.gradle.plugins:shadow:5.0.0 com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:5.0.0 com.google.cloud.tools:appengine-gradle-plugin:1.3.3 com.google.cloud.tools:appengine-plugins-core:0.3.2 com.google.code.gson:gson:2.7 com.google.guava:guava:20.0 +com.googlecode.concurrent-trees:concurrent-trees:2.6.1 com.googlecode.javaewah:JavaEWAH:1.1.6 com.jcraft:jsch:0.1.54 com.jcraft:jzlib:1.1.1 @@ -46,8 +53,8 @@ org.codehaus.groovy:groovy-all:2.4.9 org.codehaus.groovy:groovy-ant:2.1.8 org.codehaus.groovy:groovy-groovydoc:2.1.8 org.codehaus.groovy:groovy-templates:2.1.8 -org.codehaus.groovy:groovy-xml:2.1.8 -org.codehaus.groovy:groovy:2.1.8 +org.codehaus.groovy:groovy-xml:2.4.7 +org.codehaus.groovy:groovy:2.4.7 org.codehaus.jsr166-mirror:jsr166y:1.7.0 org.codehaus.plexus:plexus-component-annotations:1.7.1 org.codehaus.plexus:plexus-interpolation:1.25 @@ -67,7 +74,6 @@ org.objenesis:objenesis:2.4 org.ow2.asm:asm-analysis:7.0-beta org.ow2.asm:asm-commons:7.0-beta org.ow2.asm:asm-tree:7.0-beta -org.ow2.asm:asm-util:4.0 org.ow2.asm:asm:7.0 org.slf4j:slf4j-api:1.7.2 org.sonatype.aether:aether-api:1.13.1 diff --git a/java_common.gradle b/java_common.gradle index 2e1223002..2e0b60c45 100644 --- a/java_common.gradle +++ b/java_common.gradle @@ -41,7 +41,6 @@ targetCompatibility = '1.8' compileJava { options.encoding = "UTF-8" } compileTestJava { options.encoding = "UTF-8" } - gradleLint.rules = [ // Checks if Gradle wrapper is up-to-date 'archaic-wrapper', @@ -51,3 +50,26 @@ gradleLint.rules = [ 'unused-dependency' // TODO(weiminyu): enable more dependency checks ] + +// To check or fix file formats, run the following commands from this directory: +// - Check: ./gradlew spotlessCheck +// - Format in place: ./gradlew spotlessApply +spotless { + java { + clearSteps() + target project.fileTree("${project.rootDir}/") { + include "src/main/java/**/*.java" + include "src/test/java/**/*.java" + // there are some files that have degenerate interactions with the GJF formatter + exclude "**/flows/FlowComponent.java" + } + googleJavaFormat('1.7') + } + format 'misc', { + clearSteps() + target '**/*.gradle' + trimTrailingWhitespace() + indentWithSpaces(2) + endWithNewline() + } +} diff --git a/proxy/build.gradle b/proxy/build.gradle index 4f971fa32..11079d070 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -59,4 +59,3 @@ dependencies { annotationProcessor deps['com.google.dagger:dagger-compiler'] testAnnotationProcessor deps['com.google.dagger:dagger-compiler'] } -