Skip to content

Commit

Permalink
WIP: upgrade Gradle so we can build on JDK 16
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-stripe committed Apr 19, 2021
1 parent 148a5ac commit c0679cd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 29 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- "11.0"
- "12.0"
- "13.0"
- "16.0"

steps:
- uses: actions/checkout@master
Expand Down
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ buildscript {

plugins {
id "java"
id "maven"
id "maven-publish"
id "jacoco"
id "io.freefair.lombok" version "5.2.1"
id "com.diffplug.spotless" version "5.7.0"
id "net.ltgt.errorprone" version "1.3.0"
//id "net.ltgt.errorprone" version "1.3.0"
id "com.github.kt3k.coveralls" version "2.10.2"
id "biz.aQute.bnd.builder" version "5.2.0"
id "org.ajoberstar.git-publish" version "3.0.0"
Expand All @@ -30,7 +30,7 @@ version = VERSION_NAME
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
options.encoding = "UTF-8"

/*
options.errorprone {
// This check causes warnings with autogenerated Javadoc strings.
check("InvalidParam", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
Expand All @@ -45,7 +45,7 @@ tasks.withType(JavaCompile) {
// com.stripe.param.AccountUpdateParams.Individual.Address] within this file.)
// We should fix this by having autogen use the fully-qualified class to eliminate ambiguity.
check("SameNameButDifferent", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
}
}*/
}

compileJava {
Expand All @@ -60,8 +60,8 @@ repositories {
}

dependencies {
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.4.0"
errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
//errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.4.0"
//errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
implementation group: "com.google.code.gson", name: "gson", version:"2.8.6"
testImplementation group: "com.google.guava", name: "guava", version:"30.0-jre"
testImplementation group: "com.squareup.okhttp3", name: "mockwebserver", version: "4.9.0"
Expand All @@ -84,7 +84,7 @@ jar {
}

lombok {
version = "1.18.16"
version = "1.18.20"
config['lombok.addLombokGeneratedAnnotation'] = 'true'
config['lombok.getter.noIsPrefix'] = 'true'
}
Expand All @@ -95,7 +95,7 @@ delombok {
format = [:]
}

apply from: "deploy.gradle"
// apply from: "deploy.gradle"

test {
useJUnitPlatform()
Expand Down
4 changes: 2 additions & 2 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle
*/

apply plugin: "maven"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "io.codearte.nexus-staging"

Expand Down Expand Up @@ -42,7 +42,7 @@ afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
beforeDeployment { deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
Expand Down
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-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
22 changes: 4 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit c0679cd

Please sign in to comment.