forked from gradle/gradle-build-scan-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
38 lines (32 loc) · 917 Bytes
/
build.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
plugins {
id 'java'
id 'com.gradle.build-scan' version '1.12.1'
}
repositories {
jcenter()
}
dependencies {
compile 'com.google.guava:guava:23.0'
testCompile 'junit:junit:4.12'
}
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
server 'https://enterprise-training.gradle.com'
publishAlways()
}
// Local or CI
if (System.getenv('CI')) {
buildScan.tag 'CI'
buildScan.link 'CI Build', System.getenv('CIRCLE_BUILD_URL')
// buildScan.link 'Source Code', System.getenv('CIRCLE_REPOSITORY_URL')
} else {
buildScan.tag 'LOCAL'
}
def GITHUB_REPO = 'https://github.com/george-moberly/gradle-build-scan-quickstart'
// Git commit id
def commitId = 'git rev-parse --verify HEAD'.execute().text.trim()
if (commitId) {
buildScan.value 'Git Commit ID', commitId
buildScan.link 'Source Code', "$GITHUB_REPO/tree/$commitId"
}