-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
152 lines (141 loc) · 6.16 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
152 lines (141 loc) · 6.16 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
import java.net.URI
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
pluginManagement {
// This block is compiled earlier than the rest of the script, so keep it self-contained.
val artifactoryUrl = (System.getenv("ARTIFACTORY_URL") ?: providers.gradleProperty("artifactoryUrl").orNull)
?.removeSuffix("/")
val artifactoryUsername = System.getenv("ARTIFACTORY_USERNAME")
?: System.getenv("ARTIFACTORY_ACCESS_USERNAME")
?: providers.gradleProperty("artifactoryUsername").orNull
val artifactoryPassword = System.getenv("ARTIFACTORY_ACCESS_TOKEN")
?: System.getenv("ARTIFACTORY_PASSWORD")
?: providers.gradleProperty("artifactoryPassword").orNull
repositories {
maven {
if (artifactoryUrl != null && artifactoryUsername != null && artifactoryPassword != null) {
url = java.net.URI("$artifactoryUrl/plugins.gradle.org/")
credentials { username = artifactoryUsername; password = artifactoryPassword }
} else {
url = java.net.URI("https://plugins.gradle.org/m2/")
}
}
}
}
plugins {
id("org.jetbrains.intellij.platform.settings") version "2.18.1"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
id("com.gradle.develocity") version "4.5.0"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.6.0"
}
rootProject.name = "sonarlint-intellij"
val artifactoryUrl = ((System.getenv("ARTIFACTORY_URL") ?: extra.properties["artifactoryUrl"] as? String)
?.removeSuffix("/")).orEmpty()
val artifactoryUsername = (System.getenv("ARTIFACTORY_USERNAME")
?: System.getenv("ARTIFACTORY_ACCESS_USERNAME")
?: extra.properties["artifactoryUsername"] as? String).orEmpty()
val artifactoryPassword = (System.getenv("ARTIFACTORY_ACCESS_TOKEN")
?: System.getenv("ARTIFACTORY_PASSWORD")
?: extra.properties["artifactoryPassword"] as? String).orEmpty()
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.PREFER_SETTINGS
@Suppress("UnstableApiUsage")
repositories {
if (artifactoryUrl.isNotEmpty() && artifactoryUsername.isNotEmpty() && artifactoryPassword.isNotEmpty()) {
maven("$artifactoryUrl/sonarsource") {
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
}
intellijPlatform {
localPlatformArtifacts()
maven("$artifactoryUrl/jetbrains-intellij-dependencies") {
name = "IntelliJ Platform Dependencies Repository"
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
}
ivy {
name = "JetBrains IDE Installers"
url = URI("$artifactoryUrl/jetbrains-download")
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
patternLayout {
artifact("[organization]/[module]-[revision](-[classifier]).[ext]")
artifact("[organization]/[module]-[revision](.[classifier]).[ext]")
artifact("[organization]/[revision]/[module]-[revision](-[classifier]).[ext]")
artifact("[organization]/[revision]/[module]-[revision](.[classifier]).[ext]")
artifact("[organization]/[module]-[revision]-[classifier].tar.gz")
}
content {
IntelliJPlatformType.values()
.filter { it != IntelliJPlatformType.AndroidStudio }
.mapNotNull { it.installer }
.forEach {
includeModule(it.groupId, it.artifactId)
}
}
metadataSources { artifact() }
}
ivy {
name = "Android Studio Installers"
url = URI("$artifactoryUrl/android-studio")
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
patternLayout {
artifact("/ide-zips/[revision]/[artifact]-[revision]-[classifier].[ext]")
artifact("/install/[revision]/[artifact]-[revision]-[classifier].[ext]")
}
content {
val coordinates = IntelliJPlatformType.AndroidStudio.installer
requireNotNull(coordinates)
includeModule(coordinates.groupId, coordinates.artifactId)
}
metadataSources { artifact() }
}
maven("$artifactoryUrl/intellij-releases") {
name = "IntelliJ Repository (Releases)"
credentials {
username = artifactoryUsername
password = artifactoryPassword
}
}
}
} else {
mavenCentral()
intellijPlatform {
localPlatformArtifacts()
jetbrainsIdeInstallers()
androidStudioInstallers()
intellijDependencies()
releases()
}
}
}
}
include("its", "clion", "clion-resharper", "nodejs", "common", "git", "rider", "test-common")
val isCiServer = System.getenv("CI") != null
buildCache {
local {
isEnabled = !isCiServer
}
remote(develocity.buildCache) {
isEnabled = true
isPush = isCiServer
}
}
develocity {
server = "https://develocity.sonar.build"
buildScan {
publishing.onlyIf { isCiServer && it.isAuthenticated }
capture {
buildLogging.set(!startParameter.taskNames.contains("properties"))
}
}
}