generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 12
/
settings.gradle.kts
88 lines (77 loc) · 2.65 KB
/
settings.gradle.kts
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
pluginManagement {
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
gradlePluginPortal()
}
}
plugins {
id("com.gradle.develocity") version "3.18.1"
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.8.0")
}
rootProject.name = "excalidraw-jetbrains-plugin"
include(
"plugin",
"excalidraw-assets"
)
// https://docs.gradle.org/current/userguide/build_cache.html
buildCache {
local {
directory = File(rootDir, ".gradle/build-cache")
removeUnusedEntriesAfterDays = 30
}
}
develocity {
buildScan {
termsOfUseUrl = "https://gradle.com/terms-of-service"
termsOfUseAgree = "yes"
// publishAlways()
val isCI = providers.environmentVariable("CI").isPresent
publishing.onlyIf { isCI }
tag("CI")
buildScanPublished {
File("build-scan.txt").printWriter().use { writer ->
writer.println(buildScanUri)
}
}
if (providers.environmentVariable("GITHUB_ACTIONS").isPresent) {
link("GitHub Repository", "https://github.com/" + System.getenv("GITHUB_REPOSITORY"))
link(
"GitHub Commit",
"https://github.com/" + System.getenv("GITHUB_REPOSITORY") + "/commits/" + System.getenv("GITHUB_SHA")
)
listOf(
"GITHUB_ACTION_REPOSITORY",
"GITHUB_EVENT_NAME",
"GITHUB_ACTOR",
"GITHUB_BASE_REF",
"GITHUB_HEAD_REF",
"GITHUB_JOB",
"GITHUB_REF",
"GITHUB_REF_NAME",
"GITHUB_REPOSITORY",
"GITHUB_RUN_ID",
"GITHUB_RUN_NUMBER",
"GITHUB_SHA",
"GITHUB_WORKFLOW"
).forEach { e ->
val v = System.getenv(e)
if (v != null) {
value(e, v)
}
}
providers.environmentVariable("GITHUB_SERVER_URL").orNull?.let { ghUrl ->
val ghRepo = System.getenv("GITHUB_REPOSITORY")
val ghRunId = System.getenv("GITHUB_RUN_ID")
link("Summary", "$ghUrl/$ghRepo/actions/runs/$ghRunId")
link("PRs", "$ghUrl/$ghRepo/pulls")
// see .github/workflows/build.yaml
providers.environmentVariable("GITHUB_PR_NUMBER")
.orNull
.takeUnless { it.isNullOrBlank() }
.let { prNumber ->
link("PR", "$ghUrl/$ghRepo/pulls/$prNumber")
}
}
}
}
}