Skip to content

Commit e397c57

Browse files
authored
Merge pull request aeron-io#678 from aalmiray/gradle-build-scan
Configure build scan plugin
2 parents 1f856e4 + 1082da6 commit e397c57

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ matrix:
88
jdk: openjdk8
99
os: linux
1010
dist: xenial
11-
script: ./gradlew
11+
script: ./gradlew --scan
1212

1313
- name: "OpenJDK 11"
1414
language: java
1515
jdk: openjdk11
1616
os: linux
1717
dist: xenial
18-
script: ./gradlew
18+
script: ./gradlew --scan
1919

2020
- env: COMPILER=g++-6
2121
language: cpp
@@ -120,4 +120,4 @@ before_cache:
120120
cache:
121121
directories:
122122
- $HOME/.gradle/caches/
123-
- $HOME/.gradle/wrapper/
123+
- $HOME/.gradle/wrapper/

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ buildscript {
2020
}
2121

2222
plugins {
23+
id 'com.gradle.build-scan' version '2.3'
2324
id 'java'
2425
id 'com.github.johnrengelman.shadow' version '5.0.0' apply false
2526
id "io.freefair.javadoc-links" version "3.2.1" apply false
2627
}
2728

29+
buildScan {
30+
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
31+
apply from: 'gradle/build-scans.gradle'
32+
}
33+
2834
defaultTasks 'clean', 'build', 'shadowJar', 'install'
2935

3036
def sbeGroup = 'uk.co.real-logic'

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.gradle.daemon = true
2+
org.gradle.caching = true

gradle/build-scans.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
def acceptFile = new File(gradle.gradleUserHomeDir, "build-scans/sbe/gradle-scans-license-agree.txt")
2+
def env = System.getenv()
3+
boolean isCI = env.CI || env.TRAVIS
4+
boolean hasAccepted = isCI || env.SBE_GRADLE_SCANS_ACCEPT=='yes' || acceptFile.exists() && acceptFile.text.trim() == 'yes'
5+
boolean hasRefused = env.SBE_GRADLE_SCANS_ACCEPT=='no' || acceptFile.exists() && acceptFile.text.trim() == 'no'
6+
7+
buildScan {
8+
if (hasAccepted) {
9+
termsOfServiceAgree = 'yes'
10+
} else if (!hasRefused) {
11+
gradle.buildFinished {
12+
println """
13+
This build uses Gradle Build Scans to gather statistics, share information about
14+
failures, environmental issues, dependencies resolved during the build and more.
15+
Build scans will be published after each build, if you accept the terms of
16+
service, and in particular the privacy policy.
17+
18+
Please read
19+
20+
https://gradle.com/terms-of-service
21+
https://gradle.com/legal/privacy
22+
23+
and then:
24+
25+
- set the `SBE_GRADLE_SCANS_ACCEPT` to `yes`/`no` if you agree with/refuse the TOS
26+
- or create the ${acceptFile} file with `yes`/`no` in it if you agree with/refuse
27+
28+
And we'll not bother you again. Note that build scans are only made public if
29+
you share the URL at the end of the build.
30+
"""
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)