-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
217 lines (166 loc) · 6.36 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.netflix.nebula:gradle-ospackage-plugin:6.2.1"
classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0'
}
}
plugins {
id 'com.google.cloud.tools.jib' version '1.8.0'
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: "nebula.ospackage"
apply plugin: 'nebula.ospackage-application'
apply plugin: 'com.github.johnrengelman.shadow'
group 'com.thelastpickle'
version '5.0.0'
sourceCompatibility = 1.8
application {
applicationName = "tlp-stress"
mainClassName = "com.thelastpickle.tlpstress.MainKt"
}
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile group: 'com.beust', name: 'jcommander', version: '1.72'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
compile group: 'org.apache.commons', name: 'commons-text', version: '1.3'
// https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core
compile group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.6.0'
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+"
// https://mvnrepository.com/artifact/org.reflections/reflections
compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
compile group: "org.apache.logging.log4j", name: "log4j-api", version: "2.17.1"
compile group: "org.apache.logging.log4j", name: "log4j-core", version:"2.17.1"
compile "org.apache.logging.log4j:log4j-api-kotlin:1.0.0"
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j18-impl
// maps the datastax driver slf4j calls to log4j
compile 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0'
// needed for yaml logging configurations
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.8'
// https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-core
// need to use the same version as datastax driver
compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.2.2'
// https://mvnrepository.com/artifact/com.google.guava/guava
compile group: 'com.google.guava', name: 'guava', version: '19.0'
// https://mvnrepository.com/artifact/com.github.ajalt/mordant
compile group: 'com.github.ajalt', name: 'mordant', version: '1.1.0'
compile 'io.prometheus:simpleclient:0.6.0'
compile 'io.prometheus:simpleclient_dropwizard:0.6.0'
compile 'io.prometheus:simpleclient_httpserver:0.6.0'
compile group: 'me.tongfei', name: 'progressbar', version: '0.7.2'
compile 'org.apache.commons:commons-math3:3.6.1'
// exporting dropwizard metrics
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.1.0'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testCompile "org.jetbrains.kotlin:kotlin-test"
testCompile "org.jetbrains.kotlin:kotlin-test-junit"
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.0'
testCompile "io.mockk:mockk:1.9.3"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
sourceSets {
main.java.srcDirs += "src/main/kotlin"
test.java.srcDirs += "src/test/kotlin"
}
test {
useJUnitPlatform()
}
task docs(type:Exec) {
dependsOn("shadowJar")
dependsOn("generateExamples")
environment "TLP_STRESS_VERSION", "${version}"
commandLine 'docker-compose', 'up', 'docs'
group = "Documentation"
description = "Build website documentation"
}
task generateExamples(type: Exec) {
dependsOn("shadowJar")
commandLine "manual/generate_examples.sh"
group = "Documentation"
description = "Generate examples for documentation"
}
jib {
to {
image = "thelastpickle/tlp-stress"
tags = [version, "latest"]
}
}
ospackage {
os = LINUX
link("/usr/local/bin/tlp-stress", "/opt/tlp-stress/bin/tlp-stress" )
packager "Jon Haddad"
maintainer "Jon Haddad"
vendor "The Last Pickle"
url "http://thelastpickle.com/tlp-stress/"
license "Apache License 2.0"
description "Stress Tool for Apache Cassandra by The Last Pickle"
}
buildDeb {
distribution "weezy,bionic,xenial,jessie"
requires("openjdk-8-jre")
group = "build"
}
buildRpm {
requires("java-1.8.0-openjdk")
user "root"
group = "build"
}
task buildAll {
group = "build"
dependsOn "buildDeb"
dependsOn "buildRpm"
dependsOn "distTar"
}
assemble.mustRunAfter clean
applicationDistribution.from("LICENSE.txt") {
into ""
}
task uploadDeb(type: Exec) {
group = "Publish"
workingDir 'build/distributions'
def debPackage = "tlp-stress_${version}_all.deb"
// get the deb package
logger.info("Uploading DEB $debPackage")
commandLine "curl", "-T", debPackage, "-u", System.getenv("BINTRAY_USER") + ":" + System.getenv("BINTRAY_KEY"), "https://api.bintray.com/content/thelastpickle/tlp-tools-deb/tlp-stress/${version}/$debPackage;deb_distribution=weezy,bionic,jessie,xenial;deb_component=main;deb_architecture=amd64;publish=1"
}
task uploadRpm(type: Exec) {
group = "Publish"
workingDir 'build/distributions'
def rpmPackage = "tlp-stress-${version}.noarch.rpm"
logger.info("Uploading RPM $rpmPackage")
commandLine "curl", "-T", rpmPackage, "-u", System.getenv("BINTRAY_USER") + ":" + System.getenv("BINTRAY_KEY"), "https://api.bintray.com/content/thelastpickle/tlp-tools-rpm/tlp-stress/${version}/$rpmPackage;publish=1"
}
task uploadTar(type:Exec) {
group = "Publish"
workingDir 'build/distributions'
def tarball = "tlp-stress-${version}.tar"
logger.info("Uploading Tar $tarball")
commandLine "curl", "-T", tarball, "-u", System.getenv("BINTRAY_USER") + ":" + System.getenv("BINTRAY_KEY"), "https://api.bintray.com/content/thelastpickle/tlp-tools-tarball/tlp-stress/${version}/$tarball;publish=1"
}
task uploadAll {
group = "Publish"
dependsOn "jib"
dependsOn "uploadDeb"
dependsOn "uploadRpm"
dependsOn "uploadTar"
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}