-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
120 lines (102 loc) · 3.81 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
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'bjkeller' at '12/7/16 8:08 AM' with Gradle 3.2.1
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/3.2.1/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
implementation 'org.slf4j:slf4j-api:1.7.21'
// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testImplementation 'junit:junit:4.12'
}
test {
testLogging {
events 'started', 'passed'
}
}
task switchToBuggy(type: Copy) {
from "src/main/resources/MyInteger-buggy.java"
into "src/main/java/math/"
rename { String filename -> filename.replace("MyInteger-buggy", "MyInteger")}
}
task switchToZero(type: Copy) {
from "src/main/resources/MyInteger-v0.java"
into "src/main/java/math"
rename { String filename -> filename.replace("MyInteger-v0", "MyInteger")}
}
task switchToOne(type: Copy) {
from "src/main/resources/MyInteger-v1.java"
into "src/main/java/math"
rename { String filename -> filename.replace("MyInteger-v1", "MyInteger")}
}
task tutorialInit {
description "Initialization for tutorial"
doLast {
if (project.hasProperty('pascaliRoot')) {
exec { commandLine "ln", "-s", "${pascaliRoot}/libs/randoop.jar", "randoop.jar"}
mkdir "catalanoimage"
exec { commandLine "ln", "-s", "${pascaliRoot}/corpus/catalano/Catalano.Image/dljc-out/test-classes3/classlist.txt", "catalanoimage/classlist.txt"}
exec { commandLine "ln", "-s", "${pascaliRoot}/corpus/catalano/Catalano.Image/dljc-out/test-classes3/classpath.txt", "catalanoimage/classpath.txt"}
} else {
throw new GradleException("Initialization requires -PpascaliRoot be given")
}
}
}
task cleanRandoopTests(type: Delete) {
delete fileTree("src/test/java") {
include '**/ErrorTest*.java'
include '**/RegressionTest*.java'
}
}
task cleanRandoopErrorTests(type: Delete) {
delete fileTree("src/test/java") {
include '**/ErrorTest*.java'
}
}
task cleanRandoopRegressionTests(type: Delete) {
delete fileTree("src/test/java") {
include '**/RegressionTest*.java'
}
}
task first (dependsOn: ['switchToBuggy', 'cleanRandoopTests' ]) {
description 'Setup for first tutorial task'
}
task second (dependsOn: ['switchToZero' ]) {
description 'Setup for second tutorial task'
}
task third (dependsOn: ['switchToOne']) {
description 'Setup for third tutorial task'
}
task configureCatalanoExample {
doLast {
String pathString = file("catalanoimage/classpath.txt").text + ":randoop.jar";
runCatalanoExample.classpath = files(pathString.tokenize(':'))
}
}
task runCatalanoExample (type: JavaExec) {
dependsOn 'configureCatalanoExample'
enableAssertions = true
main = "randoop.main.Main"
args = ['gentests', '--classlist=catalanoimage/classlist.txt', '--junit-output-dir=src/test/java', '--junit-package-name=catalano', '--timelimit=60', '--outputlimit=2000']
}
task cleanCatalanoTests(type: Delete) {
delete fileTree("src/test/java/catalano") {
include '**/ErrorTest*.java'
include '**/RegressionTest*.java'
}
}