1- buildscript {
1+ buildscript {// properties that you need to build the project
22 Properties constants = new Properties ()
33 file(" $projectDir /../constants.properties" ). withInputStream { constants. load(it) }
44
55 ext {
6-
76 corda_release_group = constants. getProperty(" cordaReleaseGroup" )
8- corda_release_version = constants. getProperty(" cordaVersion" )
97 corda_core_release_group = constants. getProperty(" cordaCoreReleaseGroup" )
8+ corda_release_version = constants. getProperty(" cordaVersion" )
109 corda_core_release_version = constants. getProperty(" cordaCoreVersion" )
1110 corda_gradle_plugins_version = constants. getProperty(" gradlePluginsVersion" )
11+ kotlin_version = constants. getProperty(" kotlinVersion" )
1212 junit_version = constants. getProperty(" junitVersion" )
1313 quasar_version = constants. getProperty(" quasarVersion" )
1414 log4j_version = constants. getProperty(" log4jVersion" )
1515 slf4j_version = constants. getProperty(" slf4jVersion" )
1616 corda_platform_version = constants. getProperty(" platformVersion" ). toInteger()
17+ // springboot
18+ spring_boot_version = ' 2.0.2.RELEASE'
19+ spring_boot_gradle_plugin_version = ' 2.0.2.RELEASE'
1720 }
1821
1922 repositories {
@@ -27,10 +30,11 @@ buildscript {
2730 classpath " net.corda.plugins:cordapp:$corda_gradle_plugins_version "
2831 classpath " net.corda.plugins:cordformation:$corda_gradle_plugins_version "
2932 classpath " net.corda.plugins:quasar-utils:$corda_gradle_plugins_version "
33+ classpath " org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version "
3034 }
3135}
3236
33- allprojects {
37+ allprojects {// Properties that you need to compile your project (The application)
3438 apply from : " ${ rootProject.projectDir} /repositories.gradle"
3539 apply plugin : ' java'
3640
@@ -42,34 +46,99 @@ allprojects {
4246 maven { url ' https://jitpack.io' }
4347 }
4448
45-
46-
4749 tasks. withType(JavaCompile ) {
48- options. compilerArgs << " -parameters" // Required for shell commands .
50+ options. compilerArgs << " -parameters" // Required by Corda's serialisation framework .
4951 }
5052
5153 jar {
5254 // This makes the JAR's SHA-256 hash repeatable.
5355 preserveFileTimestamps = false
5456 reproducibleFileOrder = true
57+ duplicatesStrategy = DuplicatesStrategy . EXCLUDE
5558 }
5659}
5760
5861apply plugin : ' net.corda.plugins.cordapp'
62+ apply plugin : ' net.corda.plugins.cordformation'
5963apply plugin : ' net.corda.plugins.quasar-utils'
6064
61- cordapp {
62- info {
63- name " CorDapp AutoPayroll"
64- vendor " Corda Open Source"
65- targetPlatformVersion corda_platform_version
66- minimumPlatformVersion corda_platform_version
65+ sourceSets {
66+ main {
67+ resources {
68+ srcDir rootProject. file(" config/dev" )
69+ }
6770 }
6871}
6972
70- task installQuasar (type : Copy ) {
71- destinationDir rootProject. file(" lib" )
72- from(configurations. quasar) {
73- rename ' quasar-core(.*).jar' , ' quasar.jar'
73+ // Module dependencis
74+ dependencies {
75+ // Corda dependencies.
76+ cordaCompile " $corda_core_release_group :corda-core:$corda_core_release_version "
77+ cordaCompile " $corda_release_group :corda-node-api:$corda_release_version "
78+ cordaRuntime " $corda_release_group :corda:$corda_release_version "
79+
80+ // CorDapp dependencies.
81+ cordapp project(" :workflows" )
82+ cordapp project(" :contracts" )
83+
84+ cordaCompile " org.apache.logging.log4j:log4j-slf4j-impl:${ log4j_version} "
85+ cordaCompile " org.apache.logging.log4j:log4j-web:${ log4j_version} "
86+ cordaCompile " org.slf4j:jul-to-slf4j:$slf4j_version "
87+ }
88+
89+ task deployNodes (type : net.corda.plugins.Cordform , dependsOn : [' jar' ]) {
90+ nodeDefaults {
91+ projectCordapp {
92+ deploy = true
93+ }
94+ cordapp project(' :contracts' )
95+ cordapp project(' :workflows' )
96+ runSchemaMigration = true
97+ }
98+ node {
99+ name " O=Notary,L=London,C=GB"
100+ notary = [validating : false ]
101+ p2pPort 10002
102+ rpcSettings {
103+ address(" localhost:10003" )
104+ adminAddress(" localhost:10043" )
105+ }
106+ }
107+ node {
108+ name " O=FinanceTeam,L=London,C=GB"
109+ p2pPort 10005
110+ rpcSettings {
111+ address(" localhost:10006" )
112+ adminAddress(" localhost:10046" )
113+ }
114+ rpcUsers = [[ user : " user1" , " password" : " test" , " permissions" : [" ALL" ]]]
115+ }
116+ node {
117+ name " O=PetersonThomas,L=New York,C=US"
118+ p2pPort 10008
119+ rpcSettings {
120+ address(" localhost:10009" )
121+ adminAddress(" localhost:10049" )
122+ }
123+ rpcUsers = [[ user : " user1" , " password" : " test" , " permissions" : [" ALL" ]]]
124+ }
125+ node {
126+ name " O=GeorgeJefferson,L=San Diego,C=US"
127+ p2pPort 10011
128+ rpcSettings {
129+ address(" localhost:10012" )
130+ adminAddress(" localhost:10052" )
131+ }
132+ rpcUsers = [[ user : " user1" , " password" : " test" , " permissions" : [" ALL" ]]]
133+ }
134+ node {
135+ name " O=BankOperator,L=Toronto,C=CA"
136+ p2pPort 10014
137+ rpcSettings {
138+ address(" localhost:10015" )
139+ adminAddress(" localhost:10055" )
140+ }
141+ rpcUsers = [[ user : " user1" , " password" : " test" , " permissions" : [" ALL" ]]]
74142 }
75143}
144+
0 commit comments