-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
125 lines (115 loc) · 4.97 KB
/
settings.gradle.kts
File metadata and controls
125 lines (115 loc) · 4.97 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
import java.net.URI
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
plugins {
id("org.jetbrains.intellij.platform.settings") version "2.11.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
id("com.gradle.develocity") version "4.0"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.2.1"
}
rootProject.name = "sonarlint-intellij"
val artifactoryUrl = System.getenv("ARTIFACTORY_URL") ?: (extra["artifactoryUrl"] as? String ?: "")
val artifactoryUsername = System.getenv("ARTIFACTORY_ACCESS_USERNAME") ?: (extra["artifactoryUsername"] as? String ?: "")
val artifactoryPassword = System.getenv("ARTIFACTORY_ACCESS_TOKEN") ?: (extra["artifactoryPassword"] as? String ?: "")
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-public.sonar.build"
buildScan {
publishing.onlyIf { isCiServer && it.isAuthenticated }
capture {
buildLogging.set(!startParameter.taskNames.contains("properties"))
}
}
}