forked from PoC-Consortium/burstcoin
-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
build.gradle
315 lines (265 loc) · 8.99 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
310
311
312
313
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath("org.flywaydb:flyway-mysql:8.5.13")
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
id 'maven-publish'
id 'application'
id 'edu.sc.seis.launch4j' version '2.5.1'
id 'org.gradle.crypto.checksum' version '1.4.0'
id 'com.palantir.git-version' version '0.12.2'
id 'io.spring.dependency-management' version '1.0.1.RELEASE' //for logging - log4j
// latest version to run with JDK 11
// https://github.com/etiennestuder/gradle-jooq-plugin?tab=readme-ov-file#compatibility
id 'nu.studer.jooq' version '7.1.1'
id "org.flywaydb.flyway" version "8.5.13"
id "de.undercouch.download" version "5.5.0"
id 'jacoco'
id "com.github.node-gradle.node" version "7.0.1"
id 'org.kordamp.gradle.jdeps' version '0.20.0'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.signum-network:signumj:v1.3.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
implementation 'org.bouncycastle:bcprov-jdk18on:1.75'
implementation 'org.ehcache:ehcache:3.9.9'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'commons-cli:commons-cli:1.4'
implementation 'com.zaxxer:HikariCP:5.0.1'
implementation 'org.jocl:jocl:2.0.1'
// db related deps
// as long as we use 3rd party code gen (nu.studer) we need to use jooq 3.16.23 (and also for JDK11)
// https://github.com/etiennestuder/gradle-jooq-plugin?tab=readme-ov-file#compatibility
implementation 'org.jooq:jooq:3.16.23'
implementation 'org.flywaydb:flyway-core:8.5.13'
// needed because of license issues since 8.2.0
// see https://documentation.red-gate.com/fd/release-notes-for-flyway-engine-179732572.html
implementation 'org.flywaydb:flyway-mysql:8.5.13'
implementation 'com.h2database:h2:2.2.224'
implementation 'org.postgresql:postgresql:42.7.3'
// unix socket support available - see https://github.com/kohlschutter/junixsocket
implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.8.3'
implementation 'org.mariadb.jdbc:mariadb-java-client:2.4.1'
implementation 'org.xerial:sqlite-jdbc:3.45.2.0'
jooqGenerator 'com.h2database:h2:2.2.224'
implementation 'org.owasp.encoder:encoder:1.2.3'
implementation 'org.bitlet:weupnp:0.1.4'
implementation 'com.google.zxing:core:3.4.1'
implementation 'com.google.zxing:javase:3.4.1'
implementation 'org.slf4j:slf4j-api:1.7.35'
implementation 'org.slf4j:slf4j-jdk14:1.7.35'
implementation 'org.eclipse.jetty:jetty-server:10.0.19'
implementation 'org.eclipse.jetty:jetty-servlet:10.0.19'
implementation 'org.eclipse.jetty:jetty-servlets:10.0.19'
implementation 'org.eclipse.jetty:jetty-rewrite:10.0.19'
implementation 'org.eclipse.jetty.websocket:websocket-jetty-server:10.0.19'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'com.github.jiconfont:jiconfont:1.0.0'
implementation 'com.github.jiconfont:jiconfont-swing:1.0.1'
implementation 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1'
//logging
implementation 'org.apache.logging.log4j:log4j-api:2.17.1'
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
// Use JUnit test framework
testImplementation("org.junit.platform:junit-platform-engine:1.5.1")
testImplementation("org.junit.platform:junit-platform-launcher:1.5.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.1")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.5.1")
testImplementation 'org.apache.httpcomponents:httpclient:4.5.13'
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat "full"
}
}
sourceSets {
main {
java {
srcDir "src"
}
resources {
srcDir "resources"
}
}
if (!project.hasProperty('skipTests')) {
test {
java {
srcDirs = ["test/java"]
}
}
}
}
// Define the main class for the application
mainClassName = 'signum.Launcher'
description = 'Signum Node.'
jar {
// Needed by the logging library
manifest {
attributes 'Multi-Release': 'true'
}
}
shadowJar {
mergeServiceFiles()
}
def details = versionDetails()
def baseNodeFileName = "signum-node"
createExe {
outfile = "${baseNodeFileName}.exe"
icon = "${projectDir}/resources/images/signum_overlay_logo.ico"
copyright = 'signum.network'
companyName = 'https://signum.network'
textVersion = details.lastTag
maxHeapSize = 2048
bundledJrePath = 'jre/'
dontWrapJar = true
mainClassName = project.mainClassName
copyConfigurable = project.tasks.shadowJar.outputs.files
jar = "${baseNodeFileName}.jar"
}
node {
download = true
version = '16.14.0'
nodeProjectDir = file("${project.projectDir}/openapi")
npmInstallCommand = "ci"
}
tasks.register("buildOpenApi", NpmTask) {
dependsOn npmInstall
args = ['run', 'dist']
}
tasks.register('dist', Zip) {
dependsOn buildOpenApi
from(project.tasks.shadowJar.outputs.files) {
include "${baseNodeFileName}-all.jar"
rename { "${baseNodeFileName}.jar" }
}
into('conf') { from "conf/node-default.properties" }
into('conf') { from "conf/logging-default.properties" }
into('html') { from "html" }
from "LICENSE.txt"
from "README.md"
archiveName "${baseNodeFileName}.zip"
}
def jdkVersion = 'zulu11.56.19-ca-jre11.0.15'
import de.undercouch.gradle.tasks.download.Download
tasks.register('downloadWindowsJDK', Download) {
src "https://cdn.azul.com/zulu/bin/${jdkVersion}-win_x64.zip"
dest "build/distributions/${jdkVersion}-win_x64.zip"
compress true
}
tasks.register('unzipWindowsJDK', Copy) {
dependsOn downloadWindowsJDK
from(zipTree("build/distributions/${jdkVersion}-win_x64.zip"))
into "build/distributions/"
}
tasks.register('windowsZip', Zip) {
dependsOn createExe
dependsOn unzipWindowsJDK
from(project.tasks.shadowJar.outputs.files) {
include "${baseNodeFileName}-all.jar"
rename { "${baseNodeFileName}.jar" }
}
from "${project.buildDir}/launch4j/${baseNodeFileName}.exe"
into('conf') { from "conf/node-default.properties" }
into('conf') { from "conf/logging-default.properties" }
into('html') { from "html" }
from "LICENSE.txt"
from "README.md"
into('jre') {
from "build/distributions/${jdkVersion}-win_x64/"
}
archiveName "${baseNodeFileName}-win_x64.zip"
}
import org.gradle.crypto.checksum.Checksum
tasks.register('release', Checksum) {
dependsOn test, dist, windowsZip
files = files(["build/distributions/${baseNodeFileName}.zip", "build/distributions/${baseNodeFileName}-win_x64.zip"])
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
// ==================== JOOQ Code Gen
// ./gradlew generateJooq
def schema_dburl = "jdbc:h2:${project.projectDir}/temp/generated/db/signum_jooq"
def schema_dbusername = ""
def schema_dbpassword = ""
flyway {
url = "${schema_dburl}"
user = "${schema_dbusername}"
password = "${schema_dbpassword}"
locations = ["filesystem:" + project.projectDir.toString() + "/resources/db/migration_h2_v2"]
}
import nu.studer.gradle.jooq.JooqEdition
jooq {
// last version to use with JDK 11
version = '3.16.23'
edition = JooqEdition.OSS
configurations {
main {
generateSchemaSourceOnCompilation = false
generationTool {
logging = org.jooq.meta.jaxb.Logging.DEBUG
jdbc {
driver = 'org.h2.Driver'
url = "${schema_dburl}"
user = "${schema_dbusername}"
password = "${schema_dbpassword}"
}
generator {
name = 'org.jooq.codegen.DefaultGenerator'
database {
name = 'org.jooq.meta.h2.H2Database'
includes = '.*'
excludes = ''
inputSchema = "PUBLIC"
outputSchema = "DB"
forcedTypes {
forcedType {
name = 'BOOLEAN'
expression = '.*\\.(.*\\.LATEST|MINTABLE|AT_STATE\\.FREEZE_WHEN_SAME_BALANCE|GOODS\\.DELISTED|TRANSACTION\\.(HAS_MESSAGE|HAS_ENCRYPTED_MESSAGE|HAS_PUBLIC_KEY_ANNOUNCEMENT|HAS_ENCRYPTTOSELF_MESSAGE)|PURCHASE\\.(PENDING|HAS_FEEDBACK_NOTES|HAS_PUBLIC_FEEDBACKS))'
types = '.*'
}
}
}
target {
packageName = 'brs.schema'
directory = 'temp/generated/jooq'
}
}
}
}
}
}
generateJooq.dependsOn(flywayMigrate)