forked from signum-network/signum-node
/
build.gradle
263 lines (216 loc) · 7.65 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
plugins {
id 'com.github.johnrengelman.shadow' version '4.0.4'
id 'java'
id 'maven'
id 'application'
id 'edu.sc.seis.launch4j' version '2.5.1'
id 'org.gradle.crypto.checksum' version '1.2.0'
id 'com.palantir.git-version' version '0.12.2'
id 'io.spring.dependency-management' version '1.0.1.RELEASE' //for logging - log4j
id 'nu.studer.jooq' version '3.0.3'
id "org.flywaydb.flyway" version "8.2.0"
id "de.undercouch.download" version "1.2"
id 'jacoco'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.signum-network:signumj:v0.20.0'
compile 'io.reactivex:rxjava:1.3.8'
compile 'org.bouncycastle:bcprov-jdk15on:1.69'
compile 'org.ehcache:ehcache:3.9.9'
compile 'org.flywaydb:flyway-core:8.2.0'
compile 'com.google.code.gson:gson:2.8.9'
compile 'com.h2database:h2:1.4.199'
compile 'commons-cli:commons-cli:1.4'
compile 'com.zaxxer:HikariCP:5.0.1'
compile 'org.jocl:jocl:2.0.1'
compile 'org.jooq:jooq:3.15.7'
compile 'org.mariadb.jdbc:mariadb-java-client:3.0.3'
compile 'org.owasp.encoder:encoder:1.2.3'
compile 'org.bitlet:weupnp:0.1.4'
compile 'com.google.zxing:core:3.4.1'
compile 'com.google.zxing:javase:3.4.1'
compile 'org.slf4j:slf4j-api:1.7.35'
compile 'org.slf4j:slf4j-jdk14:1.7.35'
compile 'org.eclipse.jetty:jetty-server:10.0.7'
compile 'org.eclipse.jetty:jetty-servlet:10.0.7'
compile 'org.eclipse.jetty:jetty-servlets:10.0.7'
compile 'org.eclipse.jetty:jetty-rewrite:10.0.7'
compile 'javax.annotation:javax.annotation-api:1.3.2'
compile 'com.github.jiconfont:jiconfont:1.0.0'
compile 'com.github.jiconfont:jiconfont-swing:1.0.1'
compile 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1'
//logging
compile 'org.apache.logging.log4j:log4j-api:2.17.1'
compile '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'
// Needed for build script so "compile" needed
compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.4.1'
jooqRuntime group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.4.1'
}
test {
useJUnitPlatform()
}
sourceSets {
main {
java {
srcDir "src"
}
resources {
srcDir "resources"
}
}
test {
java {
srcDirs = ["test/java"]
}
}
}
// Define the main class for the application
mainClassName = 'signum.Launcher'
description = 'Signum Node.'
def schema_dburl = "jdbc:mariadb://localhost:3306/signum_jooq"
def schema_dbusername = "root"
def schema_dbpassword = "pass"
flyway {
url = "${schema_dburl}"
user = "${schema_dbusername}"
password = "${schema_dbpassword}"
locations = ["filesystem:"+project.projectDir.toString()+"/resources/db/migration_mariadb"]
}
jooq {
version = "3.15.7"
edition = "OSS"
signum(sourceSets.main) {
jdbc {
url = "${schema_dburl}"
user = "${schema_dbusername}"
password = "${schema_dbpassword}"
}
generator {
name = 'org.jooq.codegen.JavaGenerator'
database {
includes = ".*"
name = "org.jooq.meta.mariadb.MariaDBDatabase"
inputSchema = "signum_jooq"
outputSchema = "DB"
excludes = ''
// outputSchemaToDefault = true
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 = "src"
}
}
}
}
// use the following to generate the schema tables:
// ./gradlew build -DgenerateSchema=true --rerun-tasks
generateSignumJooqSchemaSource.dependsOn flywayMigrate
generateSignumJooqSchemaSource.onlyIf {System.getProperty("generateSchema") == "true"}
flywayMigrate.onlyIf {System.getProperty("generateSchema") == "true"}
def details = versionDetails()
jar {
// Needed by the logging library
manifest {
attributes 'Multi-Release': 'true'
}
}
shadowJar{
archiveName = "${baseName}-${classifier}.${extension}"
}
createExe {
outfile = 'signum-node.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 = "signum-node.jar"
}
task dist(type: Zip) {
from (project.tasks.shadowJar.outputs.files){
include 'signum-node-all.jar'
rename {'signum-node.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 "${baseName}.zip"
}
def jdkVersion = 'zulu11.54.23-ca-jre11.0.14'
import de.undercouch.gradle.tasks.download.Download
task downloadWindowsJDK(type: Download) {
src "https://cdn.azul.com/zulu/bin/${jdkVersion}-win_x64.zip"
dest "build/distributions/${jdkVersion}-win_x64.zip"
}
task unzipWindowsJDK(type: Copy, dependsOn: downloadWindowsJDK) {
from(zipTree("build/distributions/${jdkVersion}-win_x64.zip"))
into "build/distributions/"
}
task windowsZip(type: Zip) {
dependsOn createExe
dependsOn unzipWindowsJDK
from (project.tasks.shadowJar.outputs.files){
include 'signum-node-all.jar'
rename {'signum-node.jar'}
}
from "${project.buildDir}/launch4j/${baseName}.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 "${baseName}-win_x64.zip"
}
import org.gradle.crypto.checksum.Checksum
task release(type: Checksum, dependsOn: [test, dist, windowsZip]) {
files = files(['build/distributions/signum-node.zip', 'build/distributions/signum-node-win_x64.zip' ])
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}