Skip to content

Commit

Permalink
Updates for typetools/checker-framework 3.39.0 release (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Oct 21, 2023
2 parents fa53739 + 039b7f8 commit d1f936b
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 335 deletions.
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":automergeAll",
":automergeRequireAllStatusChecks",
"schedule:nonOfficeHours",
":disableDependencyDashboard"
],
"timezone": "America/Los_Angeles"
}
9 changes: 6 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ jobs:

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: ./gradlew build javadoc
run: ./gradlew build
- name: ./gradlew requireJavadoc
run: ./gradlew requireJavadoc
- name: ./gradlew spotlessCheck
run: ./gradlew spotlessCheck
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

# Add "verGJF" task when google-java-format handles type annotations better;
# see https://github.com/google/google-java-format/issues/5
Expand Down
100 changes: 49 additions & 51 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,80 @@ plugins {
id 'java'
id 'application'

// To create a fat jar build/libs/bibtex-clean-all.jar, run: ./gradlew shadowJar
id 'com.github.johnrengelman.shadow' version '7.1.2'
// To create a fat jar build/libs/...-all.jar, run: ./gradlew shadowJar
id 'com.github.johnrengelman.shadow' version '8.1.1'

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

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

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

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation 'org.plumelib:plume-util:1.6.0'
implementation 'org.plumelib:plume-util:1.8.1'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

application {
mainClass = 'org.plumelib.bibtex.BibtexClean'
}

sourceCompatibility = 11
targetCompatibility = 11

test {
useJUnitPlatform {
includeEngines 'junit-jupiter'
excludeEngines 'junit-vintage'
}
useJUnitPlatform {
includeEngines 'junit-jupiter'
excludeEngines 'junit-vintage'
}
}

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

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
java {
targetExclude("**/WeakIdentityHashMap.java")
targetExclude('**/WeakIdentityHashMap.java')
googleJavaFormat()
formatAnnotations()
}
groovyGradle {
target '**/*.gradle'
greclipse() // which formatter Spotless should use to format .gradle files.
indentWithSpaces(2)
trimTrailingWhitespace()
// endWithNewline() // Don't want to end empty files with a newline
}
}

/// Error Prone linter

dependencies {
errorprone("com.google.errorprone:error_prone_core:2.16")
errorprone('com.google.errorprone:error_prone_core:2.23.0')
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:all" << "-Werror"
// "-processing" avoids javac warning "No processor claimed any of these annotations".
options.compilerArgs << '-Xlint:all,-processing' << '-Werror'
options.errorprone {
enabled = JavaVersion.current() != JavaVersion.VERSION_1_8
disable("ReferenceEquality") // Use Interning Checker instead.
disable('ReferenceEquality') // Use Interning Checker instead.
}
}

Expand All @@ -75,9 +84,9 @@ tasks.withType(JavaCompile).configureEach {
apply plugin: 'org.checkerframework'

dependencies {
compileOnly 'io.github.eisop:checker-qual:3.28.0-eisop1'
testCompileOnly 'io.github.eisop:checker-qual:3.28.0-eisop1'
checkerFramework 'io.github.eisop:checker:3.28.0-eisop1'
compileOnly 'io.github.eisop:checker-qual:3.34.0-eisop1'
testCompileOnly 'io.github.eisop:checker-qual:3.34.0-eisop1'
checkerFramework 'io.github.eisop:checker:3.34.0-eisop1'
}

checkerFramework {
Expand All @@ -99,18 +108,19 @@ checkerFramework {
'-Werror',
'-AcheckPurityAnnotations',
'-ArequirePrefixInWarningSuppressions',
'-AwarnRedundantAnnotations',
'-AwarnUnneededSuppressions',
'-AnoJreVersionCheck',
]
}

// To use a locally-built Checker Framework, run gradle with "-PcfLocal".
if (project.hasProperty("cfLocal")) {
def cfHome = String.valueOf(System.getenv("CHECKERFRAMEWORK"))
if (project.hasProperty('cfLocal')) {
def cfHome = String.valueOf(System.getenv('CHECKERFRAMEWORK'))
dependencies {
compileOnly files(cfHome + "/checker/dist/checker-qual.jar")
testCompileOnly files(cfHome + "/checker/dist/checker-qual.jar")
checkerFramework files(cfHome + "/checker/dist/checker.jar")
compileOnly files(cfHome + '/checker/dist/checker-qual.jar')
testCompileOnly files(cfHome + '/checker/dist/checker-qual.jar')
checkerFramework files(cfHome + '/checker/dist/checker.jar')
}
}

Expand All @@ -120,15 +130,11 @@ 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 {
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)
}
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
Expand All @@ -138,28 +144,20 @@ configurations {
requireJavadoc
}
dependencies {
requireJavadoc "org.plumelib:require-javadoc:1.0.6"
requireJavadoc 'org.plumelib:require-javadoc:1.0.6'
}
task requireJavadoc(type: JavaExec) {
description = 'Ensures that Javadoc documentation exists.'
mainClass = "org.plumelib.javadoc.RequireJavadoc"
mainClass = 'org.plumelib.javadoc.RequireJavadoc'
classpath = configurations.requireJavadoc
args "src/main/java"
args 'src/main/java'
}
check.dependsOn requireJavadoc

// Run by `gradle check`, which is run by `gradle build`
apply plugin: 'checkstyle'
checkstyle {
toolVersion = "8.11"
ignoreFailures = false
// configFile = file("${project.rootDir}/checkstyle.xml")
}

/// Emacs support

/* Make Emacs TAGS table */
task tags(type: Exec) {
description "Run etags to create an Emacs TAGS table"
commandLine "bash", "-c", "find src/ -name '*.java' | sort | xargs etags"
description 'Run etags to create an Emacs TAGS table'
commandLine 'bash', '-c', "find src/ -name '*.java' | sort | xargs etags"
}
Loading

0 comments on commit d1f936b

Please sign in to comment.