-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathsettings.gradle
More file actions
221 lines (208 loc) · 8.52 KB
/
Copy pathsettings.gradle
File metadata and controls
221 lines (208 loc) · 8.52 KB
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
221
pluginManagement {
repositories {
def artifactoryPassword = System.env.'ARTIFACTORY_ACCESS_TOKEN'
maven {
if (artifactoryPassword) {
url 'https://repox.jfrog.io/repox/plugins.gradle.org/'
authentication {
header(HttpHeaderAuthentication)
}
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "Bearer $artifactoryPassword"
}
} else {
url 'https://plugins.gradle.org/m2/'
}
}
}
}
plugins {
id("com.gradle.develocity") version("4.4.2")
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.6.0"
}
rootProject.name = 'sonarqube'
include 'plugins:sonar-xoo-plugin'
include 'plugins:sonar-education-plugin'
include 'server:sonar-auth-common'
include 'server:sonar-auth-bitbucket'
include 'server:sonar-auth-github'
include 'server:sonar-auth-gitlab'
include 'server:sonar-auth-ldap'
include 'server:sonar-auth-saml'
include 'server:sonar-ce'
include 'server:sonar-ce-common'
include 'server:sonar-ce-task'
include 'server:sonar-ce-task-projectanalysis'
include 'server:sonar-db-dao'
include 'server:sonar-db-migration'
include 'server:sonar-db-profiling'
include 'server:sonar-main'
include 'server:sonar-process'
include 'server:sonar-server-common'
include 'server:sonar-statemachine'
include 'server:sonar-telemetry'
include 'server:sonar-telemetry-core'
include 'server:sonar-webserver'
include 'server:sonar-webserver-api'
include 'server:sonar-webserver-auth'
include 'server:sonar-webserver-common'
include 'server:sonar-webserver-core'
include 'server:sonar-webserver-es'
include 'server:sonar-webserver-webapi'
include 'server:sonar-webserver-webapi-v2'
include 'server:sonar-webserver-pushapi'
include 'server:sonar-webserver-ws'
include 'server:sonar-alm-client'
include 'server:sonar-webserver-monitoring'
include 'server:sonar-events'
include 'sonar-application'
include 'sonar-core'
include 'sonar-sarif'
include 'sonar-duplications'
include 'sonar-markdown'
include 'sonar-plugin-api-impl'
include 'sonar-shutdowner'
include 'sonar-testing-harness'
include 'sonar-testing-ldap'
include 'sonar-ws'
include 'sonar-ws-generator'
// Registers a local composite build from the sonarqube-unification repo as a substitute for published artifacts.
// Set the property to true and optionally sonarqubeUnificationPath in ~/.gradle/gradle.properties.
// Falls back to the SONARQUBE_UNIFICATION_PATH environment variable if the Gradle property is not set.
// opts: group (default 'org.sonarsource.sonarqube'), projectPaths (map of name -> project path, default ':name')
def useLocalUnificationModule = { String propName, String subPath, List<String> modules, Map opts = [:] ->
if (settings.hasProperty(propName) && settings[propName].toBoolean()) {
def basePath = settings.hasProperty('sonarqubeUnificationPath')
? settings['sonarqubeUnificationPath']
: System.getenv('SONARQUBE_UNIFICATION_PATH')
if (!basePath) {
throw new GradleException(
"${propName} is enabled but the sonarqube-unification path is not configured.\n" +
"Set sonarqubeUnificationPath in ~/.gradle/gradle.properties or export SONARQUBE_UNIFICATION_PATH."
)
}
def group = opts.group ?: 'org.sonarsource.sonarqube'
def groups = opts.groups ?: [:]
def projectPaths = opts.projectPaths ?: [:]
def dir = new File(basePath, subPath)
println "Using local build [${propName}] from: ${dir.absolutePath}"
if (opts.autoSubstitution) {
// Preserve project-to-project variants for composites with mixed public and private modules.
includeBuild(dir.absolutePath)
} else {
includeBuild(dir.absolutePath) {
dependencySubstitution {
modules.each { name ->
def moduleGroup = groups[name] ?: group
def projectPath = projectPaths[name] ?: ":${name}"
substitute module("${moduleGroup}:${name}") using project(projectPath)
}
}
}
}
}
}
useLocalUnificationModule('useLocalOrg', 'organizations', ['organizations-api', 'organizations-server-app'])
useLocalUnificationModule('useLocalProjects', 'projects', ['projects-api', 'projects-server-app'])
useLocalUnificationModule('useLocalEntitlements', 'billing/entitlements',
['entitlements-api', 'entitlements-server-app', 'entitlements-server-license'], [
groups: [
'entitlements-server-app': 'com.sonarsource.sonarqube',
'entitlements-server-license': 'com.sonarsource.sonarqube',
],
projectPaths: [
'entitlements-server-app': ':private:entitlements-server-app',
'entitlements-server-license': ':private:entitlements-server-license',
],
])
useLocalUnificationModule('useLocalConsumption', 'billing/consumption', ['consumption-api', 'consumption-server-app'], [
groups: ['consumption-server-app': 'com.sonarsource.sonarqube'],
projectPaths: ['consumption-server-app': ':private:consumption-server-app'],
])
useLocalUnificationModule('useLocalMetrics', 'analysis-processing/metrics', ['metrics-api', 'metrics-server-app'])
useLocalUnificationModule('useLocalEvents', 'unified-core', ['sonar-events-api', 'sonar-events-server'], [
projectPaths: [
'sonar-events-api' : ':sonar-events:sonar-events-api',
'sonar-events-server': ':sonar-events:sonar-events-server',
]
])
useLocalUnificationModule('useLocalIssueProcessingEvents', 'workflow-and-standards/issue-processing', ['detection-agent-events'], [
group: 'com.sonarsource.sonarqube',
projectPaths: [
'detection-agent-events': ':private:detection-agent-events',
]
])
useLocalUnificationModule('useLocalArchitecture', 'architecture',
['architecture-server-app', 'architecture-api', 'architecture-unified-app', 'architecture-datastructure'],
[
group: 'com.sonarsource.sonarqube',
projectPaths: [
'architecture-server-app': ':private:server:architecture-server-app',
'architecture-api' : ':private:unified:architecture-api',
'architecture-unified-app': ':private:unified:architecture-unified-app',
'architecture-datastructure': ':private:unified:architecture-datastructure',
]
]
)
useLocalUnificationModule('useLocalCagHub', 'cag/hub',
['cag-hub-server-app', 'cag-hub-unified-app', 'cag-hub-api'],
[
group: 'com.sonarsource.sonarqube',
projectPaths: [
'cag-hub-server-app' : ':private:cag-hub-server-app',
'cag-hub-unified-app': ':private:cag-hub-unified-app',
'cag-hub-api' : ':private:cag-hub-api',
]
]
)
useLocalUnificationModule('useLocalHistory', 'reporting/history', ['history-api', 'history-server-app', 'history-core', 'history-sca'], [
autoSubstitution: true,
])
useLocalUnificationModule('useLocalDashboards', 'reporting/dashboards', ['dashboards-api', 'dashboards-server-app', 'dashboards-core'], [
group: 'com.sonarsource.sonarqube',
projectPaths: [
'dashboards-api' : ':private:dashboards-api',
'dashboards-server-app': ':private:dashboards-server-app',
'dashboards-core' : ':private:dashboards-core',
]
])
useLocalUnificationModule('useLocalDopTranslation', 'integration/dop-translation', ['dop-translation-api'])
useLocalUnificationModule('useLocalRemediationEnablement', 'agentic-workflows',
['remediation-agent-enablement-api', 'remediation-agent-enablement-server'],
[
autoSubstitution: true,
]
)
useLocalUnificationModule('useLocalAgenticHttpSigning', 'agentic-workflows', ['agentic-http-signing'], [
autoSubstitution: true,
])
// Growth capabilities. Each one is its own composite build under growth/, so it gets its own flag.
useLocalUnificationModule('useLocalOnboarding', 'growth/onboarding', ['onboarding-api', 'onboarding-unified-app'])
useLocalUnificationModule('useLocalContactForm', 'growth/contact-form', ['contact-form-api', 'contact-form-unified-app'])
ext.isCiServer = System.getenv().containsKey("GITHUB_ACTIONS")
develocity {
projectId = "sonar-enterprise"
server = "https://develocity.sonar.build"
buildScan {
uploadInBackground.set(!isCiServer)
publishing.onlyIf { isCiServer && it.authenticated }
if (isCiServer) {
buildScan.value 'Branch', System.getenv()["GITHUB_REF_NAME"]
buildScan.value 'GitHub Actions Run', "https://github.com/${System.getenv('GITHUB_REPOSITORY')}/actions/runs/${System.getenv('GITHUB_RUN_ID')}"
}
}
}
buildCache {
local {
enabled = !isCiServer
}
remote(develocity.buildCache) {
push = isCiServer
}
}
// use Settings.getRootDir() so that it doesn't matter which directory you are executing from
File extraSettings = new File(rootDir, 'private/private-settings.gradle')
if (extraSettings.exists()) {
apply from: extraSettings
}