-
Notifications
You must be signed in to change notification settings - Fork 9
/
settings.gradle
141 lines (131 loc) · 4.71 KB
/
settings.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
pluginManagement {
repositories {
def cordaUseCache = System.getenv("CORDA_USE_CACHE")
if (cordaUseCache != null) {
maven {
url = "$artifactoryContextUrl/$cordaUseCache"
name = "R3 Maven remote repositories"
authentication {
basic(BasicAuthentication)
}
credentials {
username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
}
} else {
maven {
url "${publicArtifactURL}/corda-releases"
content {
includeGroupByRegex 'net\\.corda\\.plugins(\\..*)?'
}
}
gradlePluginPortal()
}
}
// Manually parse the Toml file to workaround issues with version catalog
// not supporting direct use in settings.gradle
def tomlFile = new File(rootDir, 'gradle/libs.versions.toml')
def tomlContent = tomlFile.text
def extractVersion = { String name ->
def pattern = java.util.regex.Pattern.compile("${name}\\s*=\\s*\"([^\"]+)\"")
def matcher = pattern.matcher(tomlContent)
if (matcher.find()) {
return matcher.group(1)
} else {
return null
}
}
def gradleEnterpriseVersion = extractVersion('gradleEnterpriseVersion')
def gradleDataPluginVersion = extractVersion('gradleDataVersion')
plugins {
id 'com.gradle.enterprise' version gradleEnterpriseVersion
id 'com.gradle.common-custom-user-data-gradle-plugin' version gradleDataPluginVersion
}
}
plugins {
id 'com.gradle.common-custom-user-data-gradle-plugin'
id 'com.gradle.enterprise'
}
dependencyResolutionManagement {
repositories {
mavenLocal()
def cordaUseCache = System.getenv("CORDA_USE_CACHE")
if (cordaUseCache != null) {
maven {
url = "$artifactoryContextUrl/$cordaUseCache"
name = "R3 Maven remote repositories"
authentication {
basic(BasicAuthentication)
}
credentials {
username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
}
} else {
mavenCentral()
maven {
url = "${publicArtifactURL}/corda-dependencies"
}
maven {
url = "$artifactoryContextUrl/${System.getenv('CORDA_CONSUME_REPOSITORY_KEY') ?: 'corda-os-maven'}"
credentials {
username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
}
}
}
}
rootProject.name = "corda-api"
includeBuild 'cordapp-configuration'
include 'application'
include 'base'
include 'corda-api'
include 'cordapp-configuration-publish'
include 'crypto'
include 'crypto-extensions'
include 'data:avro-schema'
include 'data:config-schema'
include 'data:db-schema'
include 'data:membership-schema'
include 'data:topic-schema'
include 'data:rbac-schema'
include 'ledger:ledger-common'
include 'ledger:ledger-consensual'
include 'ledger:ledger-utxo'
include 'ledger:notary-plugin'
include 'membership'
include 'serialization'
gradleEnterprise {
server = gradleEnterpriseUrl
allowUntrustedServer = false
def apiKey = settings.ext.find('CORDA_GRADLE_SCAN_KEY') ?: System.getenv('CORDA_GRADLE_SCAN_KEY')
accessKey = apiKey
buildScan {
if (apiKey?.trim()) {
publishAlways()
capture {
taskInputFiles = true
}
uploadInBackground = false
}
}
buildCache {
local {
enabled = true
removeUnusedEntriesAfterDays = 14 // Garbage collect if a cache item is not used in 2 weeks.
}
remote(gradleEnterprise.buildCache) {
// For the remote build cache we will populate cache only from Jenkins, all machines can pull from cache however.
if (System.getenv().containsKey("JENKINS_URL")) {
push = true
enabled = true
} else {
push = false
enabled = apiKey?.trim() ? true : false
}
}
}
}