Skip to content

Commit

Permalink
Merge commit '62a94149752f6bdaf935f42208ebeac26edaef34' of https://gi…
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Oct 6, 2023
2 parents 5c1b480 + 62a9414 commit 26584d7
Show file tree
Hide file tree
Showing 10 changed files with 235 additions and 176 deletions.
14 changes: 0 additions & 14 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', '19' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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
128 changes: 76 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,85 @@ plugins {
id 'java'
id 'application'

// To create a fat jar build/libs/multi-version-control-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.19.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.27'
}

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

dependencies {
// https://mvnrepository.com/artifact/org.tmatesoft.svnkit/svnkit
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.6'
} else {
implementation 'org.plumelib:options:2.0.3'
}
implementation 'org.plumelib:plume-util:1.6.0'
implementation 'org.ini4j:ini4j:0.5.4'
implementation 'org.plumelib:options:2.0.3'
implementation 'org.plumelib:plume-util:1.7.0'
implementation 'org.tmatesoft.svnkit:svnkit:1.10.11'
}

application {
mainClass = 'org.plumelib.multiversioncontrol.MultiVersionControl'
}

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


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.19.1')
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:all,-processing" << "-Werror"
// "-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'
options.errorprone {
enabled = JavaVersion.current() != JavaVersion.VERSION_1_8
disable("ReferenceEquality") // Use Interning Checker instead.
disable('ReferenceEquality') // Use Interning Checker instead.
}
options.forkOptions.jvmArgs += '-Xmx2g'
options.release = 8
}

/// Checker Framework pluggable type-checking
Expand All @@ -87,30 +97,48 @@ checkerFramework {
checkers = [
// No need to run CalledMethodsChecker, because ResourceLeakChecker does so.
// 'org.checkerframework.checker.calledmethods.CalledMethodsChecker',
'org.checkerframework.checker.formatter.FormatterChecker',
'org.checkerframework.checker.index.IndexChecker',
'org.checkerframework.checker.interning.InterningChecker',
'org.checkerframework.checker.lock.LockChecker',
'org.checkerframework.checker.nullness.NullnessChecker',
'org.checkerframework.checker.regex.RegexChecker',
'org.checkerframework.checker.resourceleak.ResourceLeakChecker',
'org.checkerframework.checker.signature.SignatureChecker',
'org.checkerframework.checker.signedness.SignednessChecker',
'org.checkerframework.common.initializedfields.InitializedFieldsChecker',
]
extraJavacArgs = [
'-Werror',
// '-Aversion',
// '-verbose',
'-AcheckPurityAnnotations',
'-ArequirePrefixInWarningSuppressions',
'-AwarnRedundantAnnotations',
'-AwarnUnneededSuppressions',
'-AnoJreVersionCheck',
]
}

// To use a snapshot version of the Checker Framework.
if (true) {
// TODO: change the above test to false when CF is released
ext.checkerFrameworkVersion = '3.34.1-SNAPSHOT'
dependencies {
compileOnly "org.checkerframework:checker-qual:${checkerFrameworkVersion}"
testCompileOnly "org.checkerframework:checker-qual:${checkerFrameworkVersion}"
checkerFramework "org.checkerframework:checker:${checkerFrameworkVersion}"
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'minutes'
}
}
// 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 @@ -124,30 +152,26 @@ javadoc {
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)
}
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
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
if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) {
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)
}
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
Expand All @@ -156,35 +180,35 @@ 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
javadocWeb.dependsOn requireJavadoc

task updateUserOptions(type: Javadoc, dependsOn: 'assemble') {
description "Updates printed documentation of command-line arguments."
description 'Updates printed documentation of command-line arguments.'
source = sourceSets.main.allJava.files.sort()
classpath = project.sourceSets.main.compileClasspath
options.memberLevel = JavadocMemberLevel.PRIVATE
options.docletpath = project.sourceSets.main.runtimeClasspath as List
options.doclet = "org.plumelib.options.OptionsDoclet"
options.addStringOption("docfile", "${projectDir}/src/main/java/org/plumelib/multiversioncontrol/MultiVersionControl.java")
options.addStringOption("format", "javadoc")
options.addStringOption("i", "-quiet")
options.doclet = 'org.plumelib.options.OptionsDoclet'
options.addStringOption('docfile', "${projectDir}/src/main/java/org/plumelib/multiversioncontrol/MultiVersionControl.java")
options.addStringOption('format', 'javadoc')
options.addStringOption('i', '-quiet')
options.noTimestamp(false)
title = ""
title = ''
}

/// 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"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 12 additions & 7 deletions 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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/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 All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# 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"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -143,12 +140,16 @@ fi
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
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
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
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
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
6 changes: 6 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
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 = 'multi-version-control'
Loading

0 comments on commit 26584d7

Please sign in to comment.