forked from chimp1984/misq_prototype1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
309 lines (262 loc) · 10 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
}
}
configure(rootProject) {
// remove the 'misq-*' scripts and 'lib' dir generated by the 'installDist' task
task clean {
doLast {
delete fileTree(dir: rootProject.projectDir, include: 'misq-*'), 'lib'
}
}
}
configure(subprojects) {
apply plugin: 'java'
apply plugin: 'com.google.osdetector'
sourceCompatibility = 1.10
ext { // in alphabetical order
bcVersion = '1.63'
findbugsVersion = '3.0.2'
grpcVersion = '1.25.0'
gsonVersion = '2.8.5'
guavaVersion = '28.2-jre'
guiceVersion = '4.2.2'
jetbrainsAnnotationsVersion = '13.0'
javafxVersion = '16'
joptVersion = '5.0.4'
jsonsimpleVersion = '1.1.1'
junitVersion = '4.12'
langVersion = '3.11'
logbackVersion = '1.1.11'
loggingVersion = '1.2'
lombokVersion = '1.18.12'
protobufVersion = '3.10.0'
protocVersion = protobufVersion
slf4jVersion = '1.7.30'
torBinary = 'b9c6227'
i2pVersion = '0.9.49'
netlayerVersion = '32779ac' // Commit ID from https://github.com/bisq-network/netlayer/commits/externaltor
os = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
// Default dependencies for all modules
dependencies {
implementation("com.google.guava:guava:$guavaVersion") {
exclude(module: 'j2objc-annotations')
}
implementation "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
implementation "com.google.code.findbugs:jsr305:$findbugsVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "ch.qos.logback:logback-core:$logbackVersion"
implementation "ch.qos.logback:logback-classic:$logbackVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
testImplementation "junit:junit:$junitVersion"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
}
configure([project(':common'),
project(':torify'),
project(':i2p'),
project(':p2p'),
project(':listing'),
project(':finance'),
project(':daemon'),
project(':cli'),
project(':jfx'),
project(':web'),
project(':scripts')]) {
apply plugin: 'application'
build.dependsOn installDist
installDist.destinationDir = file('build/app')
distZip.enabled = false
// the 'installDist' and 'startScripts' blocks below configure misq executables to put
// generated shell scripts in the root project directory, such that users can easily
// discover and invoke e.g. ./misq-desktop, ./misq-seednode, etc.
// See https://stackoverflow.com/q/46327736 for details.
installDist {
doLast {
// copy generated shell scripts, e.g. `misq-desktop` directly to the project
// root directory for discoverability and ease of use
copy {
from "$destinationDir/bin"
into rootProject.projectDir
}
// copy libs required for generated shell script classpaths to 'lib' dir under
// the project root directory
copy {
from "$destinationDir/lib"
into "${rootProject.projectDir}/lib"
}
// edit generated shell scripts such that they expect to be executed in the
// project root dir as opposed to a 'bin' subdirectory
def windowsScriptFile = file("${rootProject.projectDir}/misq-${applicationName}.bat")
windowsScriptFile.text = windowsScriptFile.text.replace(
'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%')
def unixScriptFile = file("${rootProject.projectDir}/misq-$applicationName")
unixScriptFile.text = unixScriptFile.text.replace(
'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null')
if (applicationName == 'desktop') {
def script = file("${rootProject.projectDir}/misq-$applicationName")
script.text = script.text.replace(
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4g"')
}
if (applicationName == 'apitest') {
// Pass the logback config file as a system property to avoid chatty
// logback startup due to multiple logback.xml files in the classpath
// (:daemon & :cli).
def script = file("${rootProject.projectDir}/misq-$applicationName")
script.text = script.text.replace(
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="' +
'-Dlogback.configurationFile=apitest/build/resources/main/logback.xml"')
}
if (osdetector.os != 'windows')
delete fileTree(dir: rootProject.projectDir, include: 'misq-*.bat')
else
delete fileTree(dir: rootProject.projectDir, include: 'misq-*', exclude: '*.bat')
}
}
startScripts {
// rename scripts from, e.g. `desktop` to `misq-desktop`
applicationName = "misq-$applicationName"
}
}
configure(project(':common')) {
dependencies {
compile "org.bouncycastle:bcpg-jdk15on:$bcVersion"
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
}
}
configure(project(':torify')) {
dependencies {
implementation project(':common')
compile("org.apache.commons:commons-compress:1.6")
compile("com.github.chimp1984:jsocks:567e1cd6")
compile("com.github.chimp1984:jtorctl:9b5ba203")
compile("com.github.bisq-network.tor-binary:tor-binary-geoip:$torBinary")
compile("com.github.bisq-network.tor-binary:tor-binary-macos:$torBinary")
compile("com.github.bisq-network.tor-binary:tor-binary-linux32:$torBinary")
compile("com.github.bisq-network.tor-binary:tor-binary-linux64:$torBinary")
compile("com.github.bisq-network.tor-binary:tor-binary-windows:$torBinary")
}
test {
exclude '**/**Integration*'
}
}
configure(project(':i2p')) {
dependencies {
implementation project(':common')
/*
In case we want to use the i2p jars instead of using SAM
implementation("net.i2p:router:$i2pVersion")
implementation("net.i2p.client:streaming:$i2pVersion")
implementation("net.i2p.client:mstreaming:$i2pVersion")
implementation("net.i2p:i2p:$i2pVersion")*/
}
test {
exclude '**/**Integration*'
}
}
configure(project(':p2p')) {
dependencies {
implementation project(':common')
implementation project(':torify')
implementation project(':i2p')
}
test {
exclude '**/**Integration*'
}
}
configure(project(':listing')) {
dependencies {
implementation project(':common')
implementation project(':p2p')
}
}
configure(project(':finance')) {
dependencies {
implementation project(':common')
implementation project(':p2p')
}
}
configure(project(':daemon')) {
mainClassName = 'misq.daemon.DaemonMain'
dependencies {
implementation project(':common')
implementation project(':p2p')
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation("io.grpc:grpc-protobuf:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
implementation("io.grpc:grpc-stub:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
}
}
configure(project(':cli')) {
mainClassName = 'misq.cli.CliMain'
dependencies {
implementation "net.sf.jopt-simple:jopt-simple:$joptVersion"
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation("io.grpc:grpc-core:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
implementation("io.grpc:grpc-stub:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
}
}
configure(project(':jfx')) {
apply plugin: 'com.github.johnrengelman.shadow'
// apply from: 'package/package.gradle'
version = '0.0.1-SNAPSHOT'
jar.manifest.attributes(
"Implementation-Title": project.name,
"Implementation-Version": version)
mainClassName = 'misq.jfx.JfxMain'
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css files
dependencies {
implementation project(':common')
implementation project(':p2p')
implementation "org.openjfx:javafx-base:$javafxVersion:$os"
implementation "org.openjfx:javafx-graphics:$javafxVersion:$os"
implementation "org.openjfx:javafx-controls:$javafxVersion:$os"
}
}
configure(project(':web')) {
dependencies {
}
}
configure(project(':scripts')) {
dependencies {
}
}