-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
105 lines (79 loc) · 2.72 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
apply plugin: "java"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
}
// find home directory
ext.userHome = System.getProperty("user.home")
// find JPF's site.properties
Properties siteProperties = new java.util.Properties()
try {
FileInputStream file = new FileInputStream("${userHome}/.jpf/site.properties")
siteProperties.load(file)
file.close()
} catch (FileNotFoundException e) {
throw new GradleException("Please install jpf-core first and add the property 'jpf-core' to ${userHome}/.jpf/site.properties pointing to the jpf-core installation")
}
// find jpf-core
ext.jpfCoreExists = false
ext.jpfCore = siteProperties.getProperty("jpf-core")
if (jpfCore != null) {
jpfCore = jpfCore.replace('${user.home}', userHome)
jpfCoreExists = new File(jpfCore).exists()
}
if (!jpfCoreExists) {
throw new GradleException("${userHome}/.jpf/site.properties points to the jpf-core installation at ${jpfCore} but that directory does not exist")
}
dependencies {
implementation files("${jpfCore}/build/jpf.jar")
testImplementation "junit:junit:4.12"
}
apply from: "gradle/source-sets.gradle"
task compile {
group = "jpf-label build"
description = "Compiles all jpf-label sources."
dependsOn compileTestJava
dependsOn compileExamplesJava
}
task createJpfLabelJar(type: Jar) {
archiveName = "jpf-label.jar"
destinationDir = file("${buildDir}")
group = "jpf-label jars"
description = "Creates the ${archiveName} file."
dependsOn compile
from sourceSets.main.java.outputDir
}
task buildJars {
group = "jpf-label build"
description = "Generates all jpf-label jar files."
dependsOn createJpfLabelJar
}
task api(type: Javadoc) {
group = "documentation"
description = "Generates the jpf-label API."
source = sourceSets.main.allJava
classpath = configurations.testCompileClasspath
}
test {
description = "Runs tests"
dependsOn buildJars
forkEvery = 1
enableAssertions = true
maxHeapSize = "1024m"
include "**/*Test.class"
testLogging {
events "passed", "skipped", "failed"
}
afterSuite { testDescriptor, result ->
if (!testDescriptor.parent) {
println "Test Execution: ${result.resultType}"
def summaryFields = ["${result.testCount} tests",
"${result.successfulTestCount} passed",
"${result.failedTestCount} failed",
"${result.skippedTestCount} skipped"]
println "Summary: " + summaryFields.join(", ")
}
}
}
defaultTasks "buildJars"