-
Notifications
You must be signed in to change notification settings - Fork 62
/
build.gradle
236 lines (206 loc) · 8.2 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
* Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
archivesBaseName = 'pravega-client-examples'
resources
ext {
junitVersion = '4.11'
commonsCLIVersion = '1.4'
}
dependencies {
testCompile "junit:junit:${junitVersion}"
compile "io.pravega:pravega-client:${pravegaVersion}",
"io.pravega:pravega-common:${pravegaVersion}",
"io.pravega:pravega-keycloak-client:${pravegaKeycloakVersion}",
"commons-cli:commons-cli:${commonsCLIVersion}"
compile "org.slf4j:slf4j-api:1.7.14"
compile "ch.qos.logback:logback-classic:1.1.7"
}
// Build examples
task scriptHelloWorldWriter(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.gettingstarted.HelloWorldWriter'
applicationName = 'helloWorldWriter'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task scriptHelloWorldReader(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.gettingstarted.HelloWorldReader'
applicationName = 'helloWorldReader'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task startHelloWorldWriter(type: JavaExec) {
main = "io.pravega.example.gettingstarted.HelloWorldWriter"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task startHelloWorldReader(type: JavaExec) {
main = "io.pravega.example.gettingstarted.HelloWorldReader"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task scriptConsoleWriter(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.consolerw.ConsoleWriter'
applicationName = 'consoleWriter'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task scriptConsoleReader(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.consolerw.ConsoleReader'
applicationName = 'consoleReader'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task startConsoleReader(type: JavaExec) {
main = "io.pravega.example.consolerw.ConsoleReader"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task scriptSharedConfigCli(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.statesynchronizer.SharedConfigCli'
applicationName = 'sharedConfigCli'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task scriptNoopReader(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.noop.NoopReader'
applicationName = 'noopReader'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task startNoopReader(type: JavaExec) {
main = "io.pravega.example.noop.NoopReader"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task scriptStreamCutsCli(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.streamcuts.StreamCutsCli'
applicationName = 'streamCutsCli'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task startStreamCutsCli(type: JavaExec) {
main = "io.pravega.example.streamcuts.StreamCutsCli"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task scriptChatClientCli(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.tables.ChatClientCli'
applicationName = 'chatClientCli'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
/**
* This will only work well from the console if all Gradle output is suppressed. That's because it requires user input
* and output using the Console.
*
* Example: ./gradlew startChatClientCli -q --console=plain
*/
task startChatClientCli(type: JavaExec) {
main = "io.pravega.example.tables.ChatClientCli"
standardInput = System.in
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task scriptSecureWriter(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.secure.SecureWriter'
applicationName = 'secureWriter'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task scriptSecureReader(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.secure.SecureReader'
applicationName = 'secureReader'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task scriptSecureBatchReader(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClassName = 'io.pravega.example.secure.SecureBatchReader'
applicationName = 'secureBatchReader'
defaultJvmOpts = ["-Dlogback.configurationFile=file:conf/logback.xml"]
classpath = files(jar.archivePath) + sourceSets.main.runtimeClasspath
}
task startSecureWriter(type: JavaExec) {
main = "io.pravega.example.secure.SecureWriter"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task startSecureReader(type: JavaExec) {
main = "io.pravega.example.secure.SecureReader"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
task startSecureBatchReader(type: JavaExec) {
main = "io.pravega.example.secure.SecureBatchReader"
classpath = sourceSets.main.runtimeClasspath
if(System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
distributions {
main {
baseName = archivesBaseName
contents {
into('bin') {
from project.scriptHelloWorldWriter
from project.scriptHelloWorldReader
from project.scriptConsoleWriter
from project.scriptConsoleReader
from project.scriptSharedConfigCli
from project.scriptNoopReader
from project.scriptStreamCutsCli
from project.scriptChatClientCli
from project.scriptSecureWriter
from project.scriptSecureReader
from project.scriptSecureBatchReader
}
into('lib') {
from(jar)
from(project.configurations.runtime)
}
into('conf') {
from(project.file('src/main/resources/logback.xml'))
from(project.file('src/main/resources/cert.pem'))
}
}
}
}