-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsettings.gradle
83 lines (73 loc) · 2.79 KB
/
settings.gradle
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
/*------------------------------------------------------------------------------
Plugins DSL block
https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block
------------------------------------------------------------------------------*/
plugins {
// use our own plugin
id "com.mooltiverse.oss.nyx" version "3.0.10"
// Gradle Enterprise plugin (used for build scans)
id "com.gradle.enterprise" version "3.16.2"
}
/*------------------------------------------------------------------------------
Root project properties
------------------------------------------------------------------------------*/
rootProject.name = 'nyx'
include 'modules:docker'
include 'modules:go'
include 'modules:go:errors'
include 'modules:go:utils'
include 'modules:go:version'
include 'modules:go:nyx'
include 'modules:java'
include 'modules:java:version'
include 'modules:java:main'
include 'modules:java:gradle'
/*------------------------------------------------------------------------------
Extension configurations
------------------------------------------------------------------------------*/
// Configure Gradle build scans
// See https://docs.gradle.com/enterprise/gradle-plugin/#using_build_scans
gradleEnterprise {
buildScan {
if (System.getenv("CI")) { // when running on a CI server
// always publish
publishAlways()
// apply these tags when running on CI servers
tag "CI"
if (System.getenv("GITHUB_ACTIONS")) { // when running specifically on GitHub Actions
tag "GitHub"
// link the scan to the pipeline
link "Pipeline", "$nyxHomeURL/actions/runs/${System.getProperty("GITHUB_RUN_ID")}"
}
// do not exit unit upload has finished
uploadInBackground = false
} else {
// apply these tags when not running on CI servers
tag "local"
}
// add the git commit reference to the scan
def commitId = 'git rev-parse --verify HEAD'.execute().text.trim()
if (commitId) {
buildScan.value 'Git Commit ID', commitId
buildScan.link 'Source', "$nyxHomeURL/commit/$commitId"
}
// add the git branch reference to the scan
def branchName = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
if (branchName) {
buildScan.value 'Git Branch Name', branchName
buildScan.link 'Source', "$nyxHomeURL/tree/$branchName"
}
// add the clean/dirty tag and values to the scan
def status = 'git status --porcelain'.execute().text
if (status) {
buildScan.tag 'dirty'
buildScan.value 'Git Status', 'dirty'
} else {
buildScan.tag 'clean'
buildScan.value 'Git Status', 'clean'
}
// accept the agreement so it doesn't propt during the build
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}