Skip to content

Support Gradle configuration cache #97

@sdavids

Description

@sdavids
$ mkdir /tmp/test && cd "$_"
$ gradle init --type java-library --java-version 21 --project-name test --dsl groovy --test-framework junit-jupiter --no-comments --no-incubating --quiet
$ perl -i -l -p -e "print \"    id 'net.nemerosa.versioning' version '2.8.2'\" if $. == 4" lib/build.gradle
$ printf '\nversioning {}\nversion = versioning.info.full\n' >> lib/build.gradle
$ git init --quiet
$ git add -A
$ git commit --quiet -m "initial"
$ ./gradlew --configuration-cache --quiet clean

FAILURE: Build failed with an exception.

* Where:
Build file '/private/tmp/test/lib/build.gradle' line: 32

* What went wrong:
Configuration cache problems found in this build.

2 problems were found storing the configuration cache.
- Build file 'lib/build.gradle': external process started 'git --version'
  See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:external_processes
- Build file 'lib/build.gradle': external process started 'git config --system --edit'
  See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:external_processes

See the complete report at file:///private/tmp/test/build/reports/configuration-cache/2cvh062oate61b7yhx8pzmmbf/3h3vaqnt0bpkufj7xky7uxoi0/configuration-cache-report.html
> Starting an external process 'git --version' during configuration time is unsupported.
> Starting an external process 'git config --system --edit' during configuration time is unsupported.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2s
$ gradle --version

------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------

Build time:   2024-03-22 15:52:46 UTC
Revision:     650af14d7653aa949fce5e886e685efc9cf97c10

Kotlin:       1.9.22
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21.0.2 (Eclipse Adoptium 21.0.2+13-LTS)
OS:           Mac OS X 12.7.4 x86_64
$ cat lib/build.gradle

plugins {
    id 'java-library'
    id 'net.nemerosa.versioning' version '2.8.2'
}

repositories {
    mavenCentral()
}

dependencies {
    testImplementation libs.junit.jupiter

    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

    api libs.commons.math3

    implementation libs.guava
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

tasks.named('test') {
    useJUnitPlatform()
}

versioning {}
version = versioning.info.full

configuration-cache-report.html

	at net.nemerosa.versioning.git.GitInfoService.getInfo(GitInfoService.groovy:37)
	at net.nemerosa.versioning.SCMInfoService$getInfo.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)(3 internal lines hidden)
	at net.nemerosa.versioning.VersioningExtension.computeInfo(VersioningExtension.groovy:195)
	at net.nemerosa.versioning.VersioningExtension.getInfo(VersioningExtension.groovy:182)
	at net.nemerosa.versioning.VersioningExtension_Decorated.getInfo(Unknown Source)

https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:external_processes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions