forked from javapathfinder/jpf-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
239 lines (194 loc) · 6.7 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
apply plugin: "java"
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.11.0"
}
}
dependencies {
testImplementation "junit:junit:4.12"
}
apply plugin: "com.palantir.git-version"
version gitVersion()
def gitDetails = versionDetails()
ext.manifestCommonAttrbutes = manifest {
attributes(
"Built-By": System.getProperty("user.name"),
"Implementation-Vendor": "NASA Ames Research Center",
"Specification-Version": gitDetails.lastTag,
"Implementation-Version": gitDetails.gitHashFull
)
}
apply from: "gradle/ide-support.gradle"
apply from: "gradle/distribution.gradle"
apply from: "gradle/source-sets.gradle"
apply from: "gradle/build-resources.gradle"
task compile {
group = "JPF Build"
description = "Compiles all JPF core sources."
// These are automatic generated tasks from the Java Gradle Plugin.
// Gradle is able to infer the order of the source sets
// due to the compileClasspath attribute
dependsOn compileTestJava
dependsOn compileExamplesJava
}
task createJpfClassesJar(type: Jar) {
archiveName = "jpf-classes.jar"
destinationDir = file("${buildDir}")
group = "JPF Jars"
description = "Creates the ${archiveName} file."
dependsOn compile
dependsOn copyResources
from sourceSets.classes.java.outputDir
from sourceSets.annotations.java.outputDir
from(sourceSets.main.java.outputDir) {
include "gov/nasa/jpf/JPFShell.class"
include "gov/nasa/jpf/vm/Verify.class"
include "gov/nasa/jpf/util/TypeRef.class"
include "gov/nasa/jpf/util/test/TestJPF.class"
include "gov/nasa/jpf/util/test/TestMultiProcessJPF.class"
include "gov/nasa/jpf/util/test/TestJPFHelper.class"
}
}
task createJpfJar(type: Jar) {
archiveName = "jpf.jar"
destinationDir = file("${buildDir}")
group = "JPF Jars"
description = "Creates the ${archiveName} file."
dependsOn compile
dependsOn copyResources
from sourceSets.main.java.outputDir
from sourceSets.peers.java.outputDir
from sourceSets.annotations.java.outputDir
from(sourceSets.classes.java.outputDir) {
include "org/junit/*.class"
}
manifest {
attributes "Implementation-Title": "Java Pathfinder core system"
from manifestCommonAttrbutes
}
}
task createAnnotationsJar(type: Jar) {
archiveName = "jpf-annotations.jar"
destinationDir = file("${buildDir}")
group = "JPF Jars"
description = "Creates the ${archiveName} file."
dependsOn compile
dependsOn copyResources
from sourceSets.annotations.java.outputDir
}
task createClassloaderSpecificTestsJar(type: Jar) {
archiveName = "classloader_specific_tests.jar"
destinationDir = file("${buildDir}")
group = "JPF Jars"
description = "Creates the ${archiveName} file."
dependsOn compile
dependsOn copyResources
from(sourceSets.test.java.outputDir) {
include "classloader_specific_tests/*.class"
}
}
task createRunJpfJar(type: Jar) {
archiveName = "RunJPF.jar"
destinationDir = file("${buildDir}")
description = "Creates the ${archiveName} file."
group = "JPF Jars"
dependsOn compile
dependsOn copyResources
from(sourceSets.main.java.outputDir) {
include "gov/nasa/jpf/tool/Run.class"
include "gov/nasa/jpf/tool/RunJPF.class"
include "gov/nasa/jpf/Config.class"
include "gov/nasa/jpf/ConfigChangeListener.class"
include "gov/nasa/jpf/Config\$MissingRequiredKeyException.class"
include "gov/nasa/jpf/JPFClassLoader.class"
include "gov/nasa/jpf/JPFShell.class"
include "gov/nasa/jpf/JPFException.class"
include "gov/nasa/jpf/JPFConfigException.class"
include "gov/nasa/jpf/JPFTargetException.class"
include "gov/nasa/jpf/util/JPFSiteUtils.class"
include "gov/nasa/jpf/util/FileUtils.class"
include "gov/nasa/jpf/util/StringMatcher.class"
include "gov/nasa/jpf/util/Pair.class"
}
manifest {
attributes(
"Implementation-Title": "Java Pathfinder core launch system",
"Main-Class": "gov.nasa.jpf.tool.RunJPF"
)
from manifestCommonAttrbutes
}
}
task createRunTestJar(type: Jar) {
archiveName = "RunTest.jar"
destinationDir = file("${buildDir}")
description = "Creates the ${archiveName} file."
group = "JPF Jars"
dependsOn compile
dependsOn copyResources
from(sourceSets.main.java.outputDir) {
include "gov/nasa/jpf/tool/Run.class"
include "gov/nasa/jpf/tool/RunTest.class"
include "gov/nasa/jpf/tool/RunTest\$Failed.class"
include "gov/nasa/jpf/Config.class"
include "gov/nasa/jpf/ConfigChangeListener.class"
include "gov/nasa/jpf/Config\$MissingRequiredKeyException.class"
include "gov/nasa/jpf/JPFClassLoader.class"
include "gov/nasa/jpf/JPFException.class"
include "gov/nasa/jpf/JPFConfigException.class"
include "gov/nasa/jpf/util/JPFSiteUtils.class"
include "gov/nasa/jpf/util/FileUtils.class"
include "gov/nasa/jpf/util/StringMatcher.class"
include "gov/nasa/jpf/util/DevNullPrintStream.class"
}
manifest {
attributes(
"Implementation-Title": "Java Pathfinder test launch system",
"Main-Class": "gov.nasa.jpf.tool.RunTest"
)
from manifestCommonAttrbutes
}
}
task buildJars {
group = "JPF Build"
description = "Generates all core JPF jar files."
dependsOn createClassloaderSpecificTestsJar
dependsOn createAnnotationsJar
dependsOn createJpfClassesJar
dependsOn createJpfJar
dependsOn createRunJpfJar
dependsOn createRunTestJar
}
test {
description = "Runs core regression tests."
dependsOn buildJars
forkEvery = 1
enableAssertions = true
maxHeapSize = "1024m"
include "**/*Test.class"
exclude "**/SplitInputStreamTest.class"
exclude "**/JPF_*.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"