-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
220 lines (193 loc) · 7.34 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
buildscript {
Properties constants = new Properties()
file("$projectDir/./constants.properties").withInputStream { constants.load(it) }
ext {
corda_release_group = constants.getProperty('cordaReleaseGroup')
corda_release_version = constants.getProperty('cordaReleaseVersion')
corda_gradle_plugins_version =constants.getProperty('cordaGradlePluginsVersion')
kotlin_version = constants.getProperty('kotlinVersion')
junit_version = constants.getProperty('junitVersion')
slf4j_version = constants.getProperty('slf4jVersion')
log4j_version = constants.getProperty('log4jVersion')
corda_platform_version = constants.getProperty('cordaPlatformVersion')
token_release_group= constants.getProperty('tokenReleaseGroup')
token_release_version= constants.getProperty('tokenReleaseVersion')
confidential_id_release_group = constants.getProperty('confidentialIdReleaseGroup')
artifactory_context_url = constants.getProperty('artifactoryContextUrl')
public_artifact_url = constants.getProperty('publicArtifactURL')
confidential_id_release_version = constants.getProperty('confidentialIdReleaseVersion')
confidential_id_versionSuffix = constants.getProperty('versionSuffix')
}
repositories {
mavenLocal()
mavenCentral()
maven { url "${public_artifact_url}/corda-releases" }
maven { url "https://repo.gradle.org/gradle/libs-releases-local/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-noarg:$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"
classpath "com.gradle:gradle-enterprise-gradle-plugin:$gradleEnterprisePlugin"
classpath "com.gradle:common-custom-user-data-gradle-plugin:$customUserDataGradlePlugin"
}
}
plugins {
id "com.jfrog.artifactory" version "4.7.5"
}
allprojects {
if (confidential_id_versionSuffix.isEmpty()) {
version confidential_id_release_version
} else {
version "$confidential_id_release_version-$confidential_id_versionSuffix"
}
group "$confidential_id_release_group"
apply plugin: 'kotlin'
//Ensure all transitive log4J depenndencies are up to date
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.apache.logging.log4j') {
details.useVersion '2.17.1'
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://repo.gradle.org/gradle/libs-releases-local" }
maven { url "$public_artifact_url/corda" }
maven { url "$public_artifact_url/corda-dependencies" }
maven { url "$public_artifact_url/corda-lib" }
maven { url "$public_artifact_url/corda-releases" }
}
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'
apply plugin: "com.gradle.build-scan"
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"
buildScan {
server = gradleEnterpriseUrl
allowUntrustedServer = false
def apiKey = project.findProperty('CORDA_GRADLE_SCAN_KEY') ?: System.getenv('CORDA_GRADLE_SCAN_KEY')
if (apiKey?.trim()) {
publishAlways()
capture {
taskInputFiles = true
}
uploadInBackground = false
accessKey = apiKey
}
}
sourceSets {
main {
resources {
srcDir rootProject.file("config/dev")
}
}
}
cordapp {
signing {
enabled false
}
info {
name "Confidential Identities - New"
vendor "Corda Open Source"
targetPlatformVersion corda_platform_version.toInteger()
minimumPlatformVersion corda_platform_version.toInteger()
}
}
dependencies {
// Corda dependencies.
cordaCompile "$corda_release_group:corda-core:$corda_release_version"
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"
// CorDapp dependencies.
cordapp project(":workflows")
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"
}
def publishProjects = [project(":workflows")]
configure(publishProjects) { subproject ->
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
task sourceJar(type: Jar, dependsOn: subproject.classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: subproject.javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task install(dependsOn: 'publishToMavenLocal')
publishing {
publications {
create(subproject.name, MavenPublication) {
from components.java
groupId subproject.group
artifactId "ci-${subproject.name}"
artifact tasks.sourceJar
artifact tasks.javadocJar
pom {
name = subproject.name
description = "confidential-identities ${subproject.name}"
url = 'https://github.com/corda/confidential-identities'
scm {
url = 'https://github.com/corda/confidential-identities'
}
licenses {
license {
name = 'Apache-2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
}
developers {
developer {
id = 'R3'
name = 'R3'
email = '[email protected]'
}
}
}
}
}
}
}
artifactory {
publish {
contextUrl = artifactory_context_url
repository {
repoKey = 'corda-lib'
username = System.getenv('CORDA_ARTIFACTORY_USERNAME') ?: System.getProperty('corda.artifactory.username')
password = System.getenv('CORDA_ARTIFACTORY_PASSWORD') ?: System.getProperty('corda.artifactory.password')
}
defaults {
if (publishProjects.contains(project)) {
publications(project.name)
}
}
}
}
wrapper {
gradleVersion = "5.6"
distributionType = Wrapper.DistributionType.ALL
}