Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/eisop/annotation-tools in…
Browse files Browse the repository at this point in the history
…to eisop-3.28.0-eisop1
  • Loading branch information
wmdietl committed Dec 9, 2022
2 parents 0257716 + b1bab0e commit fdd5322
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 58 deletions.
9 changes: 6 additions & 3 deletions .build-without-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ export AFU="${AFU:-$(cd annotation-file-utilities && pwd -P)}"

export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH

## Download Gradle itself if necessary (retry in case of network lossage).
(cd "${AFU}" && TERM=dumb timeout 300 ./gradlew help </dev/null >/dev/null 2>&1 || TERM=dumb ./gradlew help </dev/null >/dev/null 2>&1 || ./gradlew help)
## Download Gradle and its dependencies (retry in case of network lossage).
(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 1m && ./gradlew --write-verification-metadata sha256 help --dry-run))

## Compile
(cd "${AFU}" && (./gradlew assemble || (sleep 1m && ./gradlew assemble)))
(cd "${AFU}" && ./gradlew assemble)

echo Exiting "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" in "$(pwd)"
4 changes: 3 additions & 1 deletion .build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
# Uses `bash` rather than `sh` because of use of [[ ... ]] for boolean tests.

echo "Entering $(cd "$(dirname "$0")" && pwd -P)/$(basename "$0") in $(pwd)"

# Optional argument $1 is one of:
# all, test, typecheck, misc, downstream
# It defaults to "all".
export GROUP=$1
export GROUP="$1"
if [[ "${GROUP}" == "" ]]; then
export GROUP=all
fi
Expand Down Expand Up @@ -70,6 +71,7 @@ if [[ "${GROUP}" == "downstream" || "${GROUP}" == "all" ]]; then
# checker-framework and its downstream tests
# NO-AFU
# /tmp/plume-scripts/git-clone-related eisop checker-framework
# (cd ../checker-framework/framework && (../gradlew --write-verification-metadata sha256 help --dry-run || (sleep 60 && ../gradlew --write-verification-metadata sha256 help --dry-run)))
# (cd ../checker-framework/framework && ../gradlew ainferTest)

# /tmp/plume-scripts/git-clone-related eisop checker-framework-inference
Expand Down
4 changes: 2 additions & 2 deletions annotation-file-utilities/annotation-file-utilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ <h2 id="installation">Installation</h2>

<p>
The current release is Annotation File Utilities version
<!-- afu-version -->3.27.0-eisop1, 06 Nov 2022<!-- /afu-version -->.
<!-- afu-version -->3.28.0-eisop1, 07 Dec 2022<!-- /afu-version -->.
</p>

<ol>
<!-- TODO: The release scripts only update the text of the link, not the href URL! -->
<li>
Download
<a href="annotation-tools-3.23.0.zip"><!-- annotation-tools-zip-version -->annotation-tools-3.27.0-eisop1.zip<!-- /annotation-tools-zip-version --></a>.
<a href="annotation-tools-3.23.0.zip"><!-- annotation-tools-zip-version -->annotation-tools-3.28.0-eisop1.zip<!-- /annotation-tools-zip-version --></a>.
</li>

<li>
Expand Down
32 changes: 18 additions & 14 deletions annotation-file-utilities/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ plugins {
id 'com.dorongold.task-tree' version '2.1.0'

// Code formatting; defines targets "spotlessApply" and "spotlessCheck"
id 'com.diffplug.spotless' version '6.11.0'
id 'com.diffplug.spotless' version '6.12.0'
}
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.diffplug.spotless'

