Skip to content

Commit

Permalink
Test Java 16 and 17 (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored Dec 4, 2021
1 parent 592a899 commit ab66555
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 116 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gradlew linguist-generated=true
gradlew.bat linguist-generated=true
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
- "13"
- "14"
- "15"
- "16"
- "17"

steps:
- uses: actions/checkout@master
Expand All @@ -41,6 +43,10 @@ jobs:
java-version: ${{ matrix.java-version }}
architecture: x64

- name: Tweak gradle.properties for Java 1.8
if: ${{ matrix.java-version == '1.8' }}
run: sed -e '/--add-exports/ s/^#*/#/' -i gradle.properties

- name: Display version
run: ./gradlew --version

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add this dependency to your project's POM:
You'll need to manually install the following JARs:

- The Stripe JAR from <https://github.com/stripe/stripe-java/releases/latest>
- [Google Gson][gson] from <https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.8/gson-2.8.8.jar>.
- [Google Gson][gson] from <https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar>.

### [ProGuard][proguard]

Expand Down
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ plugins {
id "maven-publish"
id "signing"
id "jacoco"
id "io.freefair.lombok" version "6.1.0"
id "com.diffplug.spotless" version "5.15.0"
id "io.freefair.lombok" version "6.3.0"
id "com.diffplug.spotless" version "6.0.1"
id "net.ltgt.errorprone" version "2.0.2"
id "com.github.kt3k.coveralls" version "2.12.0"
id "biz.aQute.bnd.builder" version "5.3.0"
id "biz.aQute.bnd.builder" version "6.1.0"
id "org.ajoberstar.git-publish" version "3.0.0"
}

Expand Down Expand Up @@ -61,14 +61,14 @@ repositories {
}

dependencies {
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.9.0"
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.10.0"
errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
implementation group: "com.google.code.gson", name: "gson", version:"2.8.8"
testImplementation group: "com.google.guava", name: "guava", version:"30.1.1-jre"
implementation group: "com.google.code.gson", name: "gson", version:"2.8.9"
testImplementation group: "com.google.guava", name: "guava", version:"31.0.1-jre"
testImplementation group: "com.squareup.okhttp3", name: "mockwebserver", version: "4.9.1"
testImplementation group: "org.mockito", name: "mockito-core", version:"3.12.4"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.7.2"
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.7.2"
testImplementation group: "org.mockito", name: "mockito-core", version:"4.1.0"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.8.2"
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.8.2"
testRuntimeOnly group: "org.slf4j", name: "slf4j-api", version: "1.7.32"
}

Expand All @@ -85,7 +85,7 @@ jar {
}

lombok {
version = "1.18.20"
version = "1.18.22"
}

delombok {
Expand Down
10 changes: 10 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ VENDOR_NAME=Stripe, Inc. (https://stripe.com)
# Workaround to prevent Java 12 to try and use TLSv1.3 when uploading coverage
# reports to coveralls.io.
systemProp.jdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"

# The following is necessary for google-java-format to work with Java 16+
# Cf. https://github.com/google/google-java-format#jdk-16.
# Note that these arguments do NOT work with Java 1.8, so this needs to be
# commented out in that case.
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ab66555

Please sign in to comment.