This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.gradle
308 lines (270 loc) · 12.1 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
/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands).
*
* Licensed under the Radix License, Version 1.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
*
* radixfoundation.org/licenses/LICENSE-v1
*
* The Licensor hereby grants permission for the Canonical version of the Work to be
* published, distributed and used under or by reference to the Licensor’s trademark
* Radix ® and use of any unregistered trade names, logos or get-up.
*
* The Licensor provides the Work (and each Contributor provides its Contributions) on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
* including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
* MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
*
* Whilst the Work is capable of being deployed, used and adopted (instantiated) to create
* a distributed ledger it is your responsibility to test and validate the code, together
* with all logic and performance of that code under all foreseeable scenarios.
*
* The Licensor does not make or purport to make and hereby excludes liability for all
* and any representation, warranty or undertaking in any form whatsoever, whether express
* or implied, to any entity or person, including any representation, warranty or
* undertaking, as to the functionality security use, value or other characteristics of
* any distributed ledger nor in respect the functioning or value of any tokens which may
* be created stored or transferred using the Work. The Licensor does not warrant that the
* Work or any use of the Work complies with any law or regulation in any territory where
* it may be implemented or used or that it will be appropriate for any specific purpose.
*
* Neither the licensor nor any current or former employees, officers, directors, partners,
* trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor
* shall be liable for any direct or indirect, special, incidental, consequential or other
* losses of any kind, in tort, contract or otherwise (including but not limited to loss
* of revenue, income or profits, or loss of use or data, or loss of reputation, or loss
* of any economic or other opportunity of whatsoever nature or howsoever arising), arising
* out of or in connection with (without limitation of any use, misuse, of any ledger system
* or use made or its functionality or any performance or operation of any code or protocol
* caused by bugs or programming or logic errors or otherwise);
*
* A. any offer, purchase, holding, use, sale, exchange or transmission of any
* cryptographic keys, tokens or assets created, exchanged, stored or arising from any
* interaction with the Work;
*
* B. any failure in a transmission or loss of any token or assets keys or other digital
* artefacts due to errors in transmission;
*
* C. bugs, hacks, logic errors or faults in the Work or any communication;
*
* D. system software or apparatus including but not limited to losses caused by errors
* in holding or transmitting tokens by any third-party;
*
* E. breaches or failure of security including hacker attacks, loss or disclosure of
* password, loss of private key, unauthorised use or misuse of such passwords or keys;
*
* F. any losses including loss of anticipated savings or other benefits resulting from
* use of the Work or any changes to the Work (however implemented).
*
* You are solely responsible for; testing, validating and evaluation of all operation
* logic, functionality, security and appropriateness of using the Work for any commercial
* or non-commercial purpose and for any reproduction or redistribution by You of the
* Work. You assume all risks associated with Your use of the Work and the exercise of
* permissions under this License.
*/
plugins {
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'nebula.ospackage' version '8.4.1'
id 'com.github.johnrengelman.shadow' version '6.0.0'
id 'me.champeau.jmh' version "0.6.5"
id 'org.sonarqube' version '2.7.1'
id 'com.adarshr.test-logger' version '2.1.0'
id 'com.palantir.git-version' version '0.12.3'
id 'com.moowork.node' version '1.3.1'
id 'net.nemerosa.versioning' version '2.15.0'
id 'maven-publish'
id "com.diffplug.spotless" version "6.0.0"
}
dependencies {
jmh 'org.openjdk.jmh:jmh-core:1.32'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.32'
jmh 'org.openjdk.jmh:jmh-generator-bytecode:1.32'
}
def radixVersion() {
def details = versionDetails()
def version
if (details.isCleanTag) {
version = details.lastTag
} else {
version = details.branchName
if (version == null) {
version = "detached-head-${details.gitHash}"
} else {
// Prepend last tag so builddeb doesn't choke on non-numeric branch names
version = "${details.lastTag}-${version}"
version = version.replaceAll('/', '~')
}
version = "${version}-SNAPSHOT"
}
return version
}
group 'com.radixdlt'
if (System.getenv("CI_VERSION")){
version versioning.info.full
} else {
version radixVersion()
}
task printShadowJarFilePath {
doLast {
print project(':radixdlt').shadowJar.archiveFile.get()
}
}
task radixCiVersion {
doLast {
print "radixdlt-version:$version"
}
}
sonarqube {
properties {
property "sonar.sourceEncoding", "UTF-8"
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'radixdlt-github'
property 'sonar.login', System.env.SONAR_TOKEN
property 'sonar.exclusions', '**/openapitools/**/*'
}
}
allprojects {
apply plugin: "com.diffplug.spotless"
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// don't need to set target, it is inferred from java
targetExclude('**/openapitools/**/*.java')
// apply a specific flavor of google-java-format
googleJavaFormat('1.13.0').reflowLongStrings()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
licenseHeaderFile("${project.rootDir}/licence-header.txt")
}
}
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/radixdlt/maven-pkg")
credentials {
username = System.getenv("GPR_USER") ?: ''
password = System.getenv("GPR_TOKEN") ?: ''
}
}
maven { url 'https://jitpack.io' }
}
tasks.withType(JavaCompile) {
options.release = 17
options.encoding = "UTF-8"
options.compilerArgs << "--enable-preview"
options.compilerArgs << "-Xlint:all"
//TODO: uncomment once warnings will be cleared
//options.compilerArgs << "-Werror"
options.compilerArgs << "-Xlint:-processing" // Not really a useful warning
options.compilerArgs << "-Xlint:-serial" //TODO: fix code to remove these warnings
options.compilerArgs << "-Xlint:-deprecation" //TODO: fix code to remove these warnings
options.compilerArgs << "-Xlint:-unchecked" //TODO: fix code to remove these warnings
options.compilerArgs << "-Xlint:-rawtypes" //TODO: fix code to remove these warnings
options.compilerArgs << "-Xlint:-preview"
}
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
jvmArgs("--enable-preview")
}
}
subprojects {
apply plugin: "maven-publish"
sonarqube {
properties {
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
}
project.afterEvaluate {
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/radixdlt/maven-pkg")
credentials {
username = System.getenv("GPR_USER") ?: ''
password = System.getenv("GPR_TOKEN") ?: ''
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
if(project.name == "radixdlt"){
gprdist(MavenPublication) {
artifactId = "radixdlt-dist"
artifact distZip
}
}
}
}
}
group 'com.radixdlt'
version rootProject.version
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'com.adarshr.test-logger'
dependencyManagement {
overriddenByDependencies = false
dependencies {
dependency "com.github.akarnokd:rxjava3-extensions:3.0.1"
dependency 'io.reactivex.rxjava3:rxjava:3.0.13'
dependency 'com.sleepycat:je:18.3.12'
// LMAX Disruptor for async logging
dependency 'com.lmax:disruptor:3.4.4'
dependency 'commons-cli:commons-cli:1.4'
dependency 'org.xerial.snappy:snappy-java:1.1.8.4'
dependency 'io.netty:netty-all:4.1.66.Final'
dependency('com.google.inject:guice:5.0.1') {
exclude 'com.google.guava:guava'
}
dependency('com.google.inject.extensions:guice-grapher:5.0.1') {
exclude 'com.google.guava:guava'
}
dependency 'io.undertow:undertow-core:2.2.9.Final'
dependency 'com.stijndewitt.undertow.cors:undertow-cors-filter:0.4.0'
dependency 'org.apache.logging.log4j:log4j-api:2.17.1'
dependency 'org.apache.logging.log4j:log4j-core:2.17.1'
dependency 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.1'
dependency('org.reflections:reflections:0.9.12') {
exclude 'com.google.guava:guava'
}
dependency 'org.bouncycastle:bcprov-jdk15on:1.68'
dependency 'org.bouncycastle:bcpkix-jdk15on:1.68'
dependency 'org.json:json:20180813'
dependency 'com.fasterxml.jackson.core:jackson-databind:2.12.4'
dependency 'com.fasterxml.jackson.core:jackson-core:2.12.4'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.4'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.12.4'
dependency('com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.12.4') {
exclude 'org.json:json'
}
dependency('com.fasterxml.jackson.datatype:jackson-datatype-guava:2.12.4') {
exclude 'com.google.guava:guava'
}
dependency 'com.google.guava:guava:30.1.1-jre'
// need at least this commit (or later): https://github.com/bitcoinj/bitcoinj/commit/7629677103dbdd80f14c63b066ed27e1fad47014
// in order to work with BouncyCastle 1.64 or later
// see issue: https://github.com/bitcoinj/bitcoinj/issues/1951
dependency('org.bitcoinj:bitcoinj-core:0.15.10') {
exclude 'com.google.guava:guava'
}
dependency 'org.awaitility:awaitility:4.1.0'
dependency 'org.mockito:mockito-core:3.12.4'
dependency 'nl.jqno.equalsverifier:equalsverifier:3.6.1'
dependency 'org.assertj:assertj-core:3.20.2'
dependency 'junit:junit:4.13.2'
dependency 'commons-cli:commons-cli:1.4'
dependency 'org.openjdk.jmh:jmh-core:1.32'
dependency 'org.openjdk.jmh:jmh-generator-annprocess:1.32'
}
}
}