-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
115 lines (92 loc) · 3.1 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
plugins {
id 'java'
id 'maven-publish'
id 'eclipse'
}
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
configurations {
// for putting Error Prone javac in bootclasspath for running tests
errorproneJavac
}
ext.versions = [
checkerFramework: "3.8.0",
]
sourceCompatibility = 1.8
def checkerframework_local = true // Set this variable to [true] while using local version of checker framework.
dependencies {
// This dependency is found on compile classpath of this component and consumers.
if (checkerframework_local) {
implementation files('checker-framework/dist/checker.jar')
implementation files('checker-framework/dist/checker-qual.jar')
}
else {
implementation "org.checkerframework:checker:${versions.checkerFramework}"
}
implementation "com.google.guava:guava:30.1-jre"
implementation "org.apache.commons:commons-lang3:3.11"
implementation "org.apache.commons:commons-io:1.3.2"
compileOnly "com.google.errorprone:javac:9+181-r4173-1"
// Testing
testImplementation 'junit:junit:4.13'
if (checkerframework_local) {
testCompile files('checker-framework/dist/checker-qual.jar')
testCompile files('checker-framework/dist/checker.jar')
}
testCompile "org.checkerframework:framework-test:${versions.checkerFramework}"
errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
}
tasks.withType(JavaCompile).all {
options.compilerArgs.add("-Xlint:all")
}
// Add `mavenLocal()` in `repositories`, then run `./gradlew publishToMavenLocal`
// to publish your checker to your local Maven repository.
publishing {
publications {
maven(MavenPublication) {
groupId = 'edu.kit.iti'
artifactId = 'property-checker'
version = '1.0.2'
from components.java
}
}
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes("Main-Class": "org.checkerframework.framework.util.CheckerMain")
}
destinationDirectory = file("$rootDir")
}
test {
inputs.files("tests/property")
systemProperty 'jmlDialect', System.getProperty('jmlDialect')
systemProperty 'translationOnly', System.getProperty('translationOnly')
if (!JavaVersion.current().java9Compatible) {
jvmArgs "-Xbootclasspath/p:${configurations.errorproneJavac.asPath}"
}
testLogging.showStandardStreams = true
}
clean.doFirst {
delete "${rootDir}/tests/build/"
delete "${rootDir}/../property-checker-out/"
}
task printClasspath {
description 'Prints the runtime classpath of the checker. When using the checker to typecheck' +
'another project, you should put the result of running this task on either the processor' +
'path or the classpath of the target project.'
doLast {
println sourceSets.main.runtimeClasspath.asPath
}
}