group 'io.github.eisop'
version '3.27.0-eisop1'
version '3.28.0-eisop1'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
Expand All @@ -48,7 +49,6 @@ dependencies {
implementation "com.google.errorprone:javac:$errorproneJavacVersion"
errorproneJavac("com.google.errorprone:javac:$errorproneJavacVersion")
}
implementation 'org.plumelib:bcel-util:1.1.16'
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
implementation 'org.plumelib:options:1.0.6'
} else {
Expand All @@ -57,9 +57,8 @@ dependencies {
implementation 'org.plumelib:plume-util:1.6.0'
implementation 'org.plumelib:reflection-util:1.0.5'
// Annotations in checker-qual.jar are used, but no checkers are (currently) run on the code.
compileOnly 'io.github.eisop:checker-qual:3.26.0-eisop1'
compileOnly 'io.github.eisop:checker-qual:3.27.0-eisop1'
ext.errorproneVersion = '2.16'
// TODO: it's a bug that annotatedlib:guava requires the error_prone_annotations dependency.
implementation "com.google.errorprone:error_prone_annotations:${errorproneVersion}"
implementation ('org.checkerframework.annotatedlib:guava:30.1.1-jre') {
// So long as Guava only uses annotations from checker-qual, excluding it should not cause problems.
Expand All @@ -68,7 +67,9 @@ dependencies {
implementation 'org.ow2.asm:asm:9.4'

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'io.github.eisop:checker-qual:3.25.0-eisop1'
testImplementation 'io.github.eisop:checker-qual:3.27.0-eisop1'

implementation "com.google.errorprone:error_prone_annotations:${errorproneVersion}"

errorprone("com.google.errorprone:error_prone_core:${errorproneVersion}")
}
Expand All @@ -95,13 +96,14 @@ compileJava {
options.encoding = 'UTF-8'

options.errorprone.disable(
// Suggests using an ErrorProne-specific annotation.
"InlineMeSuggester",
// Suggestion assumes there is no overriding equals() method.
"NonOverridingEquals",
// Suggestion is incorrect when using the Checker Framework.
"ExtendsObject",
// Suggests using a class that's in Error Prone itself, not in any library for clients.
// It requires "import com.google.errorprone.util.ASTHelpers;", and (in build.gradle)
// implementation "com.google.errorprone:error_prone_core:${errorproneVersion}"
// Adding that line in build.gradle causes a javac crash when running the Checker Framework.
"ASTHelpersSuggestions",
)
}
Expand Down Expand Up @@ -471,13 +473,15 @@ def createCheckTypeTask(checker, shortName) {
options.forkOptions.jvmArgs += ["-Xbootclasspath/p:${configurations.javacJar.asPath}".toString()]
} else {
options.forkOptions.jvmArgs += [
"--add-opens", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-opens", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
]
}
}
Expand Down
18 changes: 18 additions & 0 deletions annotation-file-utilities/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ <h1>Annotation File Utilities Changelog</h1>
</p>

<ul>
<li>
Version 3.28.0-eisop1 (released December 7, 2022):
<ul>
<li>No user-visible changes.</li>
</ul>
</li>
<li>
Version 3.28.0 (released December 1, 2022):
<ul>
<li>No user-visible changes.</li>
</ul>
</li>
<li>
Version 3.27.0-eisop1 (released November 6, 2022):
<ul>
Expand All @@ -24,6 +36,12 @@ <h1>Annotation File Utilities Changelog</h1>
<li>No user-visible changes.</li>
</ul>
</li>
<li>
Version 3.27.0 (released November 1, 2022):
<ul>
<li>No user-visible changes.</li>
</ul>
</li>
<li>
Version 3.26.0-eisop1 (released October 13, 2022):
<ul>
Expand Down
13 changes: 9 additions & 4 deletions annotation-file-utilities/dev-scripts/test-allTests.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/bin/bash
#!/bin/sh

set -e
set -o verbose
set -o xtrace
export SHELLOPTS

if [ "$(uname)" = "Darwin" ] ; then
export JAVA_HOME=${JAVA_HOME:-$(/usr/libexec/java_home)}
export JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home)}"
else
export JAVA_HOME=${JAVA_HOME:-$(dirname $(dirname $(readlink -f $(which javac))))}
export JAVA_HOME="${JAVA_HOME:-$(dirname "$(dirname "$(readlink -f "$(which javac)")")")}"
fi
export AFU="${AFU:-$(cd annotation-file-utilities >/dev/null 2>&1 && pwd -P)}"
export CHECKERFRAMEWORK="${CHECKERFRAMEWORK:-$(cd .. >/dev/null 2>&1 && pwd -P)/checker-framework}"
export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH
export PATH="$AFU/scripts:$JAVA_HOME/bin:$PATH"

(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 60 && ./gradlew --write-verification-metadata sha256 help --dry-run))

(cd "${AFU}" && ./gradlew build)
11 changes: 8 additions & 3 deletions annotation-file-utilities/dev-scripts/test-downstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ set -o xtrace
export SHELLOPTS

if [ "$(uname)" = "Darwin" ] ; then
export JAVA_HOME=${JAVA_HOME:-$(/usr/libexec/java_home)}
export JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home)}"
else
export JAVA_HOME=${JAVA_HOME:-$(dirname "$(dirname "$(readlink -f "$(which javac)")")")}
export JAVA_HOME="${JAVA_HOME:-$(dirname "$(dirname "$(readlink -f "$(which javac)")")")}"
fi
export AFU="${AFU:-$(cd annotation-file-utilities >/dev/null 2>&1 && pwd -P)}"
export CHECKERFRAMEWORK="${CHECKERFRAMEWORK:-$(cd .. >/dev/null 2>&1 && pwd -P)/checker-framework}"
export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH
export PATH="$AFU/scripts:$JAVA_HOME/bin:$PATH"

(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 60 && ./gradlew --write-verification-metadata sha256 help --dry-run))

# NO-AFU
# (cd "${AFU}" && ./gradlew assemble)
Expand Down
5 changes: 5 additions & 0 deletions annotation-file-utilities/dev-scripts/test-misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ else
fi
PLUME_SCRIPTS="/tmp/$USER/plume-scripts"

(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 60 && ./gradlew --write-verification-metadata sha256 help --dry-run))

cd "${AFU}"
./gradlew assemble

Expand Down
5 changes: 5 additions & 0 deletions annotation-file-utilities/dev-scripts/test-typecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export AFU="${AFU:-$(cd annotation-file-utilities >/dev/null 2>&1 && pwd -P)}"
export CHECKERFRAMEWORK="${CHECKERFRAMEWORK:-$(cd .. >/dev/null 2>&1 && pwd -P)/checker-framework}"
export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH

(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 60 && ./gradlew --write-verification-metadata sha256 help --dry-run))

(cd "${AFU}" && ./gradlew assemble)

if [ -d "/tmp/$USER/plume-scripts" ] ; then
Expand Down
Binary file modified annotation-file-utilities/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions annotation-file-utilities/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions annotation-file-utilities/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ public Source(String src) throws CompilerException, IOException {
fileManager.getJavaFileObjectsFromStrings(Collections.singletonList(src));

// Compiler options.
// -Xlint:-options is a hack to get around Jenkins build problem:
// "target value 1.8 is obsolete and will be removed in a future release"
final String[] stringOpts =
new String[] {"-g", "-Xlint:-options", "-source", "8", "-target", "8"};
final String[] stringOpts = new String[] {"-g"};
List<String> optsList = Arrays.asList(stringOpts);

// Create a task.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.checkerframework.afu.annotator.find;

import com.google.errorprone.annotations.InlineMe;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -477,7 +478,16 @@ public static final Criterion atLocation(TypePath loc) {
return new GenericArrayLocationCriterion(loc);
}

/**
* Creates a GenericArrayLocationCriterion for a field.
*
* @param varName location of the field
* @return a GenericArrayLocationCriterion for the given field
*/
@Deprecated
@InlineMe(
replacement = "new FieldCriterion(varName)",
imports = "org.checkerframework.afu.annotator.find.FieldCriterion")
public static final Criterion field(String varName) {
return new FieldCriterion(varName);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.checkerframework.afu.scenelib.util;

import com.google.errorprone.annotations.InlineMe;
import com.sun.source.tree.ArrayTypeTree;
import com.sun.source.tree.MethodTree;
import com.sun.source.tree.Tree;
Expand Down Expand Up @@ -28,6 +29,9 @@ public class JVMNames {
* @deprecated use {@link #getJVMMethodSignature(MethodTree)}
*/
@Deprecated // use getJVMMethodSignature(MethodTree)
@InlineMe(
replacement = "JVMNames.getJVMMethodSignature(methodTree)",
imports = "org.checkerframework.afu.scenelib.util.JVMNames")
public static String getJVMMethodName(MethodTree methodTree) {
return getJVMMethodSignature(methodTree);
}
Expand Down Expand Up @@ -82,6 +86,9 @@ public static String getJVMMethodSignature(MethodTree methodTree) {
* @deprecated use {@link #getJVMMethodSignature(ExecutableElement)}
*/
@Deprecated // use getJVMMethodSignature(ExecutableElement)
@InlineMe(
replacement = "JVMNames.getJVMMethodSignature(methodElement)",
imports = "org.checkerframework.afu.scenelib.util.JVMNames")
public static String getJVMMethodName(ExecutableElement methodElement) {
return getJVMMethodSignature(methodElement);
}
Expand Down
3 changes: 0 additions & 3 deletions annotation-file-utilities/tests/ad-hoc/bridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ export JAVA:=$(JAVA) -Xbootclasspath/p:../../../lib/javac-9+181-r4173-1.jar
endif

JAVACVERSION = $(shell $(JAVAC) -version 2>&1)
ifeq (1.7.,$(findstring 1.7.,$(JAVACVERSION)))
JAVACTARGET = -source 7 -target 7
endif

.PHONY: bridge
# Counting bridge methods, there should be 3 @A annotations.
Expand Down
Loading

0 comments on commit fdd5322

Please sign in to comment.