-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
119 lines (101 loc) · 3.84 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
import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension
import org.apache.tools.ant.taskdefs.condition.Os.*
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.nio.file.Paths
import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorPlugin
import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator
import guru.nidi.graphviz.attribute.Color
import guru.nidi.graphviz.attribute.Style
val kotlinVersion = "1.2.30"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.vanniktech:gradle-dependency-graph-generator-plugin:0.5.0")
}
}
plugins {
kotlin("jvm").version("1.2.30")
id("com.atlassian.performance.tools.gradle-release").version("0.4.3")
`java-library`
}
plugins.apply("com.vanniktech.dependency.graph.generator")
configurations.all {
resolutionStrategy {
activateDependencyLocking()
failOnVersionConflict()
eachDependency {
when (requested.module.toString()) {
"com.google.guava:guava" -> useVersion("23.6-jre")
"org.apache.commons:commons-csv" -> useVersion("1.4")
"commons-logging:commons-logging" -> useVersion("1.2")
"org.apache.httpcomponents:httpclient" -> useVersion("4.5.5")
"org.apache.httpcomponents:httpcore" -> useVersion("4.4.9")
"org.codehaus.plexus:plexus-utils" -> useVersion("3.1.0")
"org.slf4j:slf4j-api" -> useVersion("1.8.0-alpha2")
"com.jcraft:jzlib" -> useVersion("1.1.3")
"com.google.code.gson:gson" -> useVersion("2.8.2")
"org.jsoup:jsoup" -> useVersion("1.10.2")
"com.fasterxml.jackson.core:jackson-core" -> useVersion("2.9.4")
}
}
}
}
val jptDependenciesGenerator = Generator(
"jptLibraries",
{ dependency -> dependency.moduleGroup.startsWith("com.atlassian.performance.tools") },
{ _ -> true },
{ node, _ -> node.add(Style.FILLED, Color.rgb("#ffcb2b")) }
)
configure<DependencyGraphGeneratorExtension> {
generators = listOf(jptDependenciesGenerator)
}
dependencies {
api("com.atlassian.performance.tools:workspace:[2.0.0,3.0.0)")
api("com.atlassian.performance.tools:report:[2.1.0,3.0.0)")
api("com.atlassian.performance.tools:infrastructure:[2.1.0,3.0.0)")
listOf(
"org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlinVersion",
"com.atlassian.performance.tools:aws-resources:[1.0.0,2.0.0)",
"com.atlassian.performance.tools:aws-infrastructure:[1.0.0,2.0.0)",
"com.atlassian.performance.tools:jira-software-actions:[1.0.0,2.0.0)",
"com.atlassian.performance.tools:virtual-users:[2.2.0,3.0.0)"
).plus(
log4jCore()
).forEach { implementation(it) }
listOf(
"junit:junit:4.12",
"org.assertj:assertj-core:3.11.0"
).forEach { testCompile(it) }
}
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.10.0"
}
tasks.getByName("test", Test::class).apply {
useJUnit {
excludeCategories("com.atlassian.performance.tools.jiraperformancetests.AcceptanceCategory")
}
}
val testAcceptance = task<Test>("testAcceptance") {
dependsOn("publishToMavenLocal")
systemProperty("jpt.version", version)
maxParallelForks = 2
}
tasks.withType(Test::class.java) {
val shadowJarTask = tasks.getByPath(":reference-virtual-users:shadowJar")
dependsOn(shadowJarTask)
systemProperty("jpt.virtual-users.shadow-jar", shadowJarTask.outputs.files.files.first())
}
tasks["release"].dependsOn(testAcceptance)
task<Wrapper>("wrapper") {
gradleVersion = "4.9"
distributionType = Wrapper.DistributionType.ALL
}