mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 01:40:26 +01:00
gradle.yml, graalvm.yml: enable Gradle Build Scan
Adds a Gradle initialization script to non-interactively agree to the Gradle Build Scan terms of service. Provided by Stefan Wolf via GitHub Issues, see https://github.com/gradle/gradle/issues/26316#issuecomment-1739245349 Tested with Gradle 4.4 to Gradle 8.4.
This commit is contained in:
parent
bfae3a8913
commit
474d8d91f7
2
.github/workflows/graalvm.yml
vendored
2
.github/workflows/graalvm.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
uses: gradle/gradle-build-action@v2.8.0
|
uses: gradle/gradle-build-action@v2.8.0
|
||||||
with:
|
with:
|
||||||
gradle-version: ${{ matrix.gradle }}
|
gradle-version: ${{ matrix.gradle }}
|
||||||
arguments: test nativeCompile --info --stacktrace
|
arguments: test nativeCompile --init-script build-scan-agree.gradle --scan --info --stacktrace
|
||||||
- name: Upload wallet-tool as artifact
|
- name: Upload wallet-tool as artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/gradle.yml
vendored
2
.github/workflows/gradle.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
uses: gradle/gradle-build-action@v2.8.0
|
uses: gradle/gradle-build-action@v2.8.0
|
||||||
with:
|
with:
|
||||||
gradle-version: ${{ matrix.gradle }}
|
gradle-version: ${{ matrix.gradle }}
|
||||||
arguments: -PtestJdk8=true build --info --stacktrace
|
arguments: -PtestJdk8=true build --init-script build-scan-agree.gradle --scan --info --stacktrace
|
||||||
- name: Upload Test Results and Reports
|
- name: Upload Test Results and Reports
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
if: always()
|
if: always()
|
||||||
|
37
build-scan-agree.gradle
Normal file
37
build-scan-agree.gradle
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* Gradle Init Script to non-interactively agree to the Gradle Build Scan terms of service
|
||||||
|
* Provided by Stefan Wolf via GitHub Issues
|
||||||
|
* See: https://github.com/gradle/gradle/issues/26316#issuecomment-1739245349
|
||||||
|
* To use add `--scan --init-script build-scan-agree.gradle` to your Gradle command-line
|
||||||
|
* Works with Gradle 4.4 - Gradle 8.4 (at least)
|
||||||
|
*/
|
||||||
|
def isTopLevelBuild = gradle.getParent() == null
|
||||||
|
|
||||||
|
if (isTopLevelBuild) {
|
||||||
|
def gradleVersion = GradleVersion.current().baseVersion
|
||||||
|
def atLeastGradle6 = gradleVersion >= GradleVersion.version("6.0")
|
||||||
|
if (atLeastGradle6) {
|
||||||
|
settingsEvaluated { settings ->
|
||||||
|
settings.pluginManager.withPlugin("com.gradle.enterprise") {
|
||||||
|
configureExtension(settings.extensions["gradleEnterprise"].buildScan)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rootProject { root ->
|
||||||
|
root.pluginManager.withPlugin("com.gradle.build-scan") {
|
||||||
|
configureExtension(root.extensions["buildScan"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void configureExtension(extension) {
|
||||||
|
extension.with {
|
||||||
|
if (delegate.metaClass.respondsTo(delegate, 'setTermsOfServiceUrl')) {
|
||||||
|
termsOfServiceUrl = "https://gradle.com/terms-of-service"
|
||||||
|
termsOfServiceAgree = "yes"
|
||||||
|
} else {
|
||||||
|
licenseAgreementUrl = "https://gradle.com/terms-of-service"
|
||||||
|
licenseAgree = "yes"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user