forked from znsio/getting-started-with-karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (109 loc) · 3.13 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
import java.text.SimpleDateFormat
buildscript {
ext {
gradleVersionProperty = '7.3.3'
karateVersion = '1.3.0.RC2'
masterThoughtVersion = '5.7.2'
junitPlatformsLauncherVersion = '1.9.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
plugins {
id 'project-report'
id 'eclipse'
id 'java'
id 'idea'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group 'com.znsio.getting-started-with-karate'
version '0.0.1'
sourceCompatibility = 11
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
sourceSets {
test {
resources {
srcDir file('src/test/java')
exclude '**/*.java'
}
}
}
dependencies {
implementation "com.intuit.karate:karate-core:${karateVersion}"
implementation "com.intuit.karate:karate-junit5:${karateVersion}"
implementation "net.masterthought:cucumber-reporting:${masterThoughtVersion}"
implementation "org.junit.platform:junit-platform-launcher:${junitPlatformsLauncherVersion}"
}
task karateDebug(type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = 'com.intuit.karate.cli.Main'
}
test {
useJUnitPlatform()
// Pull karate options into the runtime
systemProperty "karate.options", System.getenv("karate.options")
// Pull karate options into the JVM
systemProperty "karate.env", System.getenv("env")
include '**/*Test*'
// Ensure tests are always run
outputs.upToDateWhen { false }
testLogging {
events "started", "passed", "skipped", "failed"
// show standard out and standard error of the test JVM(s) on the console
showStandardStreams = true
// show full exception trace
exceptionFormat = 'full'
showStackTraces = true
showCauses = true
showExceptions = true
}
// attach debugger
if (System.getProperty('debug', 'false') == 'true') {
jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009'
}
}
shadowJar {
archiveBaseName.set("$project.name")
archiveClassifier.set('')
archiveVersion.set("$project.version")
zip64 true
manifest {
attributes "Main-Class": "com.znsio.FatJarRunner"
}
from sourceSets.test.output
from('.') { include 'gradle/**/*' }
from('.') { include 'gradlew*' }
from('.') { include 'build.gradle' }
from('.') { include 'src/test/**/*' }
destinationDir file("${rootDir}/upload")
doLast {
println "Created jar: ${rootDir}/upload/${project.name}-${project.version}.jar"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
duplicatesStrategy = "include"
archiveClassifier = 'sources'
from sourceSets.test.allJava
}
artifacts {
archives sourcesJar
archives shadowJar
}
task copyToUpload(type: Copy) {
from 'java/test_data.json'
into 'upload/src/test/java'
from 'runAPIWorkflowTests.sh'
into 'upload'
}
test.dependsOn clean
shadowJar.finalizedBy copyToUpload
wrapper {
gradleVersion = gradleVersionProperty
}