-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
154 lines (137 loc) · 4.92 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
buildscript {
ext {
corda_release_version = cordaVersion
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://software.r3.com/artifactory/corda-releases' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "net.corda.plugins:cordapp:$cordaGradlePluginsVersion"
classpath "net.corda.plugins:cordformation:$cordaGradlePluginsVersion"
classpath "net.corda.plugins:quasar-utils:$cordaGradlePluginsVersion"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
}
allprojects { //Properties that you need to compile your project (The application)
apply from: "${rootProject.projectDir}/repositories.gradle"
apply plugin: 'kotlin'
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://software.r3.com/artifactory/corda' }
maven { url 'https://jitpack.io' }
}
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
}
configurations {
detekt
}
dependencies {
compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: "$kotlinVersion"
detekt "$detektReleaseGroup:detekt-cli:$detektVersion"
detekt "$detektReleaseGroup:detekt-formatting:$detektVersion"
}
}
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
sourceSets {
main {
resources {
srcDir rootProject.file("config/dev")
}
}
}
//Module dependencis
dependencies {
// Corda dependencies.
cordaCompile "$cordaCoreReleaseGroup:corda-core:$cordaCoreVersion"
cordaRuntime "$cordaReleaseGroup:corda-node-api:$cordaVersion"
cordaRuntime "$cordaReleaseGroup:corda:$cordaVersion"
// CorDapp dependencies.
cordapp project(":workflows")
cordapp project(":contracts")
cordapp project(':cbdc-bridge')
cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
cordaCompile "org.apache.logging.log4j:log4j-web:$log4jVersion"
cordaCompile "org.slf4j:jul-to-slf4j:$slf4jVersion"
}
task installQuasar(type: Copy) {
destinationDir rootProject.file("lib")
from(configurations.quasar) {
rename 'quasar-core(.*).jar', 'quasar.jar'
}
}
//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')
cordapp project(':workflows')
cordapp project(':cbdc-bridge')
// 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.
runSchemaMigration = true
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
task detektBaseline(type: JavaExec) {
main = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt
def input = "$projectDir"
def config = "$projectDir/detekt-config.yml"
def excludes = ".*/resources/.*"
def baseline = "$projectDir/detekt-baseline.xml"
def params = ['-i', input, '-c', config, '-ex', excludes, '-b', baseline, '--create-baseline']
args(params)
}