Skip to content

Commit

Permalink
Add Java 16 build
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jul 14, 2021
1 parent 015e276 commit 3abba3a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- 13
- 14
- 15
- 16

steps:
- uses: actions/[email protected]
Expand Down
22 changes: 16 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ buildscript {

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.8.1'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:2.0.1'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.9.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0'
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9'
Expand All @@ -66,11 +67,20 @@ subprojects {
task.targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(Test).configureEach {
testLogging {
if (System.getenv("CI") == "true") {
events = ["failed", "skipped", "passed"]
}
exceptionFormat "full"
}
}

apply plugin: 'net.ltgt.errorprone'

dependencies {
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
errorprone 'com.google.errorprone:error_prone_core:2.4.0'
errorprone 'com.google.errorprone:error_prone_core:2.7.1'
}

tasks.withType(JavaCompile).configureEach { task ->
Expand Down Expand Up @@ -103,11 +113,11 @@ subprojects {
}
}

// google-java-format only works on JDK 11 or newer.
if (Jvm.current().javaVersion.isJava11Compatible()) {
// google-java-format only works on JDK 11 to JDK 15 (without wild flags).
if (Jvm.current().javaVersion.isJava11Compatible() && !Jvm.current().javaVersion.isCompatibleWith(JavaVersion.VERSION_16)) {
project.apply plugin: 'com.github.sherter.google-java-format'
googleJavaFormat {
toolVersion = '1.8'
toolVersion = '1.10.0'

// By default, the GJF plugin includes all Java folders inside the project directory. This
// does not work well with nested projects, especially when you want to exclude them.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 3abba3a

Please sign in to comment.