Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into typetools-3.39.0-fixes
  • Loading branch information
wmdietl committed Oct 20, 2023
2 parents 10b912f + b0cacf6 commit 7a2d302
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 62 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', '20' ]

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
86 changes: 50 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,81 @@ plugins {
id 'java'
id 'application'

// To create a fat jar build/libs/html-pretty-print-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 {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
implementation 'xom:xom:1.3.9'

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

// https://mvnrepository.com/artifact/org.ccil.cowan.tagsoup/tagsoup
implementation group: 'org.ccil.cowan.tagsoup', name: 'tagsoup', version: '1.2.1'

// https://mvnrepository.com/artifact/xom/xom
implementation group: 'xom', name: 'xom', version: '1.3.8'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

application {
mainClass = 'org.plumelib.htmlprettyprint.HtmlPrettyPrint'
}

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 Down Expand Up @@ -103,18 +109,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 @@ -124,27 +131,34 @@ if (project.hasProperty("cfLocal")) {
javadoc {
options.addStringOption('Xwerror', '-Xdoclint:all')
options.addStringOption('private', '-quiet')
options.addStringOption('source', '11')
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
check.dependsOn javadoc

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

/// 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,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.4-20230909005132+0000-bin.zip
networkTimeout=10000
validateDistributionUrl=true
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 @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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"'
# 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 @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
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=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=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +198,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
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 = 'html-pretty-print'

0 comments on commit 7a2d302

Please sign in to comment.