-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathsettings.gradle
More file actions
135 lines (120 loc) · 4.44 KB
/
Copy pathsettings.gradle
File metadata and controls
135 lines (120 loc) · 4.44 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
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.
def useLocalUnificationModule = { String propName, String label, String subPath, List<String> modules ->
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 dir = new File(basePath, subPath)
println "Using local ${label} build from: ${dir.absolutePath}"
includeBuild(dir.absolutePath) {
dependencySubstitution {
modules.each { name -> substitute module("org.sonarsource.sonarqube:${name}") using project(":${name}") }
}
}
}
}
useLocalUnificationModule('useLocalOrg', 'organizations', 'organizations', ['organizations-api', 'organizations-server-app'])
useLocalUnificationModule('useLocalMetrics', 'metrics', 'analysis-processing/metrics', ['metrics-api', 'metrics-server-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
}