Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Dec 8, 2022
2 parents 304b364 + db0db92 commit 8e25638
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
java: [ '8', '11', '17' ]
java: [ '8', '11', '17', '19' ]

steps:
- uses: actions/checkout@v2
Expand Down
58 changes: 41 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ plugins {
// To create a fat jar build/libs/multi-version-control-all.jar, run: ./gradlew shadowJar
id 'com.github.johnrengelman.shadow' version '7.1.2'

// Code formatting; defines targets "spotlessApply" and "spotlessCheck"
id "com.diffplug.spotless" version "6.12.0"

// Error Prone linter
id("net.ltgt.errorprone") version "2.0.2"
id("net.ltgt.errorprone") version "3.0.1"

// Checker Framework pluggable type-checking
id 'org.checkerframework' version '0.6.7'
id 'org.checkerframework' version '0.6.20'
}

repositories {
Expand All @@ -18,18 +21,18 @@ repositories {

dependencies {
// https://mvnrepository.com/artifact/org.tmatesoft.svnkit/svnkit
implementation group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.10.3'
implementation group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.10.9'

// https://mvnrepository.com/artifact/org.ini4j/ini4j
implementation group: 'org.ini4j', name: 'ini4j', version: '0.5.4'

implementation 'org.apache.commons:commons-exec:1.3'
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
implementation 'org.plumelib:options:1.0.5'
implementation 'org.plumelib:options:1.0.6'
} else {
implementation 'org.plumelib:options:2.0.0'
implementation 'org.plumelib:options:2.0.3'
}
implementation 'org.plumelib:plume-util:1.5.8'
implementation 'org.plumelib:plume-util:1.6.0'
}

application {
Expand All @@ -39,16 +42,33 @@ application {
sourceCompatibility = 1.8
targetCompatibility = 1.8


spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
java {
targetExclude("**/WeakIdentityHashMap.java")
googleJavaFormat()
formatAnnotations()
}
}

/// Error Prone linter

dependencies {
errorprone("com.google.errorprone:error_prone_core:2.10.0")
// JDK 8 support for Error Prone:
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
errorprone("com.google.errorprone:error_prone_core:2.16")
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:all,-processing" << "-Werror"
options.errorprone {
enabled = JavaVersion.current() != JavaVersion.VERSION_1_8
disable("ReferenceEquality") // Use Interning Checker instead.
}
}
Expand All @@ -59,11 +79,15 @@ apply plugin: 'org.checkerframework'

checkerFramework {
checkers = [
// No need to run CalledMethodsChecker, because ResourceLeakChecker does so.
// 'org.checkerframework.checker.calledmethods.CalledMethodsChecker',
'org.checkerframework.checker.index.IndexChecker',
'org.checkerframework.checker.lock.LockChecker',
'org.checkerframework.checker.nullness.NullnessChecker',
'org.checkerframework.checker.regex.RegexChecker',
'org.checkerframework.common.initializedfields.InitializedFieldsChecker'
'org.checkerframework.checker.resourceleak.ResourceLeakChecker',
'org.checkerframework.checker.signedness.SignednessChecker',
'org.checkerframework.common.initializedfields.InitializedFieldsChecker',
]
extraJavacArgs = [
'-Werror',
Expand Down Expand Up @@ -91,13 +115,13 @@ javadoc {
options.addStringOption('Xwerror', '-Xdoclint:all')
options.addStringOption('private', '-quiet')
if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) {
options.addStringOption("-release", "8");
options.addStringOption('source', '8')
}
doLast {
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
Expand All @@ -110,13 +134,13 @@ task javadocWeb(type: Javadoc) {
destinationDir = file("/cse/web/research/plumelib/${project.name}/api")
classpath = project.sourceSets.main.compileClasspath
if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) {
options.addStringOption("-release", "8");
options.addStringOption('source', '8')
}
doLast {
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
Expand All @@ -126,7 +150,7 @@ configurations {
requireJavadoc
}
dependencies {
requireJavadoc "org.plumelib:require-javadoc:1.0.2"
requireJavadoc "org.plumelib:require-javadoc:1.0.6"
}
task requireJavadoc(type: JavaExec) {
description = 'Ensures that Javadoc documentation exists.'
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-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -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 execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Loading

0 comments on commit 8e25638

Please sign in to comment.