You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by cc...@apache.org on 2018/06/07 11:18:08 UTC
groovy git commit: Add opt-in to Gradle build scans
Repository: groovy
Updated Branches:
refs/heads/master 8d730e19a -> 880a1add6
Add opt-in to Gradle build scans
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/880a1add
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/880a1add
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/880a1add
Branch: refs/heads/master
Commit: 880a1add6fe3a5a52b7707d546cbb90014426740
Parents: 8d730e1
Author: Cedric Champeau <cc...@apache.org>
Authored: Thu Jun 7 13:17:40 2018 +0200
Committer: Cedric Champeau <cc...@apache.org>
Committed: Thu Jun 7 13:17:40 2018 +0200
----------------------------------------------------------------------
build.gradle | 5 ++--
gradle/build-scans.gradle | 53 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/880a1add/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index d1c5ff0..3fb6861 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,14 +50,13 @@ buildscript {
}
plugins {
- id 'com.gradle.build-scan' version '1.12.1'
+ id 'com.gradle.build-scan' version '1.13.4'
id 'me.champeau.buildscan-recipes' version '0.2.3'
}
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
- licenseAgree = 'yes'
- publishAlways()
+ apply from: 'gradle/build-scans.gradle'
}
buildScanRecipes {
http://git-wip-us.apache.org/repos/asf/groovy/blob/880a1add/gradle/build-scans.gradle
----------------------------------------------------------------------
diff --git a/gradle/build-scans.gradle b/gradle/build-scans.gradle
new file mode 100644
index 0000000..44edca5
--- /dev/null
+++ b/gradle/build-scans.gradle
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def acceptFile = new File(gradle.gradleUserHomeDir, "gradle-scans-license-agree.txt")
+def env = System.getenv()
+boolean isCI = env.CI || env.TRAVIS || env.TEAMCITY_VERSION
+boolean hasAccepted = isCI || env.GRADLE_SCANS_ACCEPT=='yes' || acceptFile.exists() && acceptFile.text.trim() == 'yes'
+boolean hasRefused = env.GRADLE_SCANS_ACCEPT=='no' || acceptFile.exists() && acceptFile.text.trim() == 'no'
+
+buildScan {
+ if (hasAccepted) {
+ licenseAgree = 'yes'
+ publishAlways()
+ } 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 `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.
+"""
+ }
+ }
+}
\ No newline at end of file