Clean up build.gradle
// define all versioned plugins here and apply in subprojects as necessary without version
plugins {
id 'com.github.sherter.google-java-format' version '0.9' apply false
- id 'net.ltgt.apt' version '0.21' apply false
id 'net.ltgt.errorprone' version '2.0.2' apply false
id 'net.researchgate.release' version '2.8.1' apply false
id 'com.gradle.plugin-publish' version '0.16.0' apply false
id 'io.freefair.maven-plugin' version '5.3.3.3' apply false
- // apply so we can correctly configure the test runner to be gradle at the project level
- id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.1'
-
// apply so that we can collect quality metrics at the root project level
id 'org.sonarqube' version '3.3'
}
-// run tests in intellij using gradle test runner
-idea.project.settings {
- delegateActions {
- delegateBuildRunToGradle = false
- testRunner = 'GRADLE'
- }
-}
-
-import net.ltgt.gradle.errorprone.CheckSeverity
-
-// `java-library` must be applied before `java`
-// java-gradle-plugin (in jib-gradle-plugin) auto applies java-library, so ensure that happens first
-['jib-core', 'jib-gradle-plugin', 'jib-gradle-plugin-extension-api', 'jib-maven-plugin-extension-api'].each { projectName ->
- project(projectName) {
- apply plugin: 'java-library'
- }
-}
-
-subprojects {
- group 'com.google.cloud.tools'
-
- repositories {
- mavenCentral()
- }
-
- apply plugin: 'java'
- apply plugin: 'checkstyle'
- apply plugin: 'com.github.sherter.google-java-format'
- apply plugin: 'net.ltgt.apt'
- apply plugin: 'net.ltgt.errorprone'
- apply plugin: 'jacoco'
-
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
- compileJava.options.encoding = 'UTF-8'
- compileJava.options.compilerArgs += [ '-Xlint:deprecation' ]
- compileTestJava.options.compilerArgs += [ '-Xlint:deprecation' ]
-
/* PROJECT DEPENDENCY VERSIONS */
// define all common versioned dependencies here
project.ext.dependencyStrings = [
@@ -98,6 +56,33 @@ subprojects {
JBCRYPT: 'org.mindrot:jbcrypt:0.4',
]
+import net.ltgt.gradle.errorprone.CheckSeverity
+
+// `java-library` must be applied before `java`.
+// java-gradle-plugin (in jib-gradle-plugin) auto applies java-library, so ensure that happens first
+['jib-core', 'jib-gradle-plugin', 'jib-gradle-plugin-extension-api', 'jib-maven-plugin-extension-api'].each { projectName ->
+ project(projectName).apply plugin: 'java-library'
+}
+
+subprojects {
+ group 'com.google.cloud.tools'
+
+ repositories {
+ mavenCentral()
+ }
+
+ apply plugin: 'java'
+ apply plugin: 'checkstyle'
+ apply plugin: 'com.github.sherter.google-java-format'
+ apply plugin: 'net.ltgt.errorprone'
+ apply plugin: 'jacoco'
+
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ compileJava.options.encoding = 'UTF-8'
+ compileJava.options.compilerArgs += [ '-Xlint:deprecation' ]
+ compileTestJava.options.compilerArgs += [ '-Xlint:deprecation' ]
+
// Use this to ensure we correctly override transitive dependencies
// TODO: There might be a plugin that does this
task ensureTransitiveDependencyOverrides {
