-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
116 lines (99 loc) · 3.4 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotlinVersion = "1.2.70"
plugins {
kotlin("jvm").version("1.4.32") // the maximum plugin version still supporting language version 1.2
`java-library`
id("com.atlassian.performance.tools.gradle-release").version("0.8.0")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.2" // the maximum, which still produces 1.1.x metadata required by 1.2.70 kotlin clients
}
}
configurations.all {
// Workaround harvested from https://github.com/atlassian/virtual-users/pull/50/commits/24cdab615dd4c9d7a58cfeb38c1df3585324de6d
if (name.startsWith("kotlinCompiler") || name.startsWith("dokka")) {
return@all
}
resolutionStrategy {
activateDependencyLocking()
failOnVersionConflict()
eachDependency {
when (requested.module.toString()) {
"commons-logging:commons-logging" -> useVersion("1.2")
"org.slf4j:slf4j-api" -> useVersion("1.8.0-alpha2")
}
when (requested.group) {
"org.jetbrains.kotlin" -> useVersion(kotlinVersion)
}
}
}
}
dependencies {
api("com.atlassian.performance.tools:ssh:[1.0.0,3.0.0)")
api("com.github.stephenc.jcip:jcip-annotations:1.0-1")
implementation("com.atlassian.performance.tools:concurrency:[1.0.0,2.0.0)")
implementation("com.atlassian.performance.tools:io:[1.2.0,2.0.0)")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("commons-codec:commons-codec:1.11")
aws(
"ec2",
"s3",
"rds",
"iam",
"sts",
"cloudformation",
"elasticloadbalancing",
"support"
).forEach { api(it) }
log4jCore().forEach { implementation(it) }
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
testImplementation("org.assertj:assertj-core:3.11.1")
}
fun aws(
vararg modules: String
): List<String> = modules
.map { module ->
"com.amazonaws:aws-java-sdk-$module:1.11.817"
}
.plus(log4j("jcl"))
.plus(jaxb())
fun log4jCore(): List<String> = log4j(
"api",
"core",
"slf4j-impl"
)
fun log4j(
vararg modules: String
): List<String> = modules.map { module ->
"org.apache.logging.log4j:log4j-$module:2.17.1"
}
fun jaxb(): List<String> = listOf(
"org.glassfish.jaxb:jaxb-runtime:2.3.0"
)
val cleanLeftovers = task<Test>("awsCleanLeftovers")
cleanLeftovers.description = "Deletes every stack that exceeded its lifespan."
cleanLeftovers.useJUnitPlatform {
includeTags("clean-leftovers")
}
tasks.getByName("test", Test::class).apply {
useJUnitPlatform {
exclude("**/*IT.class")
excludeTags("clean-leftovers")
}
}
val testIntegration = task<Test>("testIntegration") {
useJUnitPlatform {
include("**/*IT.class")
excludeTags("clean-leftovers")
}
// https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-parallel-execution
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
systemProperty("junit.jupiter.execution.parallel.mode.classes.default", "concurrent")
}
tasks["check"].dependsOn(testIntegration)
val wrapper = tasks["wrapper"] as Wrapper
wrapper.gradleVersion = "7.6"
wrapper.distributionType = Wrapper.DistributionType.ALL