Skip to content

Commit

Permalink
Add module-info.java to checker-qual (#6326)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtf90 authored Mar 6, 2024
1 parent 7743e5d commit 2776c6d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ task allJavadoc(type: Javadoc, group: 'Documentation') {
}

classpath = configurations.allProjects
// 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 @@ -622,6 +625,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 @@ -809,7 +814,7 @@ subprojects {
manifest {
attributes('Implementation-Version': "${project.version}")
attributes('Implementation-URL': 'https://checkerframework.org')
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
27 changes: 27 additions & 0 deletions checker-qual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@ plugins {
id("biz.aQute.bnd.builder") version "6.4.0"
}

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 {
Expand Down
44 changes: 44 additions & 0 deletions checker-qual/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* This module contains annotations (type qualifiers) that a programmer writes to specify Java code
* for type-checking by the Checker Framework.
*/
module org.checkerframework.checker.qual {
// javadoc-only dependencies
requires static java.compiler;
requires static java.desktop;
requires static jdk.compiler;

// the .jar file (for the Automatic-Module-Name) is not ready during javadoc
// requires static org.checkerframework.checker;

exports org.checkerframework.checker.builder.qual;
exports org.checkerframework.checker.calledmethods.qual;
exports org.checkerframework.checker.compilermsgs.qual;
exports org.checkerframework.checker.fenum.qual;
exports org.checkerframework.checker.formatter.qual;
exports org.checkerframework.checker.guieffect.qual;
exports org.checkerframework.checker.i18n.qual;
exports org.checkerframework.checker.i18nformatter.qual;
exports org.checkerframework.checker.index.qual;
exports org.checkerframework.checker.initialization.qual;
exports org.checkerframework.checker.interning.qual;
exports org.checkerframework.checker.lock.qual;
exports org.checkerframework.checker.mustcall.qual;
exports org.checkerframework.checker.nullness.qual;
exports org.checkerframework.checker.optional.qual;
exports org.checkerframework.checker.propkey.qual;
exports org.checkerframework.checker.regex.qual;
exports org.checkerframework.checker.signature.qual;
exports org.checkerframework.checker.signedness.qual;
exports org.checkerframework.checker.tainting.qual;
exports org.checkerframework.checker.units.qual;
exports org.checkerframework.common.aliasing.qual;
exports org.checkerframework.common.initializedfields.qual;
exports org.checkerframework.common.reflection.qual;
exports org.checkerframework.common.returnsreceiver.qual;
exports org.checkerframework.common.subtyping.qual;
exports org.checkerframework.common.util.count.report.qual;
exports org.checkerframework.common.value.qual;
exports org.checkerframework.dataflow.qual;
exports org.checkerframework.framework.qual;
}
1 change: 1 addition & 0 deletions docs/manual/contributors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
Mahmood Ali,
Manu Sridharan,
Mark Roberts,
Markus Frohme,
Martin Kellogg,
Matt Mullen,
Maximilian Gama,
Expand Down

0 comments on commit 2776c6d

Please sign in to comment.