Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream 2024-06-24 #95

Merged
merged 47 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b620c8f
Update plugin org.checkerframework to v0.6.35 (#253)
renovate[bot] Nov 3, 2023
d9c50d7
Update dependency org.junit.jupiter:junit-jupiter-api to v5.10.1 (#254)
renovate[bot] Nov 5, 2023
aefc209
Update plugin com.diffplug.spotless to v6.23.0 (#255)
renovate[bot] Nov 27, 2023
4254333
Update plugin com.diffplug.spotless to v6.23.2 (#256)
renovate[bot] Nov 30, 2023
79c91fd
Update actions/setup-java action to v4 (#257)
renovate[bot] Nov 30, 2023
595eead
Update plugin com.diffplug.spotless to v6.23.3 (#258)
renovate[bot] Dec 4, 2023
37b63e9
Update plugin org.checkerframework to v0.6.36 (#259)
renovate[bot] Dec 5, 2023
46c6821
Update dependency org.plumelib:reflection-util to v1.1.1 (#260)
renovate[bot] Dec 9, 2023
0b0b224
Use gradle 8.5
mernst Dec 11, 2023
1b6d1c0
Update dependency org.plumelib:reflection-util to v1.1.2 (#261)
renovate[bot] Dec 12, 2023
ae0b458
Update plugin org.checkerframework to v0.6.37 (#262)
renovate[bot] Dec 19, 2023
cb264cc
Update dependency com.google.errorprone:error_prone_core to v2.24.0 (…
renovate[bot] Dec 22, 2023
fd85fa7
Update dependency com.google.errorprone:error_prone_core to v2.24.1 (…
renovate[bot] Jan 4, 2024
c716f9c
Update plugin com.diffplug.spotless to v6.24.0 (#265)
renovate[bot] Jan 15, 2024
39d084e
Update dependency org.plumelib:reflection-util to v1.1.3 (#266)
renovate[bot] Jan 16, 2024
339701e
Update plugin com.diffplug.spotless to v6.25.0 (#267)
renovate[bot] Jan 23, 2024
d057bf5
Make checkout more efficient
mernst Jan 27, 2024
e28d635
Update dependency gradle to v8.6 (#268)
renovate[bot] Feb 3, 2024
e9a6ca3
Update dependency org.junit.jupiter:junit-jupiter-api to v5.10.2 (#269)
renovate[bot] Feb 4, 2024
6ac9224
Ignore auto-generated IDE files
mernst Feb 6, 2024
d907063
Update dependency com.google.errorprone:error_prone_core to v2.25.0 (…
renovate[bot] Feb 17, 2024
513f0d1
Update dependency com.google.errorprone:error_prone_core to v2.26.0 (…
renovate[bot] Mar 12, 2024
88b79b0
Update dependency com.google.errorprone:error_prone_core to v2.26.1 (…
renovate[bot] Mar 13, 2024
f6053f7
Update dependency gradle to v8.7 (#273)
renovate[bot] Mar 23, 2024
92756b7
Run CI under JDK 21
mernst Mar 24, 2024
011c3a4
Update Gradle configuration
mernst Mar 26, 2024
680d55e
Update dependency org.plumelib:require-javadoc to v1.0.7 (#275)
renovate[bot] Mar 27, 2024
f6a3d13
Downgrade from Gradle 8.7 to Gradle 8.6
mernst Mar 28, 2024
8734aeb
Update dependency org.plumelib:require-javadoc to v1.0.8 (#276)
renovate[bot] Mar 28, 2024
57227b8
Update dependency org.plumelib:require-javadoc to v1.0.9 (#278)
renovate[bot] Mar 29, 2024
3d93ded
Update plugin com.dorongold.task-tree to v3 (#279)
renovate[bot] Mar 30, 2024
5ab0f39
Use Gradle 8.7
mernst Apr 22, 2024
845ddac
Update errorproneVersion to v2.27.0 (#281)
renovate[bot] Apr 27, 2024
e7a2cf8
Update dependency org.checkerframework:checker to v3.43.0 (#282)
renovate[bot] May 2, 2024
d9b83b2
Update errorproneVersion to v2.27.1 (#283)
renovate[bot] May 2, 2024
92a7d47
Update plugin org.checkerframework to v0.6.39 (#284)
renovate[bot] May 7, 2024
ebdc8e3
Update dependency gradle to v8.8 (#285)
renovate[bot] Jun 1, 2024
2a90bc9
Update errorproneVersion to v2.28.0 (#286)
renovate[bot] Jun 1, 2024
8d08cba
Test under Java 22
mernst Jun 2, 2024
a943d21
Update plugin net.ltgt.errorprone to v4 (#287)
renovate[bot] Jun 2, 2024
7be0558
Update checkerFrameworkVersion to v3.44.0 (#288)
renovate[bot] Jun 4, 2024
e1e3b23
Update plugin org.checkerframework to v0.6.40 (#289)
renovate[bot] Jun 5, 2024
f893e5e
Update plugin com.dorongold.task-tree to v4 (#290)
renovate[bot] Jun 12, 2024
ce0b1eb
Update plugin net.ltgt.errorprone to v4.0.1 (#291)
renovate[bot] Jun 22, 2024
845acaf
Merge branch 'master' of https://github.com/plume-lib/bcel-util into …
wmdietl Jun 25, 2024
a7c9289
Use git-scripts
wmdietl Jun 25, 2024
442e513
Common setup for spotless, error prone, and eisop
wmdietl Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:

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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: false
- name: Set up JDK
uses: actions/setup-java@v4
with:
Expand All @@ -27,4 +30,5 @@ jobs:
- name: ./gradlew requireJavadoc
run: ./gradlew requireJavadoc
- name: ./gradlew spotlessCheck
if: ${{ matrix.java != '8' }}
run: ./gradlew spotlessCheck
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.gradle
gradle.properties

build

*.class

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

Expand All @@ -17,3 +18,7 @@ build

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# IDE files
.idea
.vscode
4 changes: 2 additions & 2 deletions .setup-CF.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export SHELLOPTS

export JAVA_HOME=${JAVA_HOME:-$(dirname $(dirname $(readlink -f $(which javac))))}

git -C /tmp clone --depth 1 -q https://github.com/plume-lib/plume-scripts.git
git -C /tmp clone --depth 1 -q https://github.com/eisop-plume-lib/git-scripts.git

export CHECKERFRAMEWORK="${CHECKERFRAMEWORK:-$(pwd -P)/../checker-framework}"

## Build Checker Framework
/tmp/plume-scripts/git-clone-related eisop checker-framework ${CHECKERFRAMEWORK}
/tmp/git-scripts/git-clone-related eisop checker-framework ${CHECKERFRAMEWORK}

(cd $CHECKERFRAMEWORK && ./gradlew assembleForJavac)

Expand Down
150 changes: 97 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,63 @@
buildscript {
dependencies {
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
// Code formatting; defines targets "spotlessApply" and "spotlessCheck".
// https://github.com/diffplug/spotless/tags ; see tags starting "gradle/"
// Only works on JDK 11+.
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
}
}
}

plugins {
id 'java-library'

// 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"
// Requires JDK 11 or higher; the plugin crashes under JDK 8.
id 'com.diffplug.spotless' version '6.25.0'

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

// Checker Framework pluggable type-checking
id 'org.checkerframework' version '0.6.38'
id 'org.checkerframework' version '0.6.40'

// To show task list as a tree, run: ./gradlew <taskname> taskTree
id 'com.dorongold.task-tree' version '3.0.0'
id 'com.dorongold.task-tree' version '4.0.0'
}

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

ext.errorproneVersion = '2.26.1'
ext.errorproneVersion = '2.28.0'

ext {
isJava11orHigher = JavaVersion.current() >= JavaVersion.VERSION_11
}

dependencies {
api 'org.checkerframework.annotatedlib:bcel:6.5.0'
// For a locally-built commons-bcel, set $BCEL and use this line instead of the above.
// implementation fileTree(dir: "$System.env.BCEL/target", include: 'bcel-6.2.0.2.jar')

// implementation "com.google.errorprone:error_prone_core:${errorproneVersion}" // For @InlineMe.
implementation 'org.plumelib:reflection-util:1.1.3'

compileOnly "com.google.errorprone:error_prone_annotations:${errorproneVersion}"
errorprone("com.google.errorprone:error_prone_core:${errorproneVersion}")

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

// To upload to Maven Central, see instructions in the file.
apply from: "${buildscript.sourceFile.parent}/gradle/mavencentral.gradle"

sourceCompatibility = 11
targetCompatibility = 11
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

test {
useJUnitPlatform {
Expand All @@ -49,40 +66,45 @@ test {
}
}

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

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
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
if (isJava11orHigher) {
apply plugin: 'com.diffplug.spotless'
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.md', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
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:${errorproneVersion}")
}
tasks.withType(JavaCompile).configureEach {
// "-processing" avoids javac warning "No processor claimed any of these annotations".
options.compilerArgs << '-Xlint:all,-processing' << '-Werror'
// "-Xlint:-options" is because of JDK 21 warning "source value 8 is obsolete..."
options.compilerArgs << '-Xlint:all,-processing,-options' << '-Werror'
options.errorprone.enabled = isJava11orHigher
options.errorprone {
disable('ExtendsObject') // Incorrect when using the Checker Framework
disable('ReferenceEquality') // Use Interning Checker instead.
disable('AnnotateFormatMethod') // Error Prone doesn't know about Checker Framework @FormatMethod
// Code copied from BCEL that we don't want to change gratuitously.
excludedPaths = '.*/org/plumelib/bcelutil/StackVer.java'
}
Expand All @@ -92,12 +114,32 @@ tasks.withType(JavaCompile).configureEach {

apply plugin: 'org.checkerframework'

def EISOPVersion = '3.42.0-eisop3'
if (true) {
// Use the released version of the EISOP Checker Framework.
ext.checkerFrameworkVersion = '3.42.0-eisop3'
} else {
// To use a snapshot version of the EISOP Checker Framework.
// TODO: Change the above test to false to use a snapshot.
ext.checkerFrameworkVersion = '3.42.0-eisop4-SNAPSHOT'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'minutes'
}
}

dependencies {
compileOnly "io.github.eisop:checker-qual:${EISOPVersion}"
testCompileOnly "io.github.eisop:checker-qual:${EISOPVersion}"
checkerFramework "io.github.eisop:checker:${EISOPVersion}"
compileOnly "io.github.eisop:checker-qual:${checkerFrameworkVersion}"
testCompileOnly "io.github.eisop:checker-qual:${checkerFrameworkVersion}"
checkerFramework "io.github.eisop:checker:${checkerFrameworkVersion}"
}

// To use a locally-built Checker Framework, run gradle with "-PcfLocal".
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')
}
}

checkerFramework {
Expand All @@ -116,30 +158,24 @@ checkerFramework {
'org.checkerframework.common.initializedfields.InitializedFieldsChecker',
]
extraJavacArgs = [
'-Werror',
// No "'-Werror'" because of JDK 21 warning "source value 8 is obsolete..."
// '-Werror',
'-AcheckPurityAnnotations',
'-ArequirePrefixInWarningSuppressions',
'-AwarnRedundantAnnotations',
'-AwarnUnneededSuppressions',
'-AnoJreVersionCheck',
'-Aversion',
]
}

// To use a locally-built Checker Framework, run gradle with "-PcfLocal".
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')
}
}

/// Javadoc

// Turn Javadoc warnings into errors.
javadoc {
options.addStringOption('Xwerror', '-Xdoclint:all')
// No "'-Werror'" because of JDK 21 warning "source value 8 is obsolete..."
// options.addStringOption('Xwerror', '-Xdoclint:all')
options.addStringOption('Xdoclint:all', '-quiet')
options.addStringOption('private', '-quiet')
exclude 'org/plumelib/bcelutil/StackVer.java'
options.with {
Expand All @@ -157,7 +193,7 @@ javadoc {
// * use JDK 17 links, and "--link-modularity-mismatch info", under JDK > 17 (i.e., JDK >= 18).
// But it's easier to just not use "linksOffline".
}
options.addStringOption('source', '11')
options.addStringOption('source', '8')
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
Expand All @@ -172,12 +208,19 @@ task javadocWeb(type: Javadoc) {
source = sourceSets.main.allJava
destinationDir = file("/cse/web/research/plumelib/${project.name}/api")
classpath = project.sourceSets.main.compileClasspath
options.addStringOption('source', '11')
options.addStringOption('source', '8')
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
// Set permissions
project.exec {
commandLine('chgrp', '-R', 'plse_www', "/cse/web/research/plumelib/${project.name}/api")
}
project.exec {
commandLine('chmod', '-R', 'g+w', "/cse/web/research/plumelib/${project.name}/api")
}
}
}

Expand All @@ -188,6 +231,7 @@ dependencies {
requireJavadoc 'org.plumelib:require-javadoc:1.0.9'
}
task requireJavadoc(type: JavaExec) {
group = 'Documentation'
description = 'Ensures that Javadoc documentation exists.'
mainClass = 'org.plumelib.javadoc.RequireJavadoc'
classpath = configurations.requireJavadoc
Expand Down
2 changes: 1 addition & 1 deletion gradle/mavencentral.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ artifacts {
publishing {
publications {
maven(MavenPublication) {

from components.java

pom {
name = 'BCEL Util'
description = 'Utility functions for BCEL.'
Expand Down
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.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
throw new Error("Use Java 11 or later.")
}
}
// buildscript {
// if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
// throw new Error("Use Java 11 or later.")
// }
// }

// Project name is read-only in build scripts, and defaults to directory name.
rootProject.name = "bcel-util"