diff --git a/build.gradle b/build.gradle index 662b2b33f09..e75c093998d 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ apply plugin: 'de.undercouch.download' // There is another `repositories { ... }` block below; if you change this one, change that one as well. repositories { - maven { url 'https://oss.sonatype.org/content/repositories/snapshots/'} + maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/'} mavenCentral() } @@ -115,7 +115,7 @@ task setLocalRepo(type:Exec) { // No group so it does not show up in the output of `gradlew tasks` task installGitHooks(type: Copy, dependsOn: 'setLocalRepo') { - description 'Copies git hooks to .git directory' + description = 'Copies git hooks to .git directory' from files('checker/bin-devel/git.post-merge', 'checker/bin-devel/git.pre-commit') rename('git\\.(.*)', '$1') into localRepo + '/hooks' @@ -158,7 +158,7 @@ allprojects { // * 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.42.0-eisop6-SNAPSHOT' tasks.withType(JavaCompile).configureEach { options.fork = true @@ -170,11 +170,11 @@ allprojects { apply plugin: 'de.undercouch.download' apply plugin: 'net.ltgt.errorprone' - group 'io.github.eisop' + group = 'io.github.eisop' // Keep in sync with "repositories { ... }" block above. repositories { - maven { url 'https://oss.sonatype.org/content/repositories/snapshots/'} + maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/'} mavenCentral() } @@ -352,6 +352,7 @@ allprojects { dependsOn(':checker:shadowJar') dependsOn(":framework-test:${tagletVersion}Classes") + doFirst { options.encoding = 'UTF-8' if (!name.equals('javadocDoclintAll')) { @@ -558,7 +559,7 @@ allprojects { } // end allProjects task version(group: 'Documentation') { - description 'Print Checker Framework version' + description = 'Print Checker Framework version' doLast { println version } @@ -575,8 +576,8 @@ task version(group: 'Documentation') { */ def createCheckTypeTask(projectName, taskName, checker, args = []) { project("${projectName}").tasks.create(name: "check${taskName}", type: JavaCompile, dependsOn: ':checker:shadowJar') { - description "Run the ${taskName} Checker on the main sources." - group 'Verification' + description = "Run the ${taskName} Checker on the main sources." + group = 'Verification' // Always run the task. outputs.upToDateWhen { false } source = project("${projectName}").sourceSets.main.java @@ -616,7 +617,7 @@ def createCheckTypeTask(projectName, taskName, checker, args = []) { } task htmlValidate(type: Exec, group: 'Format') { - description 'Validate that HTML files are well-formed' + description = 'Validate that HTML files are well-formed' executable 'html5validator' args = [ '--ignore', @@ -684,7 +685,7 @@ task allJavadoc(type: Javadoc, group: 'Documentation') { into "${rootDir}/docs/api" } injected.execOps.exec { - workingDir "${rootDir}/docs/api" + workingDir file("${rootDir}/docs/api") executable "${htmlToolsHome}/html-add-favicon" args += [ '.', @@ -747,18 +748,19 @@ def createJavadocTask(taskName, taskDescription, memberLevel) { createJavadocTask('javadocDoclintAll', 'Runs javadoc with -Xdoclint:all option.', JavadocMemberLevel.PRIVATE) task manual(group: 'Documentation') { - description 'Build the manual' + description = 'Build the manual' def injected = project.objects.newInstance(InjectedExecOps) doLast { injected.execOps.exec { - commandLine 'make', '-C', 'docs/manual', 'all' + workingDir = file('docs/manual') + commandLine 'make', 'all' } } } // No group so it does not show up in the output of `gradlew tasks` task downloadJtreg(type: Download) { - description "Downloads and unpacks jtreg." + description = 'Downloads and unpacks jtreg.' onlyIf { !(new File("${jtregHome}/lib/jtreg.jar").exists()) } // src 'https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact/jtreg-4.2.0-tip.tar.gz' // If ci.adoptopenjdk.net is down, use this copy. @@ -795,7 +797,7 @@ task downloadJtreg(type: Download) { void clone(url, directory, ignoreError, extraArgs = []){ def injected = project.objects.newInstance(InjectedExecOps) injected.execOps.exec { - workingDir "${directory}/../" + workingDir file("${directory}/../") executable 'git' args = [ 'clone', @@ -806,8 +808,9 @@ void clone(url, directory, ignoreError, extraArgs = []){ ] args += extraArgs ignoreExitValue = ignoreError - timeout = 60000 // 60 seconds } + // TODO: not sure this does what it is supposed to. + // timeout = Duration.ofSeconds(60) } /** @@ -822,7 +825,7 @@ void clone(url, directory, ignoreError, extraArgs = []){ */ def createCloneTask(taskName, url, directory, extraArgs = []) { tasks.create(name: taskName) { - description "Obtain or update ${url}" + description = "Obtain or update ${url}" // Always run. outputs.upToDateWhen { false } @@ -832,12 +835,13 @@ def createCloneTask(taskName, url, directory, extraArgs = []) { doLast { if (file(directory).exists()) { injected.execOps.exec { - workingDir directory + workingDir file(directory) executable 'git' args = ['pull', '-q'] ignoreExitValue = true - timeout = 60000 // 60 seconds } + // TODO: not sure this does what it is supposed to. + // timeout = Duration.ofSeconds(60) } else { try { clone(url, directory, true, extraArgs) @@ -864,14 +868,14 @@ createCloneTask('getDoLikeJavac', 'https://github.com/opprop/do-like-javac.git', // No group so it does not show up in the output of `gradlew tasks` task pythonIsInstalled(type: Exec) { - description 'Check that the python3 executable is installed.' + description = 'Check that the python3 executable is installed.' executable = 'python3' args '--version' } task tags { - group 'Emacs' - description 'Create Emacs TAGS table' + group = 'Emacs' + description = 'Create Emacs TAGS table' def injected = project.objects.newInstance(InjectedExecOps) @@ -951,7 +955,7 @@ subprojects { if (!project.name.startsWith('checker-qual-android')) { task tags(type: Exec) { - description 'Create Emacs TAGS table' + description = 'Create Emacs TAGS table' commandLine 'bash', '-c', "find . \\( -name build -o -name jtreg -o -name tests \\) -prune -o -name '*.java' -print | sort-directory-order | xargs ctags -e -f TAGS" } } @@ -1039,7 +1043,7 @@ subprojects { // Add jtregTests to framework and checker modules if (project.name.is('framework') || project.name.is('checker')) { tasks.create(name: 'jtregTests', group: 'Verification') { - description 'Run the jtreg tests.' + description = 'Run the jtreg tests.' if (currentRuntimeJavaVersion < 11) { // jtreg only works on JDK 11+ @@ -1053,9 +1057,13 @@ subprojects { def injected = project.objects.newInstance(InjectedExecOps) + def isFramework = project.name.is('framework') + def isChecker = project.name.is('checker') + String jtregOutput = "${buildDir}/jtreg" String name = 'all' String tests = '.' + doLast { try { injected.execOps.exec { @@ -1089,12 +1097,12 @@ subprojects { '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED', '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED', ] - if (project.name.is('framework')) { + if (isFramework) { // Do not check for the annotated JDK args += [ '-javacoptions:-ApermitMissingJdk' ] - } else if (project.name.is('checker')) { + } else if (isChecker) { args += [ "-javacoptions:-classpath ${sourceSets.testannotations.output.asPath}", ] @@ -1126,7 +1134,7 @@ subprojects { sourceSets.test.allJava.filter {it.path.matches('.*test[\\\\/]junit.*')}.forEach { file -> String junitClassName = file.name.replaceAll('.java', '') tasks.create(name: "${junitClassName}", type: Test) { - description "Run ${junitClassName} tests." + description = "Run ${junitClassName} tests." include "**/${name}.class" testClassesDirs = testing.suites.test.sources.output.classesDirs classpath = testing.suites.test.sources.runtimeClasspath @@ -1157,7 +1165,7 @@ subprojects { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'failed' // Don't show the uninteresting stack traces from the exceptions. @@ -1181,7 +1189,7 @@ subprojects { // Create a nonJunitTests task per project tasks.create(name: 'nonJunitTests', group: 'Verification') { - description 'Run all Checker Framework tests except for the JUnit tests and inference tests.' + description = 'Run all Checker Framework tests except for the JUnit tests and inference tests.' if (project.name.is('framework') || project.name.is('checker')) { dependsOn('jtregTests') } @@ -1203,21 +1211,21 @@ subprojects { // Create an inferenceTests task per project tasks.create(name: 'inferenceTests', group: 'Verification') { - description 'Run inference tests.' + description = 'Run inference tests.' if (project.name.is('checker')) { // NO-AFU: Needs to depend on future AFU version of CF // dependsOn('inferenceTests-part1', 'inferenceTests-part1') } } tasks.create(name: 'inferenceTests-part1', group: 'Verification') { - description 'Run inference tests (part 1).' + description = 'Run inference tests (part 1).' if (project.name.is('checker')) { // NO-AFU: Needs to depend on future AFU version of CF // dependsOn('ainferTest', 'wpiManyTest') } } tasks.create(name: 'inferenceTests-part2', group: 'Verification') { - description 'Run inference tests (part 2).' + description = 'Run inference tests (part 2).' if (project.name.is('checker')) { // NO-AFU: Needs to depend on future AFU version of CF // dependsOn('wpiPlumeLibTest') @@ -1228,15 +1236,15 @@ subprojects { // This isn't a test of the Checker Framework as the test and nonJunitTests tasks are. // Tasks such as 'checkInterning' are constructed by createCheckTypeTask. tasks.create(name: 'typecheck', group: 'Verification') { - description 'Run the Checker Framework on itself' + description = 'Run the Checker Framework on itself' dependsOn('typecheck-part1', 'typecheck-part2') } tasks.create(name: 'typecheck-part1', group: 'Verification') { - description 'Run the Checker Framework on itself (part 1)' + description = 'Run the Checker Framework on itself (part 1)' dependsOn('checkFormatter', 'checkInterning', 'checkOptional', 'checkPurity') } tasks.create(name: 'typecheck-part2', group: 'Verification') { - description 'Run the Checker Framework on itself (part 2)' + description = 'Run the Checker Framework on itself (part 2)' dependsOn('checkResourceLeak', 'checkSignature') if (project.name.is('framework') || project.name.is('checker')) { dependsOn('checkCompilerMessages') @@ -1247,7 +1255,7 @@ subprojects { // Create an allTests task per project. // allTests = test + nonJunitTests + inferenceTests + typecheck tasks.create(name: 'allTests', group: 'Verification') { - description 'Run all Checker Framework tests' + description = 'Run all Checker Framework tests' // The 'test' target is just the JUnit tests. dependsOn('test', 'nonJunitTests', 'inferenceTests', 'typecheck') } @@ -1273,7 +1281,7 @@ assemble.dependsOn(':checker:assembleForJavac') assemble.mustRunAfter(clean) task buildAll(group: 'Build') { - description 'Build all jar files, including source and javadoc jars' + description = 'Build all jar files, including source and javadoc jars' dependsOn(allJavadoc) subprojects { Project subproject -> dependsOn("${subproject.name}:assemble") @@ -1284,7 +1292,7 @@ task buildAll(group: 'Build') { } task releaseBuild(group: 'Build') { - description 'Build everything required for a release' + description = 'Build everything required for a release' dependsOn(clean) doFirst { release = true @@ -1296,7 +1304,7 @@ task releaseBuild(group: 'Build') { // No group so it does not show up in the output of `gradlew tasks` task releaseAndTest { - description 'Build everything required for a release and run allTests' + description = 'Build everything required for a release and run allTests' dependsOn(releaseBuild) subprojects { Project subproject -> dependsOn("${subproject.name}:allTests") diff --git a/checker-qual-android/build.gradle b/checker-qual-android/build.gradle index b3677061d4d..135d2ecb0f3 100644 --- a/checker-qual-android/build.gradle +++ b/checker-qual-android/build.gradle @@ -1,7 +1,7 @@ evaluationDependsOn(':checker-qual') task copySources(type: Copy) { - description 'Copy checker-qual source to checker-qual-android' + description = 'Copy checker-qual source to checker-qual-android' includeEmptyDirs = false doFirst { // Delete the directory in case a previously copied file should no longer be in checker-qual diff --git a/checker/build.gradle b/checker/build.gradle index 4c6df6b8a69..4d7e95d65be 100644 --- a/checker/build.gradle +++ b/checker/build.gradle @@ -131,10 +131,12 @@ jar { // It is useful for those who only want to run `javac`. // checker.jar is copied to checker/dist/ when it is built by the shadowJar task. task assembleForJavac(dependsOn: shadowJar, group: 'Build') { - description 'Builds or downloads jars required by CheckerMain and puts them in checker/dist/.' + description = 'Builds or downloads jars required by CheckerMain and puts them in checker/dist/.' dependsOn project(':checker-qual').tasks.jar + def checkerQualJarFile = file(project(':checker-qual').tasks.getByName('jar').archiveFile) + def checkerUtilJarFile = file(project(':checker-util').tasks.getByName('jar').archiveFile) + doLast { - def checkerQualJarFile = file(project(':checker-qual').tasks.getByName('jar').archiveFile) if (!checkerQualJarFile.exists()) { throw new GradleException('File not found: ' + checkerQualJarFile) } @@ -147,7 +149,6 @@ task assembleForJavac(dependsOn: shadowJar, group: 'Build') { } } - def checkerUtilJarFile = file(project(':checker-util').tasks.getByName('jar').archiveFile) if (!checkerUtilJarFile.exists()) { throw new GradleException('File not found: ' + checkerUtilJarFile) } @@ -172,10 +173,9 @@ task assembleForJavac(dependsOn: shadowJar, group: 'Build') { } assemble.dependsOn assembleForJavac -assemble.dependsOn(':getDoLikeJavac') task allSourcesJar(type: Jar, group: 'Build') { - description 'Creates a sources jar that includes sources for all Checker Framework classes in checker.jar' + description = 'Creates a sources jar that includes sources for all Checker Framework classes in checker.jar' destinationDirectory = file("${projectDir}/dist") archiveFileName = 'checker-source.jar' archiveClassifier = 'sources' @@ -185,7 +185,7 @@ task allSourcesJar(type: Jar, group: 'Build') { } task allJavadocJar(type: Jar, group: 'Build') { - description 'Creates javadoc jar including Javadoc for all of the Checker Framework' + description = 'Creates javadoc jar including Javadoc for all of the Checker Framework' dependsOn rootProject.tasks.allJavadoc destinationDirectory = file("${projectDir}/dist") archiveFileName = 'checker-javadoc.jar' @@ -197,7 +197,7 @@ task allJavadocJar(type: Jar, group: 'Build') { import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar task checkerJar(type: ShadowJar, dependsOn: compileJava, group: 'Build') { - description "Builds checker-${project.version}.jar with all dependencies except checker-qual and checker-util." + description = "Builds checker-${project.version}.jar with all dependencies except checker-qual and checker-util." includeEmptyDirs = false from shadowJar.source @@ -220,7 +220,7 @@ jar { } shadowJar { - description 'Creates checker-VERSION-all.jar and copies it to dist/checker.jar.' + description = 'Creates checker-VERSION-all.jar and copies it to dist/checker.jar.' // To see what files are incorporated into the shadow jar file: // doFirst { println sourceSets.main.runtimeClasspath.asPath } archiveClassifier = 'all' @@ -292,21 +292,21 @@ checkCompilerMessages { } task nullnessExtraTests(type: Exec, dependsOn: assembleForJavac, group: 'Verification') { - description 'Run extra tests for the Nullness Checker.' + description = 'Run extra tests for the Nullness Checker.' executable 'make' environment JAVAC: "${projectDir}/bin/javac -AnoJreVersionCheck", JAVAP: 'javap' args = ['-C', 'tests/nullness-extra/'] } task commandLineTests(type: Exec, dependsOn: assembleForJavac, group: 'Verification') { - description 'Run tests that need a special command line.' + description = 'Run tests that need a special command line.' executable 'make' environment JAVAC: "${projectDir}/bin/javac -AnoJreVersionCheck" args = ['-C', 'tests/command-line/'] } task tutorialTests(dependsOn: assembleForJavac, group: 'Verification') { - description 'Test that the tutorial is working as expected.' + description = 'Test that the tutorial is working as expected.' doLast { ant.ant(dir: "${rootDir}/docs/tutorial/tests", useNativeBasedir: 'true', inheritAll: 'false') { target(name: 'check-tutorial') @@ -315,14 +315,14 @@ task tutorialTests(dependsOn: assembleForJavac, group: 'Verification') { } task exampleTests(type: Exec, dependsOn: assembleForJavac, group: 'Verification') { - description 'Run tests for the example programs.' + description = 'Run tests for the example programs.' executable 'make' environment JAVAC: "${projectDir}/bin/javac -AnoJreVersionCheck" args = ['-C', '../docs/examples'] } task demosTests(dependsOn: assembleForJavac, group: 'Verification') { - description 'Test that the demos are working as expected.' + description = 'Test that the demos are working as expected.' def injected = project.objects.newInstance(InjectedExecOps) @@ -356,12 +356,12 @@ task demosTests(dependsOn: assembleForJavac, group: 'Verification') { } task allNullnessTests(type: Test, group: 'Verification') { - description 'Run all JUnit tests for the Nullness Checker.' + description = 'Run all JUnit tests for the Nullness Checker.' include '**/Nullness*.class' } task allCalledMethodsTests(type: Test, group: 'Verification') { - description 'Run all JUnit tests for the Called Methods Checker.' + description = 'Run all JUnit tests for the Called Methods Checker.' include '**/CalledMethods*.class' if (!skipDelombok) { dependsOn 'delombok' @@ -369,14 +369,14 @@ task allCalledMethodsTests(type: Test, group: 'Verification') { } task allResourceLeakTests(type: Test, group: 'Verification') { - description 'Run all JUnit tests for the Resource Leak Checker.' + description = 'Run all JUnit tests for the Resource Leak Checker.' include '**/ResourceLeak*.class' include '**/MustCall*.class' } // These are tests that should only be run with JDK 11+. task jtregJdk11Tests(dependsOn: ':downloadJtreg', group: 'Verification') { - description 'Run the jtreg tests made for JDK 11+.' + description = 'Run the jtreg tests made for JDK 11+.' dependsOn('compileJava') dependsOn('compileTestJava') dependsOn('shadowJar') @@ -420,7 +420,7 @@ task jtregJdk11Tests(dependsOn: ':downloadJtreg', group: 'Verification') { } task delombok { - description 'Delomboks the source code tree in tests/calledmethods-lombok' + description = 'Delomboks the source code tree in tests/calledmethods-lombok' def srcDelomboked = 'tests/calledmethods-delomboked' def srcJava = 'tests/calledmethods-lombok' @@ -465,7 +465,7 @@ test { } task ainferTestCheckerGenerateStubs(type: Test) { - description 'Internal task. Users should run ainferTestCheckerStubTest instead. This type-checks the ainfer-testchecker files with -Ainfer=stubs to generate stub files.' + description = 'Internal task. Users should run ainferTestCheckerStubTest instead. This type-checks the ainfer-testchecker files with -Ainfer=stubs to generate stub files.' dependsOn(compileTestJava) doFirst { @@ -479,7 +479,7 @@ task ainferTestCheckerGenerateStubs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -508,7 +508,7 @@ task ainferTestCheckerGenerateStubs(type: Test) { } task ainferTestCheckerValidateStubs(type: Test) { - description 'Internal task. Users should run ainferTestCheckerStubTest instead. This type-checks the ainfer-testchecker tests using the stub files generated by ainferTestCheckerGenerateStubs.' + description = 'Internal task. Users should run ainferTestCheckerStubTest instead. This type-checks the ainfer-testchecker tests using the stub files generated by ainferTestCheckerGenerateStubs.' dependsOn(ainferTestCheckerGenerateStubs) outputs.upToDateWhen { false } @@ -518,13 +518,13 @@ task ainferTestCheckerValidateStubs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferTestCheckerGenerateAjava(type: Test) { - description 'Internal task. Users should run ainferTestCheckerAjavaTest instead. This type-checks the ainfer-testchecker files with -Ainfer=ajava to generate ajava files.' + description = 'Internal task. Users should run ainferTestCheckerAjavaTest instead. This type-checks the ainfer-testchecker files with -Ainfer=ajava to generate ajava files.' dependsOn(compileTestJava) doFirst { @@ -538,7 +538,7 @@ task ainferTestCheckerGenerateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -567,7 +567,7 @@ task ainferTestCheckerGenerateAjava(type: Test) { } task ainferTestCheckerValidateAjava(type: Test) { - description 'Internal task. Users should run ainferTestCheckerAjavaTest instead. This re-type-checks the ainfer-testchecker files using the ajava files generated by ainferTestCheckerGenerateAjava' + description = 'Internal task. Users should run ainferTestCheckerAjavaTest instead. This re-type-checks the ainfer-testchecker files using the ajava files generated by ainferTestCheckerGenerateAjava' dependsOn(ainferTestCheckerGenerateAjava) outputs.upToDateWhen { false } @@ -577,7 +577,7 @@ task ainferTestCheckerValidateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } @@ -616,20 +616,20 @@ void copyNonannotatedToAnnotatedDirectory(String testdir) { // run the insert-annotations-to-source tool. Instead, it tests the -Ainfer=stubs feature // and the -AmergeStubsWithSource feature to do WPI using stub files. task ainferTestCheckerStubTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using stub files' + description = 'Run tests for whole-program inference using stub files' dependsOn(ainferTestCheckerValidateStubs) outputs.upToDateWhen { false } } // Like ainferTestCheckerStubTest, but with ajava files instead task ainferTestCheckerAjavaTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using ajava files' + description = 'Run tests for whole-program inference using ajava files' dependsOn(ainferTestCheckerValidateAjava) outputs.upToDateWhen { false } } task ainferTestCheckerGenerateJaifs(type: Test) { - description 'Internal task. Users should run ainferTestCheckerJaifTest instead. This type-checks the ainfer-testchecker files with -Ainfer=jaifs to generate .jaif files' + description = 'Internal task. Users should run ainferTestCheckerJaifTest instead. This type-checks the ainfer-testchecker files with -Ainfer=jaifs to generate .jaif files' dependsOn(compileTestJava) dependsOn(':checker-qual:jar') // For the Value Checker annotations. @@ -643,7 +643,7 @@ task ainferTestCheckerGenerateJaifs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -708,7 +708,7 @@ task ainferTestCheckerGenerateJaifs(type: Test) { } task ainferTestCheckerValidateJaifs(type: Test) { - description 'Internal task. Users should run ainferTestCheckerJaifTest instead. This type-checks the ainfer-testchecker files using the .jaif files generated by ainferTestCheckerGenerateJaifs' + description = 'Internal task. Users should run ainferTestCheckerJaifTest instead. This type-checks the ainfer-testchecker files using the .jaif files generated by ainferTestCheckerGenerateJaifs' dependsOn(ainferTestCheckerGenerateJaifs) outputs.upToDateWhen { false } @@ -718,19 +718,19 @@ task ainferTestCheckerValidateJaifs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferTestCheckerJaifTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using .jaif files' + description = 'Run tests for whole-program inference using .jaif files' dependsOn(ainferTestCheckerValidateJaifs) outputs.upToDateWhen { false } } task ainferIndexGenerateAjava(type: Test) { - description 'Internal task. Users should run ainferIndexAjavaTest instead. This type-checks the ainfer-index files with -Ainfer=ajava to generate ajava files.' + description = 'Internal task. Users should run ainferIndexAjavaTest instead. This type-checks the ainfer-index files with -Ainfer=ajava to generate ajava files.' dependsOn(compileTestJava) doFirst { @@ -744,7 +744,7 @@ task ainferIndexGenerateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -754,7 +754,7 @@ task ainferIndexGenerateAjava(type: Test) { } task ainferIndexValidateAjava(type: Test) { - description 'Internal task. Users should run ainferIndexAjavaTest instead. This re-type-checks the ainfer-index files using the ajava files generated by ainferIndexGenerateAjava' + description = 'Internal task. Users should run ainferIndexAjavaTest instead. This re-type-checks the ainfer-index files using the ajava files generated by ainferIndexGenerateAjava' dependsOn(ainferIndexGenerateAjava) outputs.upToDateWhen { false } @@ -764,19 +764,19 @@ task ainferIndexValidateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferIndexAjavaTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using ajava files and the Index Checker' + description = 'Run tests for whole-program inference using ajava files and the Index Checker' dependsOn(ainferIndexValidateAjava) outputs.upToDateWhen { false } } task ainferNullnessGenerateAjava(type: Test) { - description 'Internal task. Users should run ainferNullnessAjavaTest instead. This type-checks the ainfer-nullness files with -Ainfer=ajava to generate ajava files.' + description = 'Internal task. Users should run ainferNullnessAjavaTest instead. This type-checks the ainfer-nullness files with -Ainfer=ajava to generate ajava files.' dependsOn(compileTestJava) doFirst { @@ -790,7 +790,7 @@ task ainferNullnessGenerateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -800,7 +800,7 @@ task ainferNullnessGenerateAjava(type: Test) { } task ainferNullnessValidateAjava(type: Test) { - description 'Internal task. Users should run ainferNullnessAjavaTest instead. This re-type-checks the ainfer-nullness files using the ajava files generated by ainferNullnessGenerateAjava' + description = 'Internal task. Users should run ainferNullnessAjavaTest instead. This re-type-checks the ainfer-nullness files using the ajava files generated by ainferNullnessGenerateAjava' dependsOn(ainferNullnessGenerateAjava) outputs.upToDateWhen { false } @@ -810,19 +810,19 @@ task ainferNullnessValidateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferNullnessAjavaTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using ajava files and the Nullness Checker' + description = 'Run tests for whole-program inference using ajava files and the Nullness Checker' dependsOn(ainferNullnessValidateAjava) outputs.upToDateWhen { false } } task ainferResourceLeakGenerateAjava(type: Test) { - description 'Internal task. Users should run ainferResourceLeakAjavaTest instead. This type-checks the ainfer-index files with -Ainfer=ajava to generate ajava files.' + description = 'Internal task. Users should run ainferResourceLeakAjavaTest instead. This type-checks the ainfer-index files with -Ainfer=ajava to generate ajava files.' dependsOn(compileTestJava) doFirst { @@ -836,7 +836,7 @@ task ainferResourceLeakGenerateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -846,7 +846,7 @@ task ainferResourceLeakGenerateAjava(type: Test) { } task ainferResourceLeakValidateAjava(type: Test) { - description 'Internal task. Users should run ainferResourceLeakAjavaTest instead. This re-type-checks the ainfer-resourceleak files using the ajava files generated by ainferResourceLeakGenerateAjava' + description = 'Internal task. Users should run ainferResourceLeakAjavaTest instead. This re-type-checks the ainfer-resourceleak files using the ajava files generated by ainferResourceLeakGenerateAjava' dependsOn(ainferResourceLeakGenerateAjava) outputs.upToDateWhen { false } @@ -856,19 +856,19 @@ task ainferResourceLeakValidateAjava(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and the expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferResourceLeakAjavaTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using ajava files and the Resource Leak Checker' + description = 'Run tests for whole-program inference using ajava files and the Resource Leak Checker' dependsOn(ainferResourceLeakValidateAjava) outputs.upToDateWhen { false } } task ainferNullnessGenerateJaifs(type: Test) { - description 'Internal task. Users should run ainferNullnessJaifTest instead. This type-checks the ainfer-nullness files with -Ainfer=jaifs to generate .jaif files' + description = 'Internal task. Users should run ainferNullnessJaifTest instead. This type-checks the ainfer-nullness files with -Ainfer=jaifs to generate .jaif files' dependsOn(compileTestJava) doFirst { @@ -881,7 +881,7 @@ task ainferNullnessGenerateJaifs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } @@ -930,7 +930,7 @@ task ainferNullnessGenerateJaifs(type: Test) { } task ainferNullnessValidateJaifs(type: Test) { - description 'Internal task. Users should run ainferNullnessJaifTest instead. This re-type-checks the ainfer-nullness files using the .jaif files generated by ainferNullnessGenerateJaifs' + description = 'Internal task. Users should run ainferNullnessJaifTest instead. This re-type-checks the ainfer-nullness files using the .jaif files generated by ainferNullnessGenerateJaifs' dependsOn(ainferNullnessGenerateJaifs) outputs.upToDateWhen { false } @@ -940,13 +940,13 @@ task ainferNullnessValidateJaifs(type: Test) { outputs.upToDateWhen { false } // Show the found unexpected diagnostics and expected diagnostics not found. - exceptionFormat 'full' + exceptionFormat = 'full' events 'passed', 'skipped', 'failed' } } task ainferNullnessJaifTest(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for whole-program inference using .jaif files' + description = 'Run tests for whole-program inference using .jaif files' dependsOn(ainferNullnessValidateJaifs) outputs.upToDateWhen { false } } @@ -955,7 +955,7 @@ task ainferNullnessJaifTest(dependsOn: 'shadowJar', group: 'Verification') { // Empty task that just runs both the jaif and stub WPI tests. // It is run as part of the inferenceTests task. task ainferTest(group: 'Verification') { - description 'Run tests for all whole program inference modes.' + description = 'Run tests for all whole program inference modes.' dependsOn('ainferTestCheckerJaifTest') dependsOn('ainferTestCheckerStubTest') dependsOn('ainferTestCheckerAjavaTest') @@ -971,7 +971,7 @@ task ainferTest(group: 'Verification') { // This is run as part of the inferenceTests task. task wpiManyTest(group: 'Verification') { - description 'Tests the wpi-many.sh script (and indirectly the wpi.sh script). Requires an Internet connection.' + description = 'Tests the wpi-many.sh script (and indirectly the wpi.sh script). Requires an Internet connection.' dependsOn(assembleForJavac) dependsOn(':getDoLikeJavac') // This test must always be re-run when requested. @@ -1104,7 +1104,7 @@ task wpiManyTest(group: 'Verification') { // This is run as part of the inferenceTests task. task wpiPlumeLibTest(group: 'Verification') { - description 'Tests whole-program inference on the plume-lib projects. Requires an Internet connection.' + description = 'Tests whole-program inference on the plume-lib projects. Requires an Internet connection.' dependsOn(assembleForJavac) dependsOn(':getDoLikeJavac') diff --git a/dataflow/build.gradle b/dataflow/build.gradle index ee89c0af6a1..3179ba9e2db 100644 --- a/dataflow/build.gradle +++ b/dataflow/build.gradle @@ -38,7 +38,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar */ def createDataflowShaded(shadedPkgName) { tasks.create(name: "dataflow${shadedPkgName}Jar", type: ShadowJar, dependsOn: compileJava, group: 'Build') { - description "Builds dataflow-${shadedPkgName}.jar." + description = "Builds dataflow-${shadedPkgName}.jar." includeEmptyDirs = false archiveBaseName.set("dataflow-${shadedPkgName}") // Without this line, the Maven artifact will have the classifier "all". @@ -68,13 +68,14 @@ createDataflowShaded('nullaway') createDataflowShaded('errorprone') task manual(group: 'Documentation') { - description 'Build the manual' + description = 'Build the manual' def injected = project.objects.newInstance(InjectedExecOps) doLast { injected.execOps.exec { - commandLine 'make', '-C', 'manual' + workingDir = file('manual') + commandLine 'make' } } } @@ -87,7 +88,7 @@ tasks.withType(Test) { } tasks.create(name: 'allDataflowTests', group: 'Verification') { - description 'Run all dataflow analysis tests' + description = 'Run all dataflow analysis tests' // 'allDataflowTests' is automatically populated by testDataflowAnalysis(). } @@ -107,7 +108,7 @@ tasks.create(name: 'allDataflowTests', group: 'Verification') { */ def testDataflowAnalysis(taskName, dirName, className, diff) { tasks.create(name: taskName, dependsOn: [assemble, compileTestJava], group: 'Verification') { - description "Run the ${dirName} dataflow framework test." + description = "Run the ${dirName} dataflow framework test." def injected = project.objects.newInstance(InjectedExecOps) @@ -123,7 +124,7 @@ def testDataflowAnalysis(taskName, dirName, className, diff) { delete("tests/${dirName}/Test.class") doLast { injected.execOps.javaexec { - workingDir = "tests/${dirName}" + workingDir = file("tests/${dirName}") if (!JavaVersion.current().java9Compatible) { jvmArgs += "-Xbootclasspath/p:${configurations.javacJar.asPath}".toString() } @@ -152,7 +153,7 @@ def testDataflowAnalysis(taskName, dirName, className, diff) { } if (diff) { injected.execOps.exec { - workingDir = "tests/${dirName}" + workingDir = file("tests/${dirName}") executable 'diff' args = [ '-u', diff --git a/framework/build.gradle b/framework/build.gradle index 5eb212363b1..c6b4ed07177 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -94,22 +94,22 @@ interface InjectedExecOps { } task cloneAnnotatedJdk() { - description 'Obtain or update the annotated JDK.' + description = 'Obtain or update the annotated JDK.' def injected = project.objects.newInstance(InjectedExecOps) doLast { if (file(annotatedJdkHome).exists()) { injected.execOps.exec { - workingDir annotatedJdkHome + workingDir file(annotatedJdkHome) executable 'git' args = ['pull', '-q'] ignoreExitValue = true } } else { - println 'Cloning annotated JDK repository.' + println "Cloning annotated JDK repository in ${annotatedJdkHome}/../" injected.execOps.exec { - workingDir "${annotatedJdkHome}/../" + workingDir file("${annotatedJdkHome}/../") executable 'git' args = [ 'clone', @@ -129,7 +129,7 @@ task copyAndMinimizeAnnotatedJdkFiles(dependsOn: cloneAnnotatedJdk, group: 'Buil def inputDir = "${annotatedJdkHome}/src" def outputDir = "${buildDir}/generated/resources/annotated-jdk/" - description "Copy annotated JDK files to ${outputDir}. Removes private and package-private methods, method bodies, comments, etc. from the annotated JDK" + description = "Copy annotated JDK files to ${outputDir}. Removes private and package-private methods, method bodies, comments, etc. from the annotated JDK" inputs.dir file(inputDir) outputs.dir file(outputDir) @@ -175,7 +175,7 @@ sourcesJar.dependsOn(copyAndMinimizeAnnotatedJdkFiles) processResources.dependsOn(copyAndMinimizeAnnotatedJdkFiles) task allSourcesJar(type: Jar, group: 'Build') { - description 'Creates a sources jar that includes sources for all Checker Framework classes in framework.jar' + description = 'Creates a sources jar that includes sources for all Checker Framework classes in framework.jar' destinationDirectory = file("${projectDir}/dist") archiveFileName = 'framework-source.jar' from (project(':framework').sourceSets.main.java, @@ -184,7 +184,7 @@ task allSourcesJar(type: Jar, group: 'Build') { } task allJavadocJar(type: Jar, group: 'Build') { - description 'Creates javadoc jar include Javadoc for all of the framework' + description = 'Creates javadoc jar include Javadoc for all of the framework' dependsOn (project(':framework').tasks.javadoc, project(':dataflow').tasks.javadoc, project(':javacutil').tasks.javadoc) @@ -198,7 +198,7 @@ task allJavadocJar(type: Jar, group: 'Build') { } shadowJar { - description 'Creates the "fat" framework.jar in dist' + description = 'Creates the "fat" framework.jar in dist' destinationDirectory = file("${projectDir}/dist") archiveFileName = 'framework.jar' manifest { @@ -217,7 +217,7 @@ checkCompilerMessages { } task loaderTests(dependsOn: 'shadowJar', group: 'Verification') { - description 'Run tests for the annotation class loader' + description = 'Run tests for the annotation class loader' dependsOn(compileTestJava) def injected = project.objects.newInstance(InjectedExecOps) @@ -227,12 +227,8 @@ task loaderTests(dependsOn: 'shadowJar', group: 'Verification') { dependsOn project(':checker').tasks.assemble doLast { injected.execOps.exec { - executable 'make' - args = [ - '-C', - 'tests/annotationclassloader/', - 'all' - ] + workingDir = file('tests/annotationclassloader') + commandLine 'make', 'all' } } } @@ -253,7 +249,7 @@ clean { task delombok { - description 'Delomboks the source code tree in tests/returnsreceiverlombok' + description = 'Delomboks the source code tree in tests/returnsreceiverlombok' def srcDelomboked = 'tests/returnsreceiverdelomboked' def srcJava = 'tests/returnsreceiverlombok' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c82004..cea7a793a84 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew b/gradlew index f5feea6d6b1..f3b75f3b0d4 100755 --- a/gradlew +++ b/gradlew @@ -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