-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle.kts
160 lines (124 loc) · 4.97 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.22.RELEASE")
}
}
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven { url = uri("https://dl.bintray.com/epam/reportportal") }
}
plugins {
java
scala
jacoco
application
id("org.springframework.boot") version "1.5.22.RELEASE"
id("io.spring.dependency-management") version "1.0.10.RELEASE"
//kotlin("jvm") version "1.3.72"
//kotlin("plugin.spring") version "1.3.72"
}
application {
mainClassName = "org.company.OrderApplication"
}
group = group
version = version
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.jar {
val artifactId: String by project
baseName = "$artifactId"
}
val gatling by configurations.creating
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web:1.5.22.RELEASE")
implementation("com.epam.reportportal:commons-model:5.0.0")
implementation("org.scala-lang:scala-library:2.13.3")
implementation("ch.qos.logback:logback-core:1.2.3")
implementation("ch.qos.logback:logback-classic:1.2.3")
implementation("ch.qos.logback:logback-access:1.2.3")
implementation("ch.qos.logback.contrib:logback-json-classic:0.1.5")
implementation("ch.qos.logback.contrib:logback-jackson:0.1.5")
implementation("com.fasterxml.jackson.core:jackson-core:2.12.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.12.1")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.12.1")
implementation("net.logstash.logback:logstash-logback-encoder:4.9")
implementation("org.slf4j:slf4j-api:1.7.18")
testImplementation("junit:junit:4.13.1")
testImplementation("org.springframework.boot:spring-boot-starter-test") { exclude(group = "org.junit.vintage", module = "junit-vintage-engine") }
testImplementation("com.epam.reportportal:logger-java-logback:5.0.1")
testImplementation("com.intuit.karate:karate-mock-servlet:1.0.1")
testImplementation("com.intuit.karate:karate-junit5:1.0.1")
testImplementation("com.intuit.karate:karate-gatling:1.0.1")
gatling("org.scala-lang:scala-library:2.13.3")
gatling("io.gatling:gatling-app:3.4.0")
gatling("io.gatling.highcharts:gatling-charts-highcharts:3.4.0")
gatling("com.intuit.karate:karate-gatling:1.0.1")
// Align versions of all Kotlin components, JDK8, Test Library, JUnit
//implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
//implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
//testImplementation("org.jetbrains.kotlin:kotlin-test")
//testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
tasks.bootRun {
systemProperties(System.getProperties().mapKeys { it.key as String })
}
sourceSets.getByName("test") {
resources.srcDir("src/test/resources")
resources.srcDir("src/test/java")
resources.srcDir("src/test/scala")
}
tasks.withType<Test> {
if(!project.gradle.startParameter.taskNames.contains("gatlingRun")) {
gradle.startParameter.excludedTaskNames += ":compileTestScala"
}
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
events = mutableSetOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
}
systemProperties(System.getProperties().mapKeys { it.key as String })
systemProperty("karate.options", System.getProperty("karate.options"))
systemProperty("karate.env", System.getProperty("karate.env"))
outputs.upToDateWhen { false }
finalizedBy("jacocoTestReport")
}
tasks.register<JavaExec>("gatlingRun") {
dependsOn("testClasses")
description = "Run Gatling Tests"
val gatling = File("${buildDir}/reports/gatling")
gatling.mkdirs()
classpath = sourceSets.test.get().runtimeClasspath
main = "io.gatling.app.Gatling"
val simulation = System.getProperty("simulation")
args = mutableListOf<String>("-s", "$simulation", "-rf", "${buildDir}/reports/gatling")
systemProperties(System.getProperties().mapKeys { it.key as String })
}
tasks.register<JavaExec>("gatlingReport") {
dependsOn("testClasses")
description = "Run Gatling Report"
classpath = sourceSets.test.get().runtimeClasspath
main = "io.gatling.app.Gatling"
val simulationFolder = System.getProperty("simulationFolder")
args = mutableListOf<String>("-ro", "$simulationFolder")
systemProperties(System.getProperties().mapKeys { it.key as String })
}
tasks.register<JavaExec>("karateExecute") {
classpath = sourceSets.test.get().runtimeClasspath
main = System.getProperty("mainClass")
}
tasks.withType<ScalaCompile>().configureEach {
scalaCompileOptions.apply {
targetCompatibility = "1.8"
}
}