-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
82 lines (70 loc) · 2.22 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
plugins {
id 'java'
id 'org.gauge' version '2.1.0'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.+")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation 'com.thoughtworks.gauge:gauge-java:+'
testImplementation 'org.htmlunit:htmlunit:4.9.0'
testImplementation 'se.fishtank:css-selectors:2.0'
testImplementation 'org.jsoup:jsoup:1.18.3'
testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation 'org.json:json:20250107'
}
group = 'com.thoughtworks.gauge.test'
version = '0.4.0-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
import org.gauge.gradle.GaugeTask
def languages = ['java', 'js', 'csharp', 'dotnet', 'ruby', 'python']
languages.each {lang ->
tasks.register("${lang}FT", GaugeTask) {
doFirst {
gauge {
specsDir = 'specs'
inParallel = true
env = "ci-${lang}"
tags = "${lang}"
additionalFlags = "--simple-console"
}
}
}
tasks.register("clean${lang}FT") {
doFirst {
delete "reports-${lang}"
if (lang == 'ruby') {
delete 'resources/LocalTemplates/ruby/vendor'
delete 'resources/LocalTemplates/ruby/.buildlock'
delete 'resources/LocalTemplates/ruby/Gemfile.lock'
} else {
delete "resources/LocalTemplates/${lang}"
}
}
}
clean.dependsOn "clean${lang}FT"
}
tasks.withType(Test).configureEach {
// https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#test_framework_implementation_dependencies
// Using JUnitPlatform for running tests
useJUnitPlatform()
}
tasks.withType(GaugeTask).configureEach {
// https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#test_task_default_classpath
testClassesDirs = sourceSets.test.output
classpath = sourceSets.test.runtimeClasspath
}
tasks.register('cleanGauge') {
doFirst {
delete '.gauge'
delete 'logs'
delete 'testLogs'
}
}
clean.dependsOn cleanGauge