-
Notifications
You must be signed in to change notification settings - Fork 140
/
build.gradle
133 lines (113 loc) · 4.1 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
plugins {
id 'scala'
id 'idea'
id 'distribution'
id 'de.undercouch.download' version '3.2.0'
id "com.github.hierynomus.license" version "0.13.1"
}
def scalaVersion = "2.11.8"
def mesosVersion = "0.28.0"
ext.kafkaVersion = project.hasProperty("kafkaVersion") ? project.getProperty("kafkaVersion") : "1.1.0"
def kafkaMajorVersion="${kafkaVersion.split("\\.").take(2).join("_")}"
def kafkaScalaVersion=scalaVersion.split("\\.").take(2).join(".")
def jettyVersion = "9.0.4.v20130625"
def jerseyVersion = "2.24"
def jacksonVersion = "2.9.5"
version = new File('src/scala/main/ly/stealth/mesos/kafka/Config.scala')
.readLines()
.findResult({ x -> x.contains("val value = \"") ? x.substring(x.indexOf("\"") + 1, x.lastIndexOf("\"")) : null })
jar.archiveName = "kafka-mesos-${version}-kafka_$kafkaScalaVersion-${kafkaVersion.replace('_', '.')}.jar"
repositories {
mavenCentral()
flatDir { dirs 'lib' }
}
license {
header rootProject.file('license.hdr')
exclude "**/*.json"
}
buildDir = 'out/gradle'
libsDirName = '../../'
distsDirName = '../../'
sourceSets {
main {
scala {
srcDirs = [
'src/scala/main',
'src/scala/iface/base/',
"src/scala/iface/$kafkaMajorVersion/"
]
}
}
test {
scala { srcDirs = ['src/test'] }
}
}
dependencies {
compile "org.scala-lang:scala-library:$scalaVersion"
compile "org.apache.mesos:mesos:$mesosVersion"
compile name: "util-mesos-0.1.0.0"
compile "com.google.protobuf:protobuf-java:2.5.0"
compile "log4j:log4j:1.2.17"
compile "net.sf.jopt-simple:jopt-simple:4.8"
compile "org.eclipse.jetty:jetty-http:$jettyVersion"
compile "org.eclipse.jetty:jetty-io:$jettyVersion"
compile "org.eclipse.jetty:jetty-security:$jettyVersion"
compile "org.eclipse.jetty:jetty-server:$jettyVersion"
compile "org.eclipse.jetty:jetty-servlet:$jettyVersion"
compile "org.eclipse.jetty:jetty-util:$jettyVersion"
compile "org.glassfish.jersey.core:jersey-server:$jerseyVersion"
compile "com.google.guava:guava:14.0.1"
compile "org.glassfish.jersey.containers:jersey-container-servlet:$jerseyVersion"
compile "org.glassfish.jersey.containers:jersey-container-servlet-core:$jerseyVersion"
compile "org.glassfish.jersey.containers:jersey-container-jetty-http:$jerseyVersion"
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jerseyVersion"
compile "javax.servlet:javax.servlet-api:3.0.1"
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.fasterxml.jackson.module:jackson-module-scala_$kafkaScalaVersion:$jacksonVersion"
testCompile 'junit:junit:4.12'
testCompile 'com.101tec:zkclient:0.7'
compile ("org.apache.kafka:kafka_$kafkaScalaVersion:$kafkaVersion") {
exclude group: "javax.jms"
exclude group: "com.sun.jdmk"
exclude group: "com.sun.jmx"
exclude group: "junit"
exclude group: "jline"
exclude module: "com.yammer.metrics", group: "metrics-core"
}
runtime "com.yammer.metrics:metrics-core:2.2.0"
}
jar {
dependsOn 'test'
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "*"
exclude "about_files/*"
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest.attributes("Main-Class": "ly.stealth.mesos.kafka.cli.Cli")
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}
distributions.main {
contents {
from(rootDir) {
include jar.archiveName
include "README.md"
include "LICENSE"
include "kafka-mesos.properties"
include "kafka-mesos.sh"
}
}
}
distTar {
dependsOn jar
compression Compression.GZIP
}
import de.undercouch.gradle.tasks.download.Download
task downloadKafka(type: Download) {
src "https://archive.apache.org/dist/kafka/${kafkaVersion}/kafka_${kafkaScalaVersion}-${kafkaVersion}.tgz"
dest rootDir
}