Skip to content

Commit

Permalink
More gradle script formatting (#814)
Browse files Browse the repository at this point in the history
Follow-up to #809. I had put the configuration for Gradle formatting in
the wrong place previously (only applying to sub-projects), so a couple
Gradle scripts were missed.
  • Loading branch information
msridhar authored Aug 22, 2023
1 parent 72e6d6f commit 56d5ff1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
52 changes: 26 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ buildscript {
}
}
plugins {
id "com.diffplug.spotless" version "6.20.0"
id "net.ltgt.errorprone" version "3.1.0" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "com.github.kt3k.coveralls" version "2.12.0" apply false
id "me.champeau.jmh" version "0.7.1" apply false
id "com.github.ben-manes.versions" version "0.47.0"
id "com.felipefzdz.gradle.shellcheck" version "1.4.6"
id "com.diffplug.spotless" version "6.20.0"
id "net.ltgt.errorprone" version "3.1.0" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "com.github.kt3k.coveralls" version "2.12.0" apply false
id "me.champeau.jmh" version "0.7.1" apply false
id "com.github.ben-manes.versions" version "0.47.0"
id "com.felipefzdz.gradle.shellcheck" version "1.4.6"
}

repositories {
// to get the google-java-format jar and dependencies
mavenCentral()
// to get the google-java-format jar and dependencies
mavenCentral()
}

apply from: "gradle/dependencies.gradle"
Expand All @@ -59,10 +59,10 @@ subprojects { project ->
project.tasks.withType(JavaCompile) {
dependsOn(installGitHooks)
options.compilerArgs += [
"-Xlint:deprecation",
"-Xlint:rawtypes",
"-Xlint:unchecked",
"-Werror"
"-Xlint:deprecation",
"-Xlint:rawtypes",
"-Xlint:unchecked",
"-Werror"
]
options.errorprone {
// disable warnings in generated code; AutoValue code fails UnnecessaryParentheses check
Expand All @@ -84,7 +84,7 @@ subprojects { project ->
// To enable auto-patching, uncomment the line below, replace [CheckerName] with
// the checker(s) you want to apply patches for (comma-separated), and above, disable
// "-Werror"
// errorproneArgs.addAll("-XepPatchChecks:[CheckerName]", "-XepPatchLocation:IN_PLACE")
// errorproneArgs.addAll("-XepPatchChecks:[CheckerName]", "-XepPatchLocation:IN_PLACE")
}
}

Expand Down Expand Up @@ -112,19 +112,19 @@ subprojects { project ->
java {
googleJavaFormat()
}
groovyGradle {
target '**/*.gradle'
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
}
}
}

spotless {
predeclareDeps()
groovyGradle {
target '**/*.gradle'
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
}
spotlessPredeclare {
java { googleJavaFormat('1.17.0') }
Expand All @@ -148,9 +148,9 @@ shellcheck {
//

tasks.register('installGitHooks', Copy) {
from(file('config/hooks/pre-commit-stub')) {
rename 'pre-commit-stub', 'pre-commit'
}
into file('.git/hooks')
fileMode 0777
from(file('config/hooks/pre-commit-stub')) {
rename 'pre-commit-stub', 'pre-commit'
}
into file('.git/hooks')
fileMode 0777
}
17 changes: 11 additions & 6 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ if (project.hasProperty("epApiVersion")) {
}
if (epApiVNum.compareTo(VersionNumber.parse(oldestErrorProneVersion)) < 0) {
throw new IllegalArgumentException(
"Error Prone API version " + epApiVersion + " is too old; "
+ oldestErrorProneVersion + " is the oldest supported version")
"Error Prone API version " + epApiVersion + " is too old; "
+ oldestErrorProneVersion + " is the oldest supported version")
}
errorProneVersionToCompileAgainst = epApiVersion
}
Expand Down Expand Up @@ -77,9 +77,11 @@ def build = [
jspecify : "org.jspecify:jspecify:0.3.0",
jsr305Annotations : "com.google.code.findbugs:jsr305:3.0.2",
commonsIO : "commons-io:commons-io:2.11.0",
wala : ["com.ibm.wala:com.ibm.wala.util:${versions.wala}",
"com.ibm.wala:com.ibm.wala.shrike:${versions.wala}",
"com.ibm.wala:com.ibm.wala.core:${versions.wala}"],
wala : [
"com.ibm.wala:com.ibm.wala.util:${versions.wala}",
"com.ibm.wala:com.ibm.wala.shrike:${versions.wala}",
"com.ibm.wala:com.ibm.wala.core:${versions.wala}"
],
commonscli : "commons-cli:commons-cli:${versions.commonscli}",

// android stuff
Expand All @@ -96,7 +98,10 @@ def support = [

def test = [
junit4 : "junit:junit:4.13.2",
junit5Jupiter : ["org.junit.jupiter:junit-jupiter-api:5.0.2","org.apiguardian:apiguardian-api:1.0.0"],
junit5Jupiter : [
"org.junit.jupiter:junit-jupiter-api:5.0.2",
"org.apiguardian:apiguardian-api:1.0.0"
],
jetbrainsAnnotations : "org.jetbrains:annotations:13.0",
cfQual : "org.checkerframework:checker-qual:${versions.checkerFramework}",
// 2.5.5 is the last release to contain this artifact
Expand Down

0 comments on commit 56d5ff1

Please sign in to comment.