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

typetools/checker-framework 3.43.0 release #1079

Merged
merged 173 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
1350e64
Change to typetools formatting
wmdietl Jan 29, 2025
4114375
Prep for next release.
smillst Dec 15, 2023
255c1e2
Fix Issue 6317 (#6372)
msridhar Dec 16, 2023
404a604
Update an RLC regression test (#6375)
msridhar Dec 18, 2023
bec5baa
Implement type argument inference based on the latest JLS (#6138)
smillst Dec 18, 2023
69d52f5
Speed up Spotless formatting (#6383)
msridhar Jan 3, 2024
277b858
`@MustCallAlias` annotation must appear in both return type and param…
jyoo980 Jan 8, 2024
817d09e
Change gradle files to typetools formatting
wmdietl Jan 29, 2025
e7f3731
Add `-AskipDirs` command-line argument (#6385)
jyoo980 Jan 8, 2024
ce88b3f
Update Error Prone version to 2.24.1
smillst Jan 9, 2024
13ea2ad
The latest version of Google Java Format formats Java 21 features. (#…
smillst Jan 10, 2024
f69173b
Switch back to newest version of GJF
wmdietl Jan 30, 2025
c46c127
Tweak exception message. (#6391)
smillst Jan 10, 2024
5311ed3
Update manual entries for the Nullness Checker and Optional Checker (…
jyoo980 Jan 10, 2024
3408d88
Fix problem with the order in which inference variables are resolved
smillst Jan 11, 2024
262abd9
Update dependency com.amazonaws:aws-java-sdk-bom to v1.12.634 (#6384)
renovate[bot] Jan 11, 2024
ae56c5b
Disambiguate legal use of `this` in qualifier expressions (#6395)
jyoo980 Jan 13, 2024
b3b3bce
Update plugin com.diffplug.spotless to v6.24.0 (#6398)
renovate[bot] Jan 15, 2024
d8c4da4
Fix typos
mernst Jan 13, 2024
49714d4
Improve formatting
mernst Jan 16, 2024
85b86c6
Add passing testcase for Issue #6393 (#6394)
smillst Jan 16, 2024
59addbc
Update dependency org.plumelib:reflection-util to v1.1.3 (#6399)
renovate[bot] Jan 17, 2024
20c6a69
When (not) to use the mailing list
mernst Jan 18, 2024
b896aeb
Maven bug might not be fixed yet
mernst Jan 18, 2024
20f496f
Add missing dependencies for copyAndMinimizeAnnotatedJdkFiles task (#…
msridhar Jan 19, 2024
283bebf
Fix Symbol$CompletionFailure crash when building CFG (#6397)
msridhar Jan 19, 2024
5e3b7ad
Refactor `checkPurity()`
mernst Jan 22, 2024
c512653
Reorder sections, add text about `Map.Entry` (#6404)
mernst Jan 22, 2024
f5ff775
Update plugin com.diffplug.spotless to v6.25.0 (#6418)
renovate[bot] Jan 23, 2024
b3373d0
Programmers use WPI rather than `-Ainfer`
mernst Jan 23, 2024
bf7ccf9
Mostly comments about `AnnotationStatistics`
mernst Jan 24, 2024
1ad66bc
Miscellaneous tweaks
mernst Jan 24, 2024
7bc7693
Always rename JavaParser classes in jar files
smillst Jan 24, 2024
1faed4a
Make AnnotatedTypeMirror#toString side-effect free
smillst Jan 24, 2024
a00bc01
Mention JSpecify annotations
PratikBhusal Jan 25, 2024
8002ec8
Don't update org.apache.spark:spark-sql_2.12
mernst Jan 25, 2024
ae4d704
Fix Renovate configuration
mernst Jan 25, 2024
208998a
Fix Renovate configuration
mernst Jan 25, 2024
af01848
Disable parallel tests on CI to address flakiness (#6422)
msridhar Jan 26, 2024
054d9ed
Get `git-clone-related` from git-scripts repository, not plume-scripts
mernst Jan 28, 2024
6878ac8
Add manual section on RLC inference (#6340)
msridhar Jan 28, 2024
2ce4779
Fix spotless rule (#6423)
msridhar Jan 29, 2024
9e94ec6
Annotations for org.apache.logging.log4j.core (no subpackages)
mernst Jan 30, 2024
b348f05
Documentation (#6426)
mernst Jan 30, 2024
c8f056d
Rename one override of `getContracts` to `getContractsOfKind` (#6427)
mernst Jan 30, 2024
03377ab
Don't permit null to be passed to `getContract()` (#6428)
mernst Jan 30, 2024
6232da1
Define `isTop(AnnotationMirror)` (#6431)
mernst Jan 31, 2024
181d56b
Don't permit source to be null
mernst Jan 31, 2024
e06df16
Fix issue 6433 (#6439)
msridhar Feb 5, 2024
deddf76
Update dependency com.amazonaws:aws-java-sdk-bom to v1.12.651 (#6436)
renovate[bot] Feb 5, 2024
830f686
Update dependency gradle to v8.6 (#6440)
renovate[bot] Feb 6, 2024
e64bfd0
Ignore VS Code files
mernst Feb 6, 2024
7c485f8
Rename variable
mernst Feb 6, 2024
a1e2647
Add (passing) test case for Issue 6438 (#6441)
smillst Feb 7, 2024
20a9982
Set classpath when calling `insert-annotations-to-source`
mernst Feb 7, 2024
5a20d27
Clarify changelog
mernst Feb 7, 2024
3015e46
Don't call Optional.isEmpty(), for Java 8 compatibility (#6446)
msridhar Feb 8, 2024
2ded871
Support EISOP formatting
mernst Feb 17, 2024
8d10df8
Use htmlpreview.github.io instead of rawgit.com
mernst Feb 17, 2024
b8d86b3
Shorten indented comments
mernst Feb 17, 2024
ec3c049
Update versions.errorprone to v2.25.0
renovate[bot] Feb 17, 2024
9e53598
Fix typos
mernst Feb 17, 2024
57293c5
Make toString output consistent with NarrowingConversionNode
mernst Feb 17, 2024
cc76b08
`Tree.Kind.PLUS_ASSIGNMENT` never appears in the CFG
mernst Feb 17, 2024
3f35f87
Remove methods that have been deprecated for over two years
mernst Feb 17, 2024
7e5a309
An instance receiver after a static access is not necessarily non-null
mernst Feb 17, 2024
719d539
Documentation improvements
mernst Feb 17, 2024
3eb4343
Rename `AbstractCFGVisualizer.visualizeBlockHelper()` to `visualizeBl…
mernst Feb 17, 2024
0733e1b
Avoid crash when there are no edges to the exceptional exit
mernst Feb 17, 2024
15b661b
Improve punctuation
mernst Feb 18, 2024
73c8c39
Make error message more explicit
mernst Feb 18, 2024
cf61444
Increase timeout
mernst Feb 18, 2024
541f270
Update plugin org.ajoberstar.grgit to v5.2.2
renovate[bot] Feb 18, 2024
d8476de
Fix changelog
mernst Feb 18, 2024
7b828fe
Update manual with example of a compound checker (Signedness)
jyoo980 Feb 23, 2024
c4c3810
Use `CFAbstractStore.replaceValue` in `MustCallTransfer`
jyoo980 Feb 24, 2024
0ba1d2b
Fix typo for word 'everything' in README file
HamedTaghani Feb 26, 2024
e4fca8d
Fix visibility modifiers (#6455)
mernst Feb 26, 2024
7a76c47
Use consistent relocate clause (#6457)
mernst Feb 26, 2024
e3f38d9
Fix rules for switch statement exhaustiveness (#6458)
mernst Feb 26, 2024
a662743
Improve naming and documentation in ObjectCreationNode (#6450)
mernst Feb 26, 2024
7d02301
Update plugin de.undercouch.download to v5.6.0 (#6470)
renovate[bot] Feb 29, 2024
3e95a8a
Update dev manual instructions for Azure CI
jyoo980 Mar 1, 2024
b66aa50
Update dependency com.amazonaws:aws-java-sdk-bom to v1.12.670 (#6472)
renovate[bot] Mar 1, 2024
b783ab4
Rewrite BoundsInitializer
smillst Mar 1, 2024
705f802
Fix incorrect handling of temporary variable enclosing element in RL …
iamsanjaymalakar Mar 4, 2024
77cff11
Add module-info.java to checker-qual (#6326)
mtf90 Mar 6, 2024
5fc9abd
Update dependency io.github.classgraph:classgraph to v4.8.167 (#6476)
renovate[bot] Mar 6, 2024
8eb5784
Update dependency io.github.classgraph:classgraph to v4.8.168 (#6482)
renovate[bot] Mar 8, 2024
9f33427
Refill comment
mernst Mar 10, 2024
eb08297
Purity for methods in `JavaExpression.java`
mernst Mar 10, 2024
ea87d7d
Remove file `SKIP-REQUIRE-JAVADOC`
mernst Mar 10, 2024
2746483
Iterate in a null-safe way
mernst Mar 10, 2024
2d178f2
Better names than `polyScanner` (#6484)
mernst Mar 11, 2024
5d4b614
Rename `BaseTypeVisitor.checkForPolymorphicQualifiers()` to `warnInva…
mernst Mar 11, 2024
6ee7dad
Add `.factorypath` files to `.gitignore`
jyoo980 Mar 11, 2024
5b58ccc
Use Error Prone 2.26.0
mernst Mar 12, 2024
54a2d73
Refactor MustCallAnnotation Retrieval into Central Method in Resource…
iamsanjaymalakar Mar 12, 2024
2dcb612
Move methods from `TreeUtils` methods into nested classes (#6486)
mernst Mar 12, 2024
0c585d7
Fix commit 1a86450a8174b96d94de75ecc603510509eb64f2
mernst Mar 12, 2024
8b97722
Remove file `SKIP-REQUIRE-JAVADOC`
mernst Mar 12, 2024
e2f0ded
Add an option to convert type argument inference crashes into warning…
smillst Mar 12, 2024
aa79504
Fix type argument inference crash (#6491)
smillst Mar 12, 2024
ed03a1f
Use version-specific versions of methods reflectively
mernst Mar 13, 2024
721ec97
Suppress deprecation for removal warning in test (#6498)
mernst Mar 13, 2024
d2addd4
Remove uid fields that shadow fields from a superclass (#6502)
mernst Mar 13, 2024
4656a11
Fix AssertionError in MustCallInference::inferOwningField with @MustC…
iamsanjaymalakar Mar 13, 2024
b276fd9
Update versions.errorprone to v2.26.1 (#6492)
renovate[bot] Mar 14, 2024
88139a7
Add more aliases for nullness annotations
mernst Mar 14, 2024
3dba0d0
Handle zero-argument invocations of methods with polymorphic vararg p…
jyoo980 Mar 14, 2024
e0918aa
Provide a method to extend message key matching (#6495)
mernst Mar 14, 2024
b5372df
Remove workaround for illegal-access warnings (#6497)
mernst Mar 14, 2024
d21178f
Fix stackoverflow from Issue 6421
smillst Mar 14, 2024
7ee53ca
Link Accumulation Checker Javadoc to manual (#6504)
jyoo980 Mar 14, 2024
4cfb9a0
Do not silently ignore catastrophic problem
mernst Mar 15, 2024
39f4c23
Remove duplicated option (#6496)
mernst Mar 18, 2024
581a223
Add alias for Index's Checker's NonNegative annotation with javax.ann…
kelloggm Mar 18, 2024
08a3fb1
Emit error when `@HasQualifierParameter` is not supplied the top qual…
jyoo980 Mar 18, 2024
da1eb7e
Update dependency org.projectlombok:lombok to v1.18.32 (#6509)
renovate[bot] Mar 21, 2024
52ed291
Replace deprecated Gradle APIs (#6451)
mernst Mar 21, 2024
a76a12e
`-AskipFiles` and `-AonlyFiles` command-line options (#6506)
mernst Mar 21, 2024
eefe271
Correct equals method of InferenceType
smillst Mar 28, 2024
f6fb34c
Update dependency commons-io:commons-io to v2.16.0 (#6519)
renovate[bot] Apr 1, 2024
4929238
Fix crash with array constructor method references (#6516)
smillst Apr 2, 2024
0c2df80
Fix crash with additional argument constraints. (#6517)
smillst Apr 2, 2024
56afc3e
Fix crash with void lambdas
smillst Apr 3, 2024
f88caca
Update dependency org.plumelib:require-javadoc to v1.0.9 (#6518)
renovate[bot] Apr 3, 2024
9e23c55
Don't use TreeAnnotator for variable and method declarations
mernst Apr 4, 2024
1a104d7
Fix problem with method reference whose throws clause is a type var
smillst Apr 4, 2024
2e3aff3
Fix problem with wilcard card array elements. (#6522)
smillst Apr 5, 2024
dea9287
Update dependency io.github.classgraph:classgraph to v4.8.170 (#6525)
renovate[bot] Apr 7, 2024
1230a1f
Use Gradle 8.6
mernst Apr 7, 2024
5c93c29
Specify character set
mernst Apr 8, 2024
8c76653
Remove file `SKIP-REQUIRE-JAVADOC`
mernst Apr 8, 2024
8473446
Update dependency commons-io:commons-io to v2.16.1 (#6530)
renovate[bot] Apr 9, 2024
bad6020
Add manual section on customizing default checker options (#6511)
jyoo980 Apr 15, 2024
9cf2237
Ensure subcheckers respect options passed to parent checker (#6513)
jyoo980 Apr 15, 2024
5401675
Don't descend into a nested lambda when collecting returned expressions
smillst Apr 15, 2024
adca6dc
How to reproduce CI failures (#6533)
mernst Apr 17, 2024
79d6dc9
Update dependency io.github.classgraph:classgraph to v4.8.172 (#6537)
renovate[bot] Apr 19, 2024
6072e71
Add tips to fix inconsistent Gradle build state (#6536)
jyoo980 Apr 20, 2024
6432e19
Disable guava_jdk11 CI job
mernst Apr 22, 2024
3e9e69b
Use Gradle 8.7
mernst Apr 22, 2024
ea9c0f8
Use plume-util version 1.9.3
mernst Apr 22, 2024
89fe1fd
Fix problems with type variables in type argument inference
smillst Apr 23, 2024
b88eb55
Run shellcheck in CI
mernst Apr 23, 2024
045fa67
Avoid Azure timeouts by producing output during `:checker:test` task
mernst Apr 25, 2024
627564f
Set maxParallelForks as per Gradle's recommendation
mernst Apr 26, 2024
3f53692
Remove stray line
mernst Apr 26, 2024
4b474c6
Update ubuntu Docker tag to v24 (#6552)
renovate[bot] Apr 26, 2024
a0fbadc
Update plugin com.gorylenko.gradle-git-properties to v2.4.2 (#6554)
renovate[bot] Apr 27, 2024
d028fe2
Update dependency org.checkerframework:stubparser to v3.25.10 (#6553)
renovate[bot] Apr 27, 2024
8328b9c
Simplify calls to `List.toArray()`
mernst Apr 28, 2024
5dd5312
Use Error Prone 2.27.0
mernst Apr 28, 2024
8d333e3
Use Guava version 33.1.0
mernst Apr 28, 2024
b714894
Update Stubparser to version 3.25.10(#6559)
smillst Apr 30, 2024
22f63ac
Prep for release.
smillst May 1, 2024
6a3b244
Only sign when publishing.
smillst May 1, 2024
8ffc504
Use property instead.
smillst May 1, 2024
70cd4f2
new release 3.43.0
smillst May 1, 2024
0723d82
Use correct package
wmdietl Jan 30, 2025
95a2e99
Use non-"Primary" method names
wmdietl Jan 30, 2025
553a5f5
Fix merge issues
wmdietl Jan 30, 2025
9e754c6
Move method to hopefully the right place
wmdietl Jan 30, 2025
3d90765
Fix missing imports
wmdietl Jan 30, 2025
2ed69e3
Suggested refactoring
wmdietl Jan 30, 2025
67e9601
Keep original code
wmdietl Jan 30, 2025
ce83dbb
Remove inference parts NO-AFU
wmdietl Jan 30, 2025
6355f51
Don't use methods that only work with one top qualifier
wmdietl Jan 30, 2025
e7bf7cd
Adapt to method renamings
wmdietl Jan 30, 2025
0d7bcc1
Adapt gradle syntax
wmdietl Jan 30, 2025
a99afcc
Change back to EISOP formatting
wmdietl Jan 30, 2025
5408cec
Restore formatting of .ajava files
wmdietl Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
{
"matchPackageNames": ["com.amazonaws:aws-java-sdk-bom"],
"schedule": ["before 3am on the first day of the month"]
},
{
"description": "We want specifically version 3.3.2, which caused a crash before",
"matchPackageNames": ["org.apache.spark:spark-sql_2.12"],
"enabled": false
}
]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ tags
*.swp
*.orig
.DS_Store
dot_files

# Eclipse files
.metadata
.classpath
.project
.externalToolBuilders
.settings
dot_files
**/*.factorypath

# Intellij files
.idea
Expand Down
199 changes: 127 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def majorVersionToInt(majorVersionString) {
}

ext {
release = false
// Whether to use EISOP formatting.
// Can also be achieved by having a project property with the same name.
eisopFormatting = true

// On a Java 8 JVM, use error-prone javac and source/target 8.
// On a Java 9+ JVM, use the host javac, default source/target, and required module flags.
Expand Down Expand Up @@ -76,11 +78,12 @@ ext {
versions = [
autoValue : '1.11.0',
errorprone : '2.36.0',
googleJavaFormat : '1.25.2',
hashmapUtil : '0.0.1',
junit : '4.13.2',
lombok : '1.18.36',
// plume-util includes a version of reflection-util. When updating ensure the versions are consistent.
plumeUtil : '1.9.0',
plumeUtil : '1.9.3',
reflectionUtil : '1.1.3',
]
}
Expand Down Expand Up @@ -145,21 +148,21 @@ if (currentRuntimeJavaVersion >= 11) {
// > Could not create task ':spotlessJava'.
// > Add a step with [com.google.googlejavaformat:google-java-format:1.15.0] into the `spotlessPredeclare` block in the root project.
java {
googleJavaFormat()
googleJavaFormat(versions.googleJavaFormat)
}
groovyGradle {
greclipse()
}
}
}

allprojects {
allprojects { currentProj ->
// Increment the minor version (second number) rather than just the patch
// level (third number) if:
// * any new checkers have been added, or
// * backward-incompatible changes have been made to APIs or elsewhere.
// To make a snapshot release: ./gradlew publish
version = '3.42.0-eisop6-SNAPSHOT'
version = '3.43.0'

tasks.withType(JavaCompile).configureEach {
options.fork = true
Expand Down Expand Up @@ -245,31 +248,42 @@ allprojects {

if (currentRuntimeJavaVersion >= 11) {
apply plugin: 'com.diffplug.spotless'
// patterns of files to skip for individual sub-projects
def perProjectDoNotFormat = [
'checker': [
'bin-devel/.git-scripts/**',
'bin-devel/.plume-scripts/**',
'dist/**',
'tests/ainfer-*/annotated/*',
'tests/build/**',
'tests/calledmethods-delomboked/*',
'tests/nullness-javac-errors/*',
],
'dataflow': ['manual/examples/'],
'framework': [
'tests/build/**',
'tests/returnsreceiverdelomboked/*',
],
]
spotless {
// If you add any formatters to this block that require dependencies, then you must also
// add them to spotlessPredeclare block.
def doNotFormat = [
'checker/bin-devel/.git-scripts/**',
'checker/bin-devel/.plume-scripts/**',
'checker/tests/ainfer-*/annotated/*',
'dataflow/manual/examples/',
'**/nullness-javac-errors/*',
'**/calledmethods-delomboked/*',
'**/returnsreceiverdelomboked/*',
'**/build/**',
'*/dist/**',
]
if (currentRuntimeJavaVersion < 14) {
doNotFormat += ['**/*record*/']
}
if (currentRuntimeJavaVersion < 16) {
// TODO: directories should be renamed `-switchexpr` or some such,
// as they only contain examples for switch expressions, which were
// added in Java 14, not Java 17.
doNotFormat += ['**/java17/']
}
if (currentRuntimeJavaVersion < 21) {
doNotFormat += ['**/java21/']

// Always skip formatting of files under build directory
def doNotFormat = ['build/**']
if (currentProj != project.rootProject) {
if (perProjectDoNotFormat.containsKey(currentProj.name)) {
doNotFormat += perProjectDoNotFormat[currentProj.name]
}
if (currentRuntimeJavaVersion < 16) {
doNotFormat += [
'tests/**/java17/',
'tests/*record*/'
]
}
if (currentRuntimeJavaVersion < 21) {
doNotFormat += ['tests/**/java21/']
}
}

format 'misc', {
Expand All @@ -283,40 +297,64 @@ allprojects {
}

java {
def targets = [
// add target folders here
'checker',
'checker-qual',
'checker-util',
'dataflow',
'docs/examples',
'docs/tutorial',
'framework',
'framework-test',
'javacutil',
]
targets = targets.collectMany {
[
// must call toString() to convert GString to String
"${it}/**/*.java".toString(),
"${it}/**/*.ajava".toString()
if (currentProj == currentProj.rootProject) {
// format .java files outside of Gradle sub-projects
def targets = [
'docs/examples',
'docs/tutorial',
]
targets = targets.collectMany {
[
// must call toString() to convert GString to String
"${it}/**/*.java".toString(),
// Not .ajava files because formatting would remove import statements.
]
}
target targets
} else {
// not the root project; format all .java files in the sub-project
target '**/*.java', '**/*.ajava'
}
target targets
targetExclude doNotFormat

googleJavaFormat().aosp()
importOrder('com', 'jdk', 'lib', 'lombok', 'org', 'java', 'javax')
if (eisopFormatting || project.hasProperty('eisopFormatting')) {
googleJavaFormat(versions.googleJavaFormat).aosp()
importOrder('com', 'jdk', 'lib', 'lombok', 'org', 'java', 'javax')
} else {
googleJavaFormat(versions.googleJavaFormat) // the formatter to apply to Java files
}
formatAnnotations().addTypeAnnotation("PolyInitialized").addTypeAnnotation("PolyVP").addTypeAnnotation("ReceiverDependentQual")
}

groovyGradle {
target '**/*.gradle'
targetExclude doNotFormat
greclipse() // which formatter Spotless should use to format .gradle files.
leadingTabsToSpaces(4)
trimTrailingWhitespace()
// endWithNewline() // Don't want to end empty files with a newline
// Only define a groovyGradle task on the root project, for simplicity in setting the target pattern
if (currentProj == currentProj.rootProject) {
groovyGradle {
target '**/*.gradle'
targetExclude doNotFormat
greclipse() // which formatter Spotless should use to format .gradle files.
if (eisopFormatting || project.hasProperty('eisopFormatting')) {
indentWithSpaces(4)
} else {
indentWithSpaces(2)
}
trimTrailingWhitespace()
// endWithNewline() // Don't want to end empty files with a newline
}
}

// a useful task for debugging; prints exactly which files are getting formatted by spotless
tasks.register('printSpotlessTaskInputs') {
doLast {
project.tasks.forEach { task ->
if (task.name.contains('spotless')) {
println "Inputs for task '${task.name}':"

task.inputs.files.each { inputFile ->
println " Input: $inputFile"
}
}
}
}
}
}
}
Expand Down Expand Up @@ -510,8 +548,6 @@ allprojects {
options.errorprone.errorproneArgs = [
// Many compiler classes are interned.
'-Xep:ReferenceEquality:OFF',
// These might be worth fixing.
'-Xep:DefaultCharset:OFF',
// Not useful to suggest Splitter; maybe clean up.
'-Xep:StringSplitter:OFF',
// Too broad, rejects seemingly-correct code.
Expand All @@ -531,6 +567,10 @@ allprojects {
'-Xep:ExtendsObject:OFF',
// For Visitors it is convenient to just pass a Void parameter.
'-Xep:VoidUsed:OFF',
// The Checker Framework is the only nullness tool we care about.
'-Xep:NullableWildcard:OFF',
// In the visitor pattern, it is natural to forward a Void reference.
'-Xep:VoidUsed:OFF',
// -Werror halts the build if Error Prone issues a warning, which ensures that
// the errors get fixed. On the downside, Error Prone (or maybe the compiler?)
// stops as soon as it issues one warning, rather than outputting them all.
Expand Down Expand Up @@ -676,9 +716,14 @@ task allJavadoc(type: Javadoc, group: 'Documentation') {
}

classpath = configurations.allProjects

if (isJava8) {
classpath += configurations.javacJar
}

// disable interpreting module-info.java files until all sub-modules support them
modularity.inferModulePath = false

doLast {
copy {
from 'docs/logo/Checkmark/CFCheckmark_favicon.png'
Expand Down Expand Up @@ -736,6 +781,8 @@ def createJavadocTask(taskName, taskDescription, memberLevel) {
}

classpath = configurations.allProjects
// disable interpreting module-info.java files until all sub-modules support them
modularity.inferModulePath = false

destinationDir.deleteDir()
options.memberLevel = memberLevel
Expand Down Expand Up @@ -931,6 +978,7 @@ subprojects {
// For an example work-around see NullnessAnnotatedTypeFactory#NONNULL_ALIASES.

// Relocate packages that might conflict with user's classpath.
relocate 'com.github.javaparser', 'org.checkerframework.com.github.javaparser'
relocate 'org.apache', 'org.checkerframework.org.apache'
relocate 'org.relaxng', 'org.checkerframework.org.relaxng'
relocate 'org.plumelib', 'org.checkerframework.org.plumelib'
Expand All @@ -944,13 +992,6 @@ subprojects {

exclude '**/module-info.class'

doFirst {
if (release) {
// Only relocate JavaParser during a release:
relocate 'com.github.javaparser', 'org.checkerframework.com.github.javaparser'
}
}

minimize()
}

Expand Down Expand Up @@ -984,7 +1025,7 @@ subprojects {
manifest {
attributes('Implementation-Version': "${project.version}")
attributes('Implementation-URL': 'https://eisop.github.io/')
if (! archiveFileName.get().endsWith('source.jar')) {
if (! archiveFileName.get().endsWith('source.jar') && ! archiveFileName.get().startsWith('checker-qual')) {
attributes('Automatic-Module-Name': 'org.checkerframework.' + project.name.replaceAll('-', '.'))
}
if (archiveFileName.get().startsWith('checker-qual') || archiveFileName.get().startsWith('checker-util')) {
Expand Down Expand Up @@ -1150,7 +1191,25 @@ subprojects {
jvmArgs += compilerArgsForRunningCF
}

maxParallelForks = Integer.MAX_VALUE
// Run tests in parallel, except on CI where it seems to lead to flaky failures.
// The TF_BUILD environment variable is set to 'True' for jobs running on Azure Pipelines.
if (!System.getenv('TF_BUILD')?.equals('True')) {
// Not running under Azure Pipelines CI.

// This uses Gradle's recommended value for `maxParallelForks`:
// https://docs.gradle.org/current/userguide/performance.html#optimize_java_projects
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
} else {
// Running under Azure Pipelines CI.

// Azure seems to time out when a task doesn't produce periodic output.
if (project.name.is('checker')) {
testLogging {
events "started", "skipped", "failed"
displayGranularity 3
}
}
}

if (project.name.is('checker')) {
dependsOn('assembleForJavac')
Expand Down Expand Up @@ -1290,17 +1349,13 @@ task buildAll(group: 'Build') {
dependsOn("${subproject.name}:sourcesJar")
}
dependsOn('framework:allJavadocJar', 'framework:allSourcesJar', 'checker:allJavadocJar', 'checker:allSourcesJar', 'checker-qual:jar', 'checker-util:jar')
dependsOn('checker:assembleForJavac')
}

task releaseBuild(group: 'Build') {
description = 'Build everything required for a release'
description = 'Cleans, then builds everything required for a release'
dependsOn(clean)
doFirst {
release = true
}
// Use finalizedBy rather than dependsOn so that release is set to true before any of the tasks are run.
finalizedBy(buildAll)
finalizedBy('checker:assembleForJavac')
dependsOn(buildAll)
}

// No group so it does not show up in the output of `gradlew tasks`
Expand Down
28 changes: 28 additions & 0 deletions checker-qual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ if (JavaVersion.current() >= JavaVersion.VERSION_17) {
apply plugin: 'biz.aQute.bnd.builder'
}

sourceSets {
main {
java {
exclude 'module-info.java'
}
}
module_info {
java {
srcDirs ('src/main')
}
}
}

task compileJava9(type: JavaCompile) {
source = sourceSets.module_info.java
destinationDirectory = sourceSets.main.output.classesDirs[0]
classpath = configurations.allProjects
options.release = 9
}

compileJava {
dependsOn compileJava9
}

javadoc {
modularity.inferModulePath = false
}

jar {
manifest {
attributes('Export-Package': '*')
Expand Down
Loading
Loading