Vampire
09/01/2022, 9:15 PMAmanda
Nikolay
09/08/2022, 10:04 AMsrc/main/resources
val userProperty = System.getProperty("user.name")
val user = if (userProperty == "?") "nonroot" else userProperty
version = (System.getenv("CI_RELEASE_VERSION") ?: project.findProperty("CI_RELEASE_VERSION") as String? ?: "0.0.0-$user-$ts")
// For non-kotlin/non-jvm modules this will have to be different
val versionFile = file("src/main/resources/version.txt")
tasks {
val generateVersionTxt by registering() {
doFirst {
if (!versionFile.exists()) {
versionFile.parentFile.mkdirs()
}
versionFile.writeText(project.version.toString())
}
}
}
Any help would be appreciated.Amanda
Fleshgrinder
09/09/2022, 10:04 AMMapProperty
with any kind of Provider
in any entries value generally not supported by the configuration cache? I have a maximally trivial setup:
abstract class SomeTask : DefaultTask() {
@get:Input abstract val properties: MapProperty<String, String>
@TaskAction fun execute() {
println(properties.get())
}
}
tasks.register<SomeTask>("some") {
properties.put("some", project.providers.environmentVariable("SOME"))
}
* What went wrong:
Could not load the value of field `transformer` of `org.gradle.api.internal.provider.TransformBackedProvider` bean found in field `providers` of `org.gradle.api.internal.provider.DefaultMapProperty$CollectingProvider` bean found in field `__properties__` of task `:some` of type `Build_gradle$SomeTask`.
> org.gradle.api.internal.provider.MapCollectors$EntryWithValueFromProvider$$Lambda$2116/0x0000000802e5d580
MapProperty
is in general an almost unusable property, but this gives it the final blow I'm afraid. 😞Stephen Topley
09/09/2022, 5:15 PMrootProject.name = 'myProject'
println "rootProject = $rootProject.name"
build.gradle
tasks.register('myTask') {
doLast {
println 'myTask'
}
}
1st run with --configuration-cache
> ./gradlew myTask --configuration-cache
Configuration cache is an incubating feature.
Calculating task graph as no configuration cache is available for tasks: myTask
rootProject = myProject
> Task :myTask
myTask
BUILD SUCCESSFUL in 628ms
1 actionable task: 1 executed
Configuration cache entry stored.
2nd run with --configuration-cache
> ./gradlew myTask --configuration-cache
Configuration cache is an incubating feature.
Reusing configuration cache.
> Task :myTask
myTask
BUILD SUCCESSFUL in 606ms
1 actionable task: 1 executed
Configuration cache entry reused.
no 'rootProject = myProject' is output hereNikolay
09/13/2022, 8:36 AMNikolay
09/13/2022, 11:04 AMCalculating task graph as configuration cache cannot be reused because content of 2nd init script, '../../../../private/var/folders/1n/w4wyqv39743dyqflv68pv4fc0000gq/T/wrapper_init11.gradle', has changed.
Is this a known issue? Is it likely to be fixed in the future?Dzmitry Neviadomski
09/14/2022, 11:55 AMTapchicoma
09/14/2022, 7:38 PMUP-TO-DATE
)?Vinay Potluri
09/15/2022, 10:55 AM./gradlew :docs:docsTest \
-PrunBrokenConfigurationCacheDocsTests=true \
-PenableConfigurationCacheForDocsTests=true \
--tests "*snippet-dependency-management-customizing-resolution-capability-substitution-rule_groovy_capability" \
--tests "*snippet-dependency-management-customizing-resolution-capability-substitution-rule_kotlin_capability"
It executes successfully but unable to see task docsdocsTest being run.
My local logs don’t entirely match the issue’s logs
Any troubleshooting tips ?Tapchicoma
09/23/2022, 9:38 AMsettings.gradle.kts
?
gradle.beforeProject { ... }
tony
09/25/2022, 5:01 PMgradle init --configuration-cache
doesn't work in 7.5.1. https://github.com/gradle/gradle/issues/22188Zak Taccardi
09/26/2022, 8:20 AMString
input (parameter, it’s a file path) from within a ValueSource
and output a RegularFile
from that String
.
Is this possible with the ValueSource
API? If I try to @get:Inject
a ProjectLayout
, I get the following error:
Cannot fingerprint input file property 'rootSpec$1': No service of type ProjectLayout available in DefaultServiceRegistry.
> No service of type ProjectLayout available in DefaultServiceRegistry.
Eug
09/28/2022, 2:26 PMZak Taccardi
09/28/2022, 7:16 PMTaskProvider<Sync>
into a Provider<FileSystemLocation>
and support the config cache? With:
fun TaskProvider<Sync>.asFileSystemLocationSingleFile(): Provider<FileSystemLocation> {
return map {
it.outputs.files.asFileTree.elements.get()
}
.map {
// seeing `> Collection is empty.` error with config cache on
it.first()
}
}
I’m seeing this error:
1 problem was found storing the configuration cache.
- Task `:jenkinsfile:jenkinsfile-shared:modifySharedGroovy` of type `Build_gradle$ModifySharedGroovy`: value 'map(org.gradle.api.file.FileSystemLocation map(map(provider(task 'syncOriginalSharedGroovy', class org.gradle.api.tasks.Sync))) check-type())' failed to unpack provider
Clayton Walker
10/03/2022, 8:01 PM> Cannot cast object 'java.lang.Object@56ee54b7' with class 'java.lang.Object' to class 'org.gradle.api.DefaultTask'
From what I can tell it happens when you capture a local variable/function in an upToDateWhen closureChris Lee
10/04/2022, 1:51 AMInstead, the value of theis recomputed each time the build runs and only if the value changes the configuration cache is invalidated.ValueSource
Markus Maier
10/05/2022, 1:49 PMprocessResources
and I want to declare that properly 🧵Fleshgrinder
10/05/2022, 2:56 PMfileTree
created in a settings.gradle.kts
script (either via settings.fileTree
or gradle.serviceOf<ObjectFactory>().fileTree()
) is entirely ignored by the configuration cache. Changes on the file system are never picked up, and the cache is always considered up-to-date. 🤔Chris Lee
10/06/2022, 5:50 PMmapProp.put("foo", providers.systemProperty("user.name"))
workaround:
mapProp.put("foo", provider { System.getProperty("user.name") })
Tapchicoma
10/14/2022, 9:55 AMValueSource
providers are compatible with configuration cache only since Gradle 7.5?Jakub Chrzanowski
10/14/2022, 11:14 AMflatMap
on task provider, like:
val downloadDirProvider = runPluginVerifierTaskProvider.flatMap { runPluginVerifierTask ->
runPluginVerifierTask.downloadDir
}
in older Gradle, i.e. 6.9.2? It fails with:
1 problem was found storing the configuration cache.
- Task `:verifyPluginConfiguration` of type `org.jetbrains.intellij.tasks.VerifyPluginConfigurationTask`: cannot serialize object of type 'org.jetbrains.intellij.tasks.RunPluginVerifierTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See <https://docs.gradle.org/6.9.2/userguide/configuration_cache.html#config_cache:requirements:task_access>
This one works, but I doubt it’s valid enough:
val downloadDirProvider = runPluginVerifierTaskProvider.map { runPluginVerifierTask ->
runPluginVerifierTask.downloadDir.get()
}
El Zhang
10/17/2022, 9:12 AMmelix
10/17/2022, 2:09 PM* What went wrong:
Configuration cache state could not be cached: field '__options__' from type 'org.graalvm.buildtools.gradle.tasks.GenerateResourcesConfigFile': error writing value of type 'org.gradle.api.internal.provider.DefaultProperty'
> Configuration cache state could not be cached: field '_gr_owner_' from type 'org.graalvm.buildtools.gradle.dsl.NativeResourcesOptions': error writing value of type 'org.graalvm.buildtools.gradle.internal.BaseNativeImageOptions'
> Configuration cache state could not be cached: field '__configurationFileDirectories__' from type 'org.graalvm.buildtools.gradle.internal.BaseNativeImageOptions': error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'
> Configuration cache state could not be cached: field 'provider' from type 'org.gradle.configurationcache.serialization.codecs.ProviderBackedFileCollectionSpec': error writing value of type 'org.gradle.api.internal.provider.FlatMapProvider'
> Configuration cache state could not be cached: field 'transformer' from type 'org.gradle.api.internal.provider.TransformBackedProvider': error writing value of type 'org.graalvm.buildtools.gradle.NativeImagePlugin$$Lambda$2296/0x0000000801660f08'
> Configuration cache state could not be cached: field 'capturedArgs' from type 'java.lang.invoke.SerializedLambda': error writing value of type '[Ljava.lang.Object;'
> Unable to make field private final java.util.function.BiConsumer java.util.stream.Collectors$CollectorImpl.accumulator accessible: module java.base does not "opens java.util.stream" to unnamed module @3b11025d
melix
10/17/2022, 2:10 PMClayton Walker
10/20/2022, 8:27 PM@Internal
property called imageId
that’s set when the imageIdFile is set during the task action. https://github.com/bmuschko/gradle-docker-plugin/blob/master/src/main/groovy/com/bmuschko/gradle/docker/tasks/image/DockerBuildImage.groovy#L214
When using configurationCache the value ends up being unset, which causes an exception
Caused by: org.gradle.api.GradleException: The imageId property was not set from task buildImage
Is there a better way to handle an “output” of a task that isn’t a file, but a string in this case?Marek
11/04/2022, 7:48 AMcheckDebugLibrarires
task when configuration cache is applied.
[:hype_integration, :hype_integration] all package the same library [com.google.firebase:firebase-auth;capability group='com.google.firebase', name='firebase-auth', version='21.0.8'].
Multiple APKs packaging the same library can cause runtime errors. Placing each of the above libraries in its own dynamic feature and adding that feature as a dependency of modules requiring it will resolve this issue. Libraries that are always used together can be combined into a single feature module to be imported by their dependents. If a library is required by all feature modules it can be added to the base module instead.
https://issuetracker.google.com/u/0/issues/256891007Martin
11/06/2022, 9:47 AMproject.rootProject.allProjects {}
, how do I make this project isolation compatible? Do I have to tell my users to apply the plugin in all projects manually?