Skip to content

Commit

Permalink
Updates for typetools/checker-framework 3.39.0 release (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Oct 21, 2023
2 parents 64bc44d + 8286f8c commit ca0f076
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

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

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cache:
- $HOME/.m2/

jdk:
- oraclejdk8
- oraclejdk17

script: ./gradlew build javadoc check

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Add to your shell startup file, such as `~/.profile`:
alias mvc='java -ea -cp SOME_DIRECTORY/multi-version-control/build/libs/multi-version-control-all.jar org.plumelib.multiversioncontrol.MultiVersionControl'
```

## Other scripts for managing multiple git clones
## Other scripts for managing multiple git clones and branches

See the scripts in [manage-git-clones](https://github.com/plume-lib/manage-git-clones).
See the scripts in [manage-git-branches](https://github.com/plume-lib/manage-git-branches).
35 changes: 16 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ plugins {

// Code formatting; defines targets "spotlessApply" and "spotlessCheck"
// Requires JDK 11 or higher; the plugin crashes under JDK 8.
id 'com.diffplug.spotless' version '6.20.0'
id 'com.diffplug.spotless' version '6.22.0'

// Error Prone linter
id('net.ltgt.errorprone') version '3.1.0'

// Checker Framework pluggable type-checking
id 'org.checkerframework' version '0.6.29'
id 'org.checkerframework' version '0.6.34'
}

repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

ext {
isJava21orHigher = JavaVersion.current() >= JavaVersion.VERSION_21
}

dependencies {
implementation 'org.apache.commons:commons-exec:1.3'
implementation 'org.ini4j:ini4j:0.5.4'
Expand All @@ -33,13 +37,8 @@ application {
mainClass = 'org.plumelib.multiversioncontrol.MultiVersionControl'
}

if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_20) < 0) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
} else {
sourceCompatibility = 11
targetCompatibility = 11
}
sourceCompatibility = 11
targetCompatibility = 11


spotless {
Expand Down Expand Up @@ -69,18 +68,20 @@ spotless {
/// Error Prone linter

dependencies {
errorprone('com.google.errorprone:error_prone_core:2.20.0')
errorprone('com.google.errorprone:error_prone_core:2.23.0')
}
tasks.withType(JavaCompile).configureEach {
// "-processing" avoids javac warning "No processor claimed any of these annotations".
// "-options" is because starting in JDK 20, javac warns about using -source 8.
options.compilerArgs << '-Xlint:all,-processing,-options' << '-Werror'
if (isJava21orHigher) {
options.compilerArgs << '-Xlint:-this-escape,-options'
}
options.errorprone {
enabled = JavaVersion.current() != JavaVersion.VERSION_1_8
disable('ReferenceEquality') // Use Interning Checker instead.
}
options.forkOptions.jvmArgs += '-Xmx2g'
options.release = 8
options.release = 11
}

/// Checker Framework pluggable type-checking
Expand Down Expand Up @@ -122,7 +123,7 @@ checkerFramework {
// To use a snapshot version of the Checker Framework.
if (false) {
// TODO: change the above test to false when CF is released
ext.checkerFrameworkVersion = '3.37.0-eisop-SNAPSHOT'
ext.checkerFrameworkVersion = '3.39.0-eisop-SNAPSHOT'
dependencies {
compileOnly "io.github.eisop:checker-qual:${checkerFrameworkVersion}"
testCompileOnly "io.github.eisop:checker-qual:${checkerFrameworkVersion}"
Expand All @@ -148,9 +149,7 @@ if (project.hasProperty('cfLocal')) {
javadoc {
options.addStringOption('Xwerror', '-Xdoclint:all')
options.addStringOption('private', '-quiet')
if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) {
options.addStringOption('source', '8')
}
options.addStringOption('source', '11')
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
Expand All @@ -165,9 +164,7 @@ task javadocWeb(type: Javadoc) {
source = sourceSets.main.allJava
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('source', '8')
}
options.addStringOption('source', '11')
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
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,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2013,8 +2013,7 @@ int perform_command(ProcessBuilder pb, List<Replacer> replacers, boolean showNor
// Filter then print the output.
String output;
try {
@SuppressWarnings("DefaultCharset") // JDK 8 version does not accept UTF_8 argument
String tmpOutput = outStream.toString();
String tmpOutput = outStream.toString(UTF_8);
output = tmpOutput;
} catch (RuntimeException e) {
throw new Error("Exception getting process standard output");
Expand Down

0 comments on commit ca0f076

Please sign in to comment.