Skip to content

Commit

Permalink
[Java] Add back scans statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed May 6, 2019
1 parent 159f5d1 commit 3509a7d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def projectPom = {
}
}

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
apply from: 'gradle/build-scans.gradle'
}

configurations {
shadow
}
Expand Down
29 changes: 27 additions & 2 deletions gradle/build-scans.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
def acceptFile = new File(gradle.gradleUserHomeDir, "build-scans/aeron/gradle-scans-license-agree.txt")
def env = System.getenv()
boolean isCI = env.CI || env.TRAVIS
boolean hasAccepted = isCI || env.AERON_GRADLE_SCANS_ACCEPT=='yes' || acceptFile.exists() && acceptFile.text.trim() == 'yes'
boolean hasRefused = env.AERON_GRADLE_SCANS_ACCEPT=='no' || acceptFile.exists() && acceptFile.text.trim() == 'no'

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
if (hasAccepted) {
termsOfServiceAgree = 'yes'
} else if (!hasRefused) {
gradle.buildFinished {
println """
This build uses Gradle Build Scans to gather statistics, share information about
failures, environmental issues, dependencies resolved during the build and more.
Build scans will be published after each build, if you accept the terms of
service, and in particular the privacy policy.
Please read
https://gradle.com/terms-of-service
https://gradle.com/legal/privacy
and then:
- set the `AERON_GRADLE_SCANS_ACCEPT` to `yes`/`no` if you agree with/refuse the TOS
- or create the ${acceptFile} file with `yes`/`no` in it if you agree with/refuse
And we'll not bother you again. Note that build scans are only made public if
you share the URL at the end of the build.
"""
}
}
}

0 comments on commit 3509a7d

Please sign in to comment.