Skip to content

Commit

Permalink
Update from upstream (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Dec 27, 2024
2 parents a061d2e + 85b4cde commit 00e8066
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 48 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: [ '11', '17', '21' ]
java: [ '11', '17', '21', '23' ]

steps:
- uses: actions/checkout@v4
Expand Down
32 changes: 18 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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'
id 'com.gradleup.shadow' version '8.3.5'

// Error Prone linter
id('net.ltgt.errorprone') version '4.1.0'
Expand All @@ -24,13 +24,14 @@ plugins {

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

ext.errorproneVersion = '2.31.0'

ext {
errorproneVersion = '2.36.0'
isJava11orHigher = JavaVersion.current() >= JavaVersion.VERSION_11
isJava17orHigher = JavaVersion.current() >= JavaVersion.VERSION_17
isJava21orHigher = JavaVersion.current() >= JavaVersion.VERSION_21
}

dependencies {
Expand All @@ -39,9 +40,6 @@ dependencies {
implementation 'org.apache.commons:commons-text:1.13.0'
implementation 'org.plumelib:reflection-util:1.1.4'

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

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
Expand Down Expand Up @@ -94,7 +92,12 @@ if (isJava11orHigher) {
}
}

/// Error Prone linter
// Error Prone linter

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

tasks.withType(JavaCompile).configureEach {
// "-processing" avoids javac warning "No processor claimed any of these annotations".
Expand All @@ -108,15 +111,16 @@ tasks.withType(JavaCompile).configureEach {
disable('AnnotateFormatMethod') // Error Prone doesn't know about Checker Framework @FormatMethod
disable('UseCorrectAssertInTests') // https://github.com/typetools/checker-framework/issues/3345
}
options.errorprone.enabled = isJava17orHigher
}

/// Checker Framework pluggable type-checking
// Checker Framework pluggable type-checking

apply plugin: 'org.checkerframework'

if (true) {
// Use the released version of the EISOP Checker Framework.
ext.checkerFrameworkVersion = '3.42.0-eisop3'
ext.checkerFrameworkVersion = '3.42.0-eisop5'
} else {
// To use a snapshot version of the EISOP Checker Framework.
// TODO: Change the above test to false to use a snapshot.
Expand Down Expand Up @@ -168,7 +172,7 @@ checkerFramework {
]
}

/// Javadoc
// Javadoc

// Turn Javadoc warnings into errors.
javadoc {
Expand All @@ -186,7 +190,7 @@ javadoc {
check.dependsOn javadoc

task javadocWeb(type: Javadoc) {
description 'Upload API documentation to website.'
description = 'Upload API documentation to website.'
source = sourceSets.main.allJava
destinationDir = file("/cse/web/research/plumelib/${project.name}/api")
classpath = project.sourceSets.main.compileClasspath
Expand Down Expand Up @@ -225,10 +229,10 @@ task requireJavadoc(type: JavaExec) {
check.dependsOn requireJavadoc
javadocWeb.dependsOn requireJavadoc

/// Emacs support
// Emacs support

/* Make Emacs TAGS table */
task tags(type: Exec) {
description 'Run etags to create an Emacs TAGS table'
description = 'Run etags to create an Emacs TAGS table'
commandLine 'bash', '-c', "find src/ -name '*.java' | sort | xargs etags"
}
25 changes: 14 additions & 11 deletions gradle/mavencentral.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// REQUIREMENTS to make a release:
// * Your ~/.gradle/gradle.properties file must contain:
// ossrhUsername=YOUR_USER_NAME_HERE
// ossrhPassword=YOUR_PASSWORD_HERE
// SONATYPE_NEXUS_USERNAME=...
// SONATYPE_NEXUS_PASSWORD=...

// To make a release (run on any filesystem, except the last step):
// To make a release (run on any filesystem, except the `javadocWeb` step):
// * git pull
// * In ../build.gradle, ensure that "To use a snapshot version" is not enabled.
// * Update the version number in ../README.md and in this file (multiple times in each).
Expand All @@ -20,8 +20,11 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

group 'org.plumelib'
version '2.0.3'
group = 'org.plumelib'
version = '2.0.3'
ext {
packageName = 'options'
}

final isSnapshot = version.contains('SNAPSHOT')

Expand All @@ -41,12 +44,12 @@ publishing {
pom {
name = 'Plume-lib Options'
description = 'Command-line option processing for Java.'
url = 'https://github.com/plume-lib/options'
url = "https://github.com/plume-lib/${packageName}"

scm {
connection = 'scm:git:git@github.com:plume-lib/options.git'
developerConnection = 'scm:git:git@github.com:plume-lib/options.git'
url = 'git@github.com:plume-lib/options.git'
connection = "scm:git:git@github.com:plume-lib/${packageName}.git"
developerConnection = "scm:git:git@github.com:plume-lib/${packageName}.git"
url = "git@github.com:plume-lib/${packageName}.git"
}

licenses {
Expand Down Expand Up @@ -74,8 +77,8 @@ publishing {
: project.properties.getOrDefault('RELEASE_REPOSITORY_URL', 'https://oss.sonatype.org/service/local/staging/deploy/maven2/')
)
credentials {
username = project.properties.get('ossrhUsername')
password = project.properties.get('ossrhPassword')
username = project.properties.get('SONATYPE_NEXUS_USERNAME')
password = project.properties.get('SONATYPE_NEXUS_PASSWORD')
}
}
}
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.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/plumelib/options/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class OptionInfo {

/**
* Long argument name. Uses '-' or '_' to separate words, depending on the value of {@link
* useDashes}.
* #useDashes}.
*/
String longName;

Expand Down
36 changes: 18 additions & 18 deletions src/main/java/org/plumelib/options/OptionsDoclet.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ public OptionsDoclet() {
// this.options = options;
}

///////////////////////////////////////////////////////////////////////////
/// Doclet-specific methods
///
// //////////////////////////////////////////////////////////////////////
// Doclet-specific methods
//

@Override
public void init(Locale locale, Reporter reporter) {
Expand Down Expand Up @@ -338,9 +338,9 @@ public boolean run(DocletEnvironment denv) {
return OK;
}

///////////////////////////////////////////////////////////////////////////
/// Javadoc command-line options
///
// //////////////////////////////////////////////////////////////////////
// Javadoc command-line options
//

// The doclet cannot use the Options class itself because Javadoc specifies its own way of
// handling command-line arguments.
Expand Down Expand Up @@ -588,9 +588,9 @@ private void printError(String msg) {
reporter.print(Diagnostic.Kind.ERROR, msg);
}

///////////////////////////////////////////////////////////////////////////
/// File IO methods
///
// //////////////////////////////////////////////////////////////////////
// File IO methods
//

/**
* Write the output of this doclet to the correct file.
Expand Down Expand Up @@ -685,9 +685,9 @@ private String newDocFileText() throws Exception {
return b.toString();
}

///////////////////////////////////////////////////////////////////////////
/// HTML and Javadoc processing methods
///
// //////////////////////////////////////////////////////////////////////
// HTML and Javadoc processing methods
//

/**
* Returns the fields defined by the given type.
Expand Down Expand Up @@ -1143,9 +1143,9 @@ public Void visitSee(SeeTree node, StringBuilder sb) {

}

///////////////////////////////////////////////////////////////////////////
/// Signature string methods
///
// //////////////////////////////////////////////////////////////////////
// Signature string methods
//

/**
* Returns true if the given element kind is a type, i.e., a class, enum, interface, or annotation
Expand Down Expand Up @@ -1190,9 +1190,9 @@ public static boolean isTypeElement(Element element) {
}
}

///////////////////////////////////////////////////////////////////////////
/// Getters and Setters
///
// //////////////////////////////////////////////////////////////////////
// Getters and Setters
//

/**
* Returns true if the output format is Javadoc, false if the output format is HTML.
Expand Down

0 comments on commit 00e8066

Please sign in to comment.