blob: effe4e2139c2907fa0f333434be2a1255badc013 [file] [log] [blame]
plugins {
id 'java-library'
}
dependencies {
api project(':javacutil')
api project(':checker-qual')
// Node implements org.plumelib.util.UniqueId, so this dependency must be "api".
api 'org.plumelib:plume-util:1.5.3'
// External dependencies:
// If you add an external dependency, you must shadow its packages both in the dataflow-shaded
// artifact (see shadowJar block below) and also in checker.jar (see the comment in
// ../build.gradle in the shadowJar block).
}
shadowJar {
archiveFileName = "dataflow-shaded.jar"
// Without this line, the Maven artifact will have the classifier "all".
archiveClassifier = ''
relocate ('org.checkerframework', 'org.checkerframework.shaded') {
// Shade all Checker Framework packages, except for the dataflow qualifiers.
exclude 'org.checkerframework.dataflow.qual.*'
}
// Relocate external dependencies
relocate 'org.plume', "org.checkerframework.shaded.org.plume"
}
artifacts {
archives shadowJar
}
task liveVariableTest(dependsOn: compileTestJava, group: 'Verification') {
description 'Test the live variable analysis test for dataflow framework.'
inputs.file('tests/live-variable/Expected.txt')
inputs.file('tests/live-variable/Test.java')
outputs.file('tests/live-variable/Out.txt')
outputs.file('tests/live-variable/Test.class')
delete('tests/live-variable/Out.txt')
delete('tests/live-variable/Test.class')
doLast {
javaexec {
workingDir = 'tests/live-variable'
if (!JavaVersion.current().java9Compatible) {
jvmArgs += "-Xbootclasspath/p:${configurations.javacJar.asPath}".toString()
}
classpath = sourceSets.test.runtimeClasspath
classpath += sourceSets.test.output
main = 'livevar.LiveVariable'
}
exec {
workingDir = 'tests/live-variable'
executable 'diff'
args = ['-u', 'Expected.txt', 'Out.txt']
}
}
}
task issue3447Test(dependsOn: compileTestJava, group: 'Verification') {
description 'Test issue 3447 test case for backward analysis.'
inputs.file('tests/issue3447/Test.java')
delete('tests/issue3447/Out.txt')
delete('tests/issue3447/Test.class')
doLast {
javaexec {
workingDir = 'tests/issue3447'
if (!JavaVersion.current().java9Compatible) {
jvmArgs += "-Xbootclasspath/p:${configurations.javacJar.asPath}".toString()
}
classpath = sourceSets.test.runtimeClasspath
classpath += sourceSets.test.output
main = 'livevar.LiveVariable'
}
}
}
apply from: rootProject.file("gradle-mvn-push.gradle")
/** Adds information to the publication for uploading the dataflow artifacts to Maven repositories. */
final dataflowPom(publication) {
sharedPublicationConfiguration(publication)
publication.from components.java
// Information that is in all pom files is configured in checker-framework/gradle-mvn-push.gradle.
publication.pom {
name = 'Dataflow'
description = 'Dataflow is a dataflow framework based on the javac compiler.'
licenses {
license {
name = 'GNU General Public License, version 2 (GPL2), with the classpath exception'
url = 'http://www.gnu.org/software/classpath/license.html'
distribution = 'repo'
}
}
}
}
/** Adds information to the publication for uploading the dataflow-shaded artifacts to Maven repositories. */
final dataflowShadedPom(publication) {
sharedPublicationConfiguration(publication)
publication.artifactId = 'dataflow-shaded'
publication.pom {
name = 'Dataflow (shaded)'
description = 'dataflow-shaded is a dataflow framework based on the javac compiler.\n' +
'\n' +
'It differs from the org.checkerframework:dataflow artifact in two ways.\n' +
'First, the packages in this artifact have been renamed to org.checkerframework.shaded.*.\n' +
'Second, unlike the dataflow artifact, this artifact contains the dependencies it requires.'
licenses {
license {
name = 'GNU General Public License, version 2 (GPL2), with the classpath exception'
url = 'http://www.gnu.org/software/classpath/license.html'
distribution = 'repo'
}
}
}
}
publishing {
publications {
dataflow(MavenPublication) {
dataflowPom it
}
dataflowShaded(MavenPublication) {
dataflowShadedPom it
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
}
signing {
sign publishing.publications.dataflow
sign publishing.publications.dataflowShaded
}