-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #356 from aalmiray/gradle-build-scan
Configure gradle build scan plugin
- Loading branch information
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
File acceptFile = new File(gradle.gradleUserHomeDir, "build-scans/spotless/gradle-scans-license-agree.txt") | ||
acceptFile.parentFile.mkdirs() | ||
def env = System.getenv() | ||
boolean isCI = env.CI || env.TRAVIS | ||
boolean hasAccepted = isCI || env.SPOTLESS_GRADLE_SCANS_ACCEPT=='yes' || acceptFile.exists() && acceptFile.text.trim() == 'yes' | ||
boolean hasRefused = env.SPOTLESS_GRADLE_SCANS_ACCEPT=='no' || acceptFile.exists() && acceptFile.text.trim() == 'no' | ||
|
||
buildScan { | ||
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 `SPOTLESS_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 | ||
echo 'yes' >> ${acceptFile} | ||
or | ||
echo 'no' >> ${acceptFile} | ||
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. | ||
""" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters