-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
177 lines (150 loc) · 5.79 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
buildscript {
ext {
corda_release_group = "net.corda"
corda_core_release_group = "net.corda"
corda_release_version = getProperty("corda_release_version")
corda_core_release_version = getProperty("corda_core_release_version")
corda_gradle_plugins_version = getProperty("corda_gradle_plugins_version")
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
}
dependencies {
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.2.71'
id 'net.corda.plugins.cordapp' version '5.0.12'
id 'net.corda.plugins.cordformation' version '5.0.12'
id 'org.jetbrains.dokka' version "1.4.10.2"
id 'maven-publish'
id 'signing'
}
def moduleProjects = subprojects.findAll { gradle.ext.moduleProjects.contains(it.name) }
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda' }
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
// Cordaptor snapshots are published here
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
}
subprojects {
group = 'tech.b180.cordaptor'
version = getProperty("cordaptor_version")
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'maven-publish'
apply plugin: 'signing'
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
jvmTarget = "1.8"
javaParameters = true
}
}
jar {
// This makes the JAR's SHA-256 hash repeatable.
preserveFileTimestamps = false
reproducibleFileOrder = true
archivesBaseName = "cordaptor-${project.name}"
}
}
// applying common configuration to modules that produce artifacts
// which we publish to Maven Central
configure(moduleProjects) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from "${rootProject.projectDir}/etc/no-javadocs.txt"
}
publishing {
publications {
maven(MavenPublication) {
artifactId = "cordaptor-${project.name}"
from components.java
artifact sourcesJar
artifact javadocJar
pom {
url = "https://github.com/b180tech/cordaptor"
licenses {
license {
name = "GNU Affero General Public License v3.0 or later"
url = "https://spdx.org/licenses/AGPL-3.0-or-later"
}
}
developers {
developer {
id = "bond180"
name = "Bond180 Limited"
email = "devops@bond180.com"
}
}
scm {
connection = "scm:git:git://github.com/b180tech/cordaptor.git"
developerConnection = "scm:git:ssh://github.com:b180tech/cordaptor.git"
url = "https://github.com/b180tech/cordaptor"
}
}
}
}
repositories {
maven {
credentials {
username project.sonatypeOssUsername
password project.sonatypeOssPassword
}
name = "central"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
required { !version.endsWith('SNAPSHOT') }
sign publishing.publications.maven
}
}
//Tasks for automating the getting the embedded cordaptor jar and test results.
task automatedResults {
dependsOn 'getCordaptorEmbedded', 'getCordaCommonResults', 'getCordaServiceResults',
'getKernelResults', 'getReferenceCordappResults', 'getRestEndpointResults'
}
task getCordaptorEmbedded(type: Copy) {
from(file("$rootDir/bundle-rest-embedded/build/libs"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/bundle-rest-embedded"))
}
task getCordaCommonResults(type: Copy) {
from(file("$rootDir/corda-common/build/reports"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/corda-common"))
}
task getCordaServiceResults(type: Copy) {
from(file("$rootDir/corda-service/build/reports"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/corda-service"))
}
task getKernelResults(type: Copy) {
from(file("$rootDir/kernel/build/reports"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/kernel"))
}
task getReferenceCordappResults(type: Copy) {
from(file("$rootDir/reference-cordapp/build/reports"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/reference-cordapp"))
}
task getRestEndpointResults(type: Copy) {
from(file("$rootDir/rest-endpoint/build/reports"))
into(file("$rootDir/automated-results/Corda-$corda_core_release_version/rest-endpoint"))
}