forked from sijie/pulsar-java-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (98 loc) · 3.82 KB
/
Copy pathbuild.gradle
File metadata and controls
118 lines (98 loc) · 3.82 KB
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
apply plugin: 'java'
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.streamlio.pulsar'
archivesBaseName = 'pulsar-java-tutorial'
version = '0.0.1'
ext {
previewVersion = 16
log4jVersion = '2.8.2'
pulsarVersion = '2.0.0-incubating'
defaultClasspath = sourceSets.main.runtimeClasspath
}
def urlFile = { String url, String name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
dependencies {
compile urlFile("https://github.com/streamlio/incubator-pulsar/releases/download/v2.0.0-streamlio-${previewVersion}/pulsar-client-2.0.0-streamlio-${previewVersion}.jar", 'pulsar-client')
compile urlFile("https://github.com/streamlio/incubator-pulsar/releases/download/v2.0.0-streamlio-${previewVersion}/pulsar-client-kafka-2.0.0-streamlio-${previewVersion}.jar", 'pulsar-client-kafka')
compile urlFile("https://github.com/streamlio/incubator-pulsar/releases/download/v2.0.0-streamlio-${previewVersion}/pulsar-client-admin-2.0.0-streamlio-${previewVersion}.jar", 'pulsar-client-admin')
//compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2'
//compile group: 'org.apache.pulsar', name: 'pulsar-client', version: pulsarVersion
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4jVersion
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion
}
jar {
doFirst {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
task("producerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.ProducerTutorial'
classpath = defaultClasspath
}
task("consumerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.ConsumerTutorial'
classpath = defaultClasspath
}
task("readerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.ReaderTutorial'
classpath = defaultClasspath
}
task("asyncProducerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.async.AsyncProducerTutorial'
classpath = defaultClasspath
}
task("asyncConsumerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.async.AsyncConsumerTutorial'
classpath = defaultClasspath
}
task("kafkaConsumerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.kafka.KafkaAdaptorConsumer'
args = ['tutorial-topic']
classpath = defaultClasspath
}
task("kafkaProducerTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.kafka.KafkaAdaptorProducer'
args = ['tutorial-topic']
classpath = defaultClasspath
}
task("producerStatsTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.stats.ProducerStatsTutorial'
classpath = defaultClasspath
}
task("consumerStatsTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.stats.ConsumerStatsTutorial'
classpath = defaultClasspath
}
task("messageQueueTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.usecases.MessageQueueTutorial'
classpath = defaultClasspath
}
task("sharedSubscriptionTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.subscriptions.SharedSubscriptionTutorial'
classpath = defaultClasspath
}
task("exclusiveSubscriptionTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.subscriptions.ExclusiveSubscriptionTutorial'
classpath = defaultClasspath
}
task("failoverSubscriptionTutorial", dependsOn: 'classes', type: JavaExec) {
main = 'tutorial.subscriptions.FailoverSubscriptionTutorial'
classpath = defaultClasspath
}