-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Summary
Missing up-to-date checks for Jar tasks: when data collected by nebula.info changes (e.g. Git commit), it should invalidate any previous jar tasks, instead of reusing the old task output.
https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks
Expected behavior
jartask is executed on second build- The resulting
.jarfile content reflects the data collected bynebula.infoduring the second build.
Actual behavior
jartask is skipped on second build, and marked asUP-TO-DATE- The resulting
.jarfile content reflect the data collected bynebula.infoduring the previous build.
$ ./gradlew --console=plain jar
Picked up JAVA_TOOL_OPTIONS: "-XX:+UsePerfData" "-Duser.language=en" "-Duser.country=US" "-Duser.timezone=UTC" "-Dfile.encoding=UTF-8"
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :createPropertiesFileForJar
> Task :writeManifestProperties
> Task :jar
BUILD SUCCESSFUL in 2s
3 actionable tasks: 3 executed
$ git commit -m "some commit" --allow-empty
[detached HEAD 26bcee2e15962c90f5614e3f757c7b2332d6851f] some commit
$ ./gradlew --console=plain jar
Picked up JAVA_TOOL_OPTIONS: "-XX:+UsePerfData" "-Duser.language=en" "-Duser.country=US" "-Duser.timezone=UTC" "-Dfile.encoding=UTF-8"
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :createPropertiesFileForJar UP-TO-DATE
> Task :writeManifestProperties
> Task :jar UP-TO-DATE
BUILD SUCCESSFUL in 2s
3 actionable tasks: 1 executed, 2 up-to-date
Steps to reproduce
- Initialize Git repository
git init .
- Create Gradle build structure, with
build.gradle.kts:
plugins {
id("java-library")
id("nebula.info") version "11.4.1"
}
infoBroker {
// only include reproducible entries (entries such as build time do not comply to https://reproducible-builds.org/)
includedManifestProperties = listOf(
"Full-Change",
)
}
- Create initial commit to initialize HEAD
git add build.gradle.kts settings.gradle.kts gradlew gradlew.bat <...>
git commit -m 'initial commit'
- Trigger initial build on initial commit
./gradlew --console=plain jar
- Add a new commit, to change HEAD
git commit -m 'some commit message' --allow-empty
- Trigger new build, on new commit/HEAD
./gradlew --console=plain jar
Context
------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.14.1 (Eclipse Adoptium 11.0.14.1+1)
OS: Windows 10 10.0 amd64
Workaround
plugins.withType<InfoBrokerPlugin> manifestPlugin@{
plugins.withType<InfoJarManifestPlugin> {
tasks.withType<Jar>().configureEach {
inputs.property(
"nebula.info-jar-workaround",
provider {
this@manifestPlugin.buildManifest()
}
)
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels