-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.NEW
166 lines (148 loc) · 4.93 KB
/
build.gradle.NEW
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
/**
* Build the TrueJ compiler and package it for distribution.
*
* According to the Gradle documentation,
* after building, TrueJ can be run with
* gradle run --args="<arguments and filenames here>"
* for instance, compiling the truej code for a project named "todo" might be
* gradle run --args="-genout ../todo/generated/ ../todo/src/main/truej/"
*/
plugins {
id 'java-library'
id 'antlr'
}
repositories {
mavenCentral()
}
project.ext {
cukeVersion = '6.10.2'
}
dependencies { // https://mvnrepository.com/artifact/...
// ...org.antlr/antlr4
antlr 'org.antlr:antlr4:4.8-1'
implementation 'it.unibo.alice.tuprolog:tuprolog:3.3.0'
implementation 'org.eclipse.jdt:org.eclipse.jdt.annotation:2.2.600'
testImplementation 'io.cucumber:cucumber-java:' + cukeVersion
testImplementation 'io.cucumber:cucumber-junit:' + cukeVersion
}
generateGrammarSource {
//maxHeapSize = "64m"
arguments += ["-visitor", "-no-listener", "-long-messages"
// , "-package", "tlang"
// , "-o", "tlang"
]
}
java {
// withJavadocJar() // problems with Gradle 6.6
// withSourcesJar() // problems with Gradle 6.6
}
//// Used with plugin 'Java'
//tasks.withType(JavaCompile) {
// //enable compilation in a separate daemon process
// options.fork = true
//}
//compileJava {
// options.compilerArgs.addAll(['--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED'])
// // options.release = 15 // Defaults to compiler release that is used
// // options.compilerArgs.addAll(['--doclint-format', 'html5'])
//}
sourceSets {
main {
java {
srcDir "src/main/java"
srcDir "build/generated-src/antlr/main"
}
}
}
configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}
/** Test all the features, even details and end-to-end tests (but not the prover)
*/
task TestReadyFeatures() {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = ( configurations.cucumberRuntime + sourceSets.main.output
+ sourceSets.test.output )
args = [ '--plugin', 'progress'
, '--plugin', 'html:build/reports/tests/cucumber/ReadyFeatures.html'
, '--glue', 'tlang'
, '--tags', "@Ready and not @InProcess"
, 'src/test/resources/tlang'
]
}
}
}
task TestFeaturesInProgress() {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = ( configurations.cucumberRuntime + sourceSets.main.output
+ sourceSets.test.output )
args = [ '--plugin', 'progress'
, '--plugin', 'html:build/reports/tests/cucumber/FeaturesInProgress.html'
, '--glue', 'tlang'
, '--tags', "@InProgress"
, '--tags', "@testthis"
, 'src/test/resources/tlang/'
]
}
}
}
task TestAtTestthis() { // test Examples and Scenarios with @testthis
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = ( configurations.cucumberRuntime + sourceSets.main.output
+ sourceSets.test.output )
args = [ '--plugin', 'progress'
, '--plugin', 'html:build/reports/tests/cucumber/FeaturesInProgress.html'
, '--glue', 'tlang'
, '--tags', "@testthis"
, 'src/test/resources/tlang/'
]
}
}
}
task CukeHelp () {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = ( configurations.cucumberRuntime + sourceSets.main.output
+ sourceSets.test.output )
args = [ '--help'
]
}
}
}
task TestProverFeatures() {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = ( configurations.cucumberRuntime + sourceSets.main.output
+ sourceSets.test.output )
args = [ '--plugin', 'progress'
, '--plugin', 'html:build/reports/tests/cucumber/ProverFeatures.html'
//, '--glue', ''
//, '--tags', "@testthis"
, 'src/test/resources/ProofTestFeatures'
//, 'src/test/resources/ProofTestFeatures/pl1ha_eTLeanTaP_predicate-calculus.feature'
]
}
}
}
version = '0.0.0'
//// The following will eliminate the errors for duplicated directories/files,
//// which should be fixed in Gradle before I need it.
//task archive(type: Zip) {
// duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
// ...
//}