3 sourceCompatibility = 1.8
4 targetCompatibility = 1.8
11 testImplementation "junit:junit:4.12"
16 java.srcDirs = ["src/annotations"]
17 java.outputDir = file("${buildDir}/annotations")
20 java.srcDirs = ["src/main"]
21 java.outputDir = file("${buildDir}/main")
22 compileClasspath += sourceSets.annotations.output
25 java.srcDirs = ["src/examples"]
26 java.outputDir = file("${buildDir}/examples")
27 compileClasspath += sourceSets.main.output
30 java.srcDirs = ["src/classes"]
31 java.outputDir = file("${buildDir}/classes")
32 compileClasspath += sourceSets.main.output + sourceSets.annotations.output
35 java.srcDirs = ["src/peers"]
36 java.outputDir = file("${buildDir}/peers")
37 compileClasspath += sourceSets.main.output + sourceSets.annotations.output
40 java.srcDirs = ["src/tests"]
41 java.outputDir = file("${buildDir}/tests")
42 compileClasspath += sourceSets.annotations.output + sourceSets.classes.output + sourceSets.peers.output
43 runtimeClasspath += compileClasspath
51 task compile(type: Copy) {
53 description = "Compiles all JPF core sources."
55 // These are automatic generated tasks from the Java Gradle Plugin.
56 // Gradle is able to infer the ordering of the source sets
57 // due to the compileClasspath attribute
58 dependsOn compileTestJava, compileExamplesJava
60 // Copies build.properties file to the build directory
61 from "build.properties"
62 into sourceSets.main.java.outputDir.path + "/gov/nasa/jpf"
65 task jpfClassesJar(type: Jar) {
66 archiveName = "jpf-classes.jar"
67 destinationDir = file("${buildDir}")
69 description = "Creates the ${archiveName} file."
74 from sourceSets.classes.java.outputDir
75 from sourceSets.annotations.java.outputDir
76 from(sourceSets.main.java.outputDir) {
77 include "gov/nasa/jpf/JPFShell.class"
78 include "gov/nasa/jpf/vm/Verify.class"
79 include "gov/nasa/jpf/util/TypeRef.class"
80 include "gov/nasa/jpf/util/test/TestJPF.class"
81 include "gov/nasa/jpf/util/test/TestMultiProcessJPF.class"
82 include "gov/nasa/jpf/util/test/TestJPFHelper.class"
86 task jpfJar(type: Jar) {
87 archiveName = "jpf.jar"
88 destinationDir = file("${buildDir}")
90 description = "Creates the ${archiveName} file."
95 from sourceSets.main.java.outputDir
96 from sourceSets.peers.java.outputDir
97 from sourceSets.annotations.java.outputDir
98 from(sourceSets.classes.java.outputDir) {
99 include "org/junit/*.class"
104 "Built-By": System.getProperty("user.name"),
105 "Implementation-Vendor": "NASA Ames Research Center",
106 "Implementation-Title": "Java Pathfinder core system",
107 "Implementation-Version": "1234" //FIXME
112 task annotationsJar(type: Jar) {
113 archiveName = "jpf-annotations.jar"
114 destinationDir = file("${buildDir}")
116 description = "Creates the ${archiveName} file."
121 from sourceSets.annotations.java.outputDir
124 task classloaderSpecificTestsJar(type: Jar) {
125 archiveName = "classloader_specific_tests.jar"
126 destinationDir = file("${buildDir}")
128 description = "Creates the ${archiveName} file."
133 from(sourceSets.test.java.outputDir) {
134 include "classloader_specific_tests/*.class"
138 task runJpfJar(type: Jar) {
139 archiveName = "RunJPF.jar"
140 destinationDir = file("${buildDir}")
142 description = "Creates the ${archiveName} file."
147 from(sourceSets.main.java.outputDir) {
148 include "gov/nasa/jpf/tool/Run.class"
149 include "gov/nasa/jpf/tool/RunJPF.class"
150 include "gov/nasa/jpf/Config.class"
151 include "gov/nasa/jpf/ConfigChangeListener.class"
152 include "gov/nasa/jpf/Config\$MissingRequiredKeyException.class"
153 include "gov/nasa/jpf/JPFClassLoader.class"
154 include "gov/nasa/jpf/JPFShell.class"
155 include "gov/nasa/jpf/JPFException.class"
156 include "gov/nasa/jpf/JPFConfigException.class"
157 include "gov/nasa/jpf/JPFTargetException.class"
158 include "gov/nasa/jpf/util/JPFSiteUtils.class"
159 include "gov/nasa/jpf/util/FileUtils.class"
160 include "gov/nasa/jpf/util/StringMatcher.class"
161 include "gov/nasa/jpf/util/Pair.class"
165 "Built-By": System.getProperty("user.name"),
166 "Implementation-Vendor": "NASA Ames Research Center",
167 "Implementation-Title": "Java Pathfinder core launch system",
168 "Implementation-Version": "1234", //FIXME
169 "Main-Class": "gov.nasa.jpf.tool.RunJPF"
174 task runTestJar(type: Jar) {
175 archiveName = "RunTest.jar"
176 destinationDir = file("${buildDir}")
178 description = "Creates the ${archiveName} file."
183 from(sourceSets.main.java.outputDir) {
184 include "gov/nasa/jpf/tool/Run.class"
185 include "gov/nasa/jpf/tool/RunTest.class"
186 include "gov/nasa/jpf/tool/RunTest\$Failed.class"
187 include "gov/nasa/jpf/Config.class"
188 include "gov/nasa/jpf/ConfigChangeListener.class"
189 include "gov/nasa/jpf/Config\$MissingRequiredKeyException.class"
190 include "gov/nasa/jpf/JPFClassLoader.class"
191 include "gov/nasa/jpf/JPFException.class"
192 include "gov/nasa/jpf/JPFConfigException.class"
193 include "gov/nasa/jpf/util/JPFSiteUtils.class"
194 include "gov/nasa/jpf/util/FileUtils.class"
195 include "gov/nasa/jpf/util/StringMatcher.class"
196 include "gov/nasa/jpf/util/DevNullPrintStream.class"
200 "Built-By": System.getProperty("user.name"),
201 "Implementation-Vendor": "NASA Ames Research Center",
202 "Implementation-Title": "Java Pathfinder test launch system",
203 "Implementation-Version": "1234", // FIXME
204 "Main-Class": "gov.nasa.jpf.tool.RunTest"
211 description = "Generates the core JPF jar files."
213 dependsOn classloaderSpecificTestsJar, annotationsJar,
214 jpfClassesJar, jpfJar, runJpfJar,
220 description = "Runs core regression tests."
224 enableAssertions = true
227 maxHeapSize = "1024m"
229 include "**/*Test.class"
230 exclude "**/SplitInputStreamTest.class"
231 exclude "**/JPF_*.class"
233 // XXX Tests temporarily ignored because they are not fully supported in the Gradle build yet
234 new File("failing-tests.txt").eachLine { failedTestClass ->
235 def ignoredPath = "**/" + failedTestClass.replace(".", "/") + ".class"
240 events "passed", "skipped", "failed"
243 afterSuite { testDescriptor, result ->
244 if (!testDescriptor.parent) {
245 println "Test Execution: ${result.resultType}"
247 def summaryFields = ["${result.testCount} tests",
248 "${result.successfulTestCount} passed",
249 "${result.failedTestCount} failed",
250 "${result.skippedTestCount} skipped"]
252 println "Summary: " + summaryFields.join(", ")
257 defaultTasks "buildJars"