-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
245 lines (214 loc) · 8.08 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
import java.nio.file.Files
buildscript {
ext {
corda_release_group = 'net.corda'
corda_release_version = '4.8'
corda_gradle_plugins_version = '5.0.12'
kotlin_version = '1.2.71'
junit_version = '4.12'
quasar_version = '0.7.10'
jolokia_version = '1.3.7'
slf4j_version = '1.7.25'
log4j_version = '2.11.2'
min_platform_version = '10'
target_platform_version = '10'
//Tokens
tokens_release_group = 'com.r3.corda.lib.tokens'
tokens_release_version = '1.2'
//account
accounts_release_group = 'com.r3.corda.lib.accounts'
accounts_release_version = '1.0'
//CI
confidential_id_release_group = "com.r3.corda.lib.ci"
confidential_id_release_version = "1.0"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://software.r3.com/artifactory/corda' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
}
}
allprojects {
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven'
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://software.r3.com/artifactory/corda' }
maven { url 'https://jitpack.io' }
//SDK lib
maven { url 'https://software.r3.com/artifactory/corda-lib' }
//Gradle Plugins
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = "$project.group"
version = "$project.version"
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
jar {
// This makes the JAR's SHA-256 hash repeatable.
preserveFileTimestamps = false
reproducibleFileOrder = true
}
}
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
sourceSets {
main {
resources {
srcDir "config/dev"
}
}
test {
resources {
srcDir "config/test"
}
}
integrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/kotlin')
}
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_group:corda-core:$corda_release_version"
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaCompile "$corda_release_group:corda-confidential-identities:$corda_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"
//node driver for testing.
testCompile "$corda_release_group:corda-node-driver:$corda_release_version"
// Specify your dependent CorDapps.
cordapp project(":contracts-states-abstract-flows")
cordapp project(":cordapp-commons")
cordapp project(":bank-workflows")
cordapp project(":realestate-custodian-workflows")
cordapp project(":appraiser-workflows")
//Finance cordapp.
cordapp "$corda_release_group:corda-finance-workflows:$corda_release_version"
cordapp "$corda_release_group:corda-finance-contracts:$corda_release_version"
// Token SDK dependencies.
cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
//Account lib
cordapp "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"
cordapp "$accounts_release_group:accounts-contracts:$accounts_release_version"
cordapp "$accounts_release_group:accounts-workflows:$accounts_release_version"
cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"
cordaCompile "org.apache.logging.log4j:log4j-web:${log4j_version}"
cordaCompile "org.slf4j:jul-to-slf4j:$slf4j_version"
}
task integrationTest(type: Test, dependsOn: []) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
// Don't create jar lib for root project, as it only contains test cases.
jar {
jar {
onlyIf { false }
}
}
// Skip install task as we are not creating Jar for it.
install.enabled = false
def rpcUsersList = [['username': "user", 'password': "us3r1", 'permissions': ["ALL"]]]
//Task to deploy the nodes in order to bootstrap a network
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
/* This property will load the CorDapps to each of the node by default, including the Notary. You can find them
* in the cordapps folder of the node at build/nodes/Notary/cordapps. However, the notary doesn't really understand
* the notion of cordapps. In production, Notary does not need cordapps as well. This is just a short cut to load
* the Corda network bootstrapper.
*/
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(":contracts-states-abstract-flows")
cordapp project(":cordapp-commons")
// Corda Finance.
cordapp "$corda_release_group:corda-finance-workflows:$corda_release_version"
cordapp "$corda_release_group:corda-finance-contracts:$corda_release_version"
// Token SDK dependencies.
cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
//Account lib
cordapp "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"
cordapp "$accounts_release_group:accounts-contracts:$accounts_release_version"
cordapp "$accounts_release_group:accounts-workflows:$accounts_release_version"
runSchemaMigration = true //This configuration is for any CorDapps with custom schema, We will leave this as true to avoid
//problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change
//it to false for quicker project compiling time.
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=RealEstateProperty Custodian,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = rpcUsersList
cordapp project(":realestate-custodian-workflows")
}
node {
name "O=Bank A,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
rpcUsers = rpcUsersList
cordapp project(":bank-workflows")
}
node {
name "O=Appraiser Company,L=New York,C=US"
p2pPort 10010
rpcSettings {
address("localhost:10011")
adminAddress("localhost:10051")
}
rpcUsers = rpcUsersList
cordapp project(":appraiser-workflows")
}
}
task installQuasar(type: Copy) {
destinationDir rootProject.file("lib")
from(configurations.quasar) {
rename 'quasar-core(.*).jar', 'quasar.jar'
}
}