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 {
66 corda_release_group = constants. getProperty(" cordaReleaseGroup" )
7- corda_release_version = constants. getProperty(" cordaVersion" )
87 corda_core_release_group = constants. getProperty(" cordaCoreReleaseGroup" )
8+ corda_release_version = constants. getProperty(" cordaVersion" )
99 corda_core_release_version = constants. getProperty(" cordaCoreVersion" )
1010 corda_gradle_plugins_version = constants. getProperty(" gradlePluginsVersion" )
11+ kotlin_version = constants. getProperty(" kotlinVersion" )
1112 junit_version = constants. getProperty(" junitVersion" )
1213 quasar_version = constants. getProperty(" quasarVersion" )
1314 log4j_version = constants. getProperty(" log4jVersion" )
1415 slf4j_version = constants. getProperty(" slf4jVersion" )
15- corda_platform_version = constants. getProperty(" platformVersion" )
16+ corda_platform_version = constants. getProperty(" platformVersion" ). toInteger()
17+ // special dependencies
1618 okhttp_version = ' 3.5.0'
1719 }
1820
@@ -30,11 +32,80 @@ buildscript {
3032 }
3133}
3234
33- allprojects {
35+ allprojects {// Properties that you need to compile your project (The application)
36+ apply from : " ${ rootProject.projectDir} /repositories.gradle"
37+ apply plugin : ' java'
38+
39+ repositories {
40+ mavenLocal()
41+ jcenter()
42+ mavenCentral()
43+ maven { url ' https://software.r3.com/artifactory/corda' }
44+ maven { url ' https://jitpack.io' }
45+ }
3446
3547 tasks. withType(JavaCompile ) {
36- options. compilerArgs << " -parameters" // Required for shell commands .
48+ options. compilerArgs << " -parameters" // Required by Corda's serialisation framework .
3749 }
3850
51+ jar {
52+ // This makes the JAR's SHA-256 hash repeatable.
53+ preserveFileTimestamps = false
54+ reproducibleFileOrder = true
55+ duplicatesStrategy = DuplicatesStrategy . EXCLUDE
56+ }
57+ }
58+
59+ apply plugin : ' net.corda.plugins.cordapp'
60+ apply plugin : ' net.corda.plugins.cordformation'
61+ apply plugin : ' net.corda.plugins.quasar-utils'
3962
40- }
63+ sourceSets {
64+ main {
65+ resources {
66+ srcDir rootProject. file(" config/dev" )
67+ }
68+ }
69+ }
70+ // Module dependencis
71+ dependencies {
72+ // Corda dependencies.
73+ cordaCompile " $corda_core_release_group :corda-core:$corda_core_release_version "
74+ cordaCompile " $corda_release_group :corda-node-api:$corda_release_version "
75+ cordaRuntime " $corda_release_group :corda:$corda_release_version "
76+
77+ // CorDapp dependencies.
78+ cordapp project(" :workflows" )
79+
80+ cordaCompile " org.apache.logging.log4j:log4j-slf4j-impl:${ log4j_version} "
81+ cordaCompile " org.apache.logging.log4j:log4j-web:${ log4j_version} "
82+ cordaCompile " org.slf4j:jul-to-slf4j:$slf4j_version "
83+ }
84+
85+
86+ task deployNodes (type : net.corda.plugins.Cordform , dependsOn : [' jar' ]) {
87+ /* This property will load the CorDapps to each of the node by default, including the Notary. You can find them
88+ * in the cordapps folder of the node at build/nodes/Notary/cordapps. However, the notary doesn't really understand
89+ * the notion of cordapps. In production, Notary does not need cordapps as well. This is just a short cut to load
90+ * the Corda network bootstrapper.
91+ */
92+ nodeDefaults {
93+ projectCordapp {
94+ deploy = false
95+ }
96+ cordapp project(' :workflows' )
97+ runSchemaMigration = true // This configuration is for any CorDapps with custom schema, We will leave this as true to avoid
98+ // problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change
99+ // it to false for quicker project compiling time.
100+ }
101+ node {
102+ name " O=PartyA,L=London,C=GB"
103+ p2pPort 10005
104+ rpcSettings {
105+ address(" localhost:10006" )
106+ adminAddress(" localhost:10046" )
107+ }
108+ cordapps = []
109+ rpcUsers = [[ user : " user1" , " password" : " test" , " permissions" : [" StartFlow.com.flowhttp.HttpCallFlow" ]]]
110+ }
111+ }
0 commit comments