Ivan CLOVIS Canet
04/20/2025, 3:36 PMtest {
onOutput { descriptor, event ->
if (event.destination == TestOutputEvent.Destination.StdErr) {
logger.error("Test: " + descriptor + ", error: " + event.message)
}
}
}
I'm struggling on onOuput
. I guess it's something like
onOutput(closureOf<???> {})
but I don't know what the type is.Jonathing
04/21/2025, 12:20 PMGábor Török
04/21/2025, 9:11 PMJavaExec
tasks by presetting some properties like system properties, env properties, classpath, etc, and i am wondering what's the best way for for it would be. these values need to be different based on which environment we want to run in.
i have come up with something like this:
abstract class ExecInStaging : JavaExec() {
init {
systemProperty("appconfig", "config/staging.properties")
systemProperty("log4j.configurationFile", "log4j2-local.xml")
environment("CONSUL_HOST", STAGING_CONSUL)
classpath = project.extensions
.getByType<JavaPluginExtension>()
.sourceSets
.getByName("main")
.runtimeClasspath
}
}
this works - but i am wondering if there are some best practices around this that i am missing? doing all this configuration in the constructor feels a bit weird - especially since now i am getting a bunch of IDE warnings due to Calling non-final function {} in constructor
...
is there a better way to do this?Philip W
04/22/2025, 8:50 AMChris
04/22/2025, 12:45 PMAdam
04/22/2025, 5:53 PMsystemProperty("...", "...")
work, but these are eager and I want to avoid them.
Weirdly when I print all properties in the application they appear under a different property - sun.java.command=org.example.AppKt -DsecretFile=/Users/dev/my-project/secret-file
.
I think it's weird there's an inconsistency. I would expect both approaches to work the same.
Also, I think it's weird that logging commandLine
returns a null
as the first element: [:run] running task [null, -DsecretFile=/Users/dev/my-project/secret-file]
plugins {
kotlin("jvm") version "2.1.20"
application
}
tasks.run.configure {
val secretFile = layout.projectDirectory.file("secret-file")
inputs.file(secretFile)
argumentProviders += CommandLineArgumentProvider {
listOf("-DsecretFile=${secretFile.asFile.absoluteFile.invariantSeparatorsPath}")
}
systemProperty("secretFileWorks", secretFile.asFile.absoluteFile.invariantSeparatorsPath)
doFirst {
println("[$path] running task $commandLine")
}
}
Gradle version is 8.13Philip W
04/22/2025, 8:01 PMlifecycle.afterProject
. But the project does not find the plugin this way, but it finds the plugin if I apply it directly in my build.gradle.kts script.Ayanda Mtungwa
04/23/2025, 11:34 AMKur'an Ögrenme
04/23/2025, 12:52 PMMartin
04/24/2025, 5:24 PM8.13
and not 8.13.0
? Gets me every time 😅Sergej Koščejev
04/25/2025, 2:31 PMif (someCondition) { into(...) { ... } }
but where someCondition is a boolean Property?Giuseppe Barbieri
04/25/2025, 3:58 PMorg.jogamp.gluegen:gluegen-rt
, org.jogamp.joal:joal
, etc
code here, I can work around for the configurations and the publications, but the javaComponent
is a problem, or does anyone see a way?fantastic Dev
04/25/2025, 4:41 PM% ./gradle
Error occurred during initialization of VM
Could not resolve "ZIP_Open": /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/libzip.dylib
Eli Graber
04/25/2025, 4:45 PMjava.lang.System::load
warnings with Gradle 8.14 and Java 24? I would think not because of #31625, but not sure.Eli Graber
04/25/2025, 5:24 PM--enable-native-access=ALL-UNNAMED
to my jvm args until all of these libraries/tools migrate off of JNI (so probably never)?
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.android.layoutlib.bridge.Bridge in an unnamed module (file:/home/eli/.gradle/caches/8.14/transforms/7ddbbeceffb506f2342ae2f7da76cf06/transformed/layoutlib-15.1.4.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Sebastian Schuberth
04/27/2025, 8:11 AMBob Shalom
04/27/2025, 8:17 AMVladimir Sitnikov
04/28/2025, 7:22 AMConfigurableFileCollection
vs ListProperty<RegularFile>
Is there anything like “prefer ConfigurableFileCollection
in newer code” or “prefer ListProperty<RegularFile>
in newer code” ?
I assume the answer should be the same for both task properties and extension properties, however, it would be great to learn if there’s a difference.Giuseppe Barbieri
04/28/2025, 12:20 PMorg.jogamp.gluegen:gluegen-rt
and the natives as variants
now I'm on the consumer side, with a test project, expanding the runtime configuration for each variant, adding the corresponding file underneath, but Gradle complains:
Could not resolve org.jogamp.gluegen:gluegen-rt:0.0.8 for variant-tester:main
Could not resolve org.jogamp.gluegen:gluegen-rt:0.0.8 for variant-tester:test
hissam ud din
04/29/2025, 12:58 AMA problem occurred configuring project ':gradle'.> Multiple build operations failed. Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform ...and 20 more failures. > Could not isolate parameters org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of artifact transform MergeInstrumentationAnalysisTransform > Could not isolate value org.gradle.api.internal.initialization.transform.MergeInstrumentationAnalysisTransform$Parameters_Decorated@50814c83 of type MergeInstrumentationAnalysisTransform.Parameters > Multiple build operations failed. Could not move temporary workspace (C:\Users\dell\.gradle\caches\8.10.2\transforms\904c97b439784601ff0eee25e3c43bac-84c63b27-7c61-4f8e-b3c9-ac04c14f9c94) to immutable location (C:\Users\dell\.gradle\caches\8.10.2\transforms\904c97b439784601ff0eee25e3c43bac) Could not move temporary workspace (C:\Users\dell\.gradle\caches\8.10.2\transforms\4c75e264bb05f340dad2540f720bcb1b-9fc2d5c5-fbc6-4b93-8074-75ef4d405d09) to immutable location (C:\Users\dell\.gradle\caches\8.10.2\transforms\4c75e264bb05f340dad2540f720bcb1b) > Could not move temporary workspace (C:\Users\dell\.gradle\caches\8.10.2\transforms\904c97b439784601ff0eee25e3c43bac-84c63b27-7c61-4f8e-b3c9-ac04c14f9c94) to immutable location (C:\Users\dell\.gradle\caches\8.10.2\transforms\904c97b439784601ff0eee25e3c43bac) > Could not move temporary workspace (C:\Users\dell\.gradle\caches\8.10.2\transforms\4c75e264bb05f340dad2540f720bcb1b-9fc2d5c5-fbc6-4b93-8074-75ef4d405d09) to immutable location (C:\Users\dell\.gradle\caches\8.10.2\transforms\4c75e264bb05f340dad2540f720bcb1b) * 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 1m 38s Error: Gradle task assembleDebug failed with exit code 1
Kaan Avdan
04/29/2025, 8:27 AMKen Yee
04/29/2025, 7:18 PMtasks.register("updateModuleCapabilitiesIndex") {
val watchFiles = fileTree(project.rootDir) {
include("**/build.gradle", "**/build.gradle.kts")
}.files
val moduleIndexFile = "${layout.buildDirectory.get()}/moduleCapabilities.json"
val moduleIndexCmdLine = listOf(
"./gradlew",
"...",
)
inputs.files(watchFiles)
doLast {
providers.exec {
commandLine = moduleIndexCmdLine
}
}
dependsOn("build")
}
Command removed for simplification, but I'm trying to write something that parses the gradle files and then saves the info into another file in a cacheable way.
The doLast{...} bit unfortunately contains a gradle script which is not serializable... Tried to search in this slack but configuration cache gets a lot of unrelated hits 😂SettingDust
04/30/2025, 3:13 AMCircular dependency between the following tasks:
work action Dependencies for XXXXXX
? Looks like the transform action depends on each other?
The image is the cycle shows in debugger. Looks like the states of different transform is looping. How can I avoid that?
https://github.com/SettingDust/cloche/blob/feature/extract-includes/src/main/kotlin/earth/terrarium/cloche/target/TargetCompilation.kt#L122-L148
Circular dependency between the following tasks:
work action Dependencies for dev.su5ed.sinytra.fabric-api:fabric-api-deprecated:0.92.2+1.11.11+1.20.1 {earth.terrarium.cloche.modState=none}
Rochana Prabasara
04/30/2025, 6:46 AMEmil Kantis
04/30/2025, 8:30 AMHadi
05/01/2025, 10:57 PMEntry META-INF/gradle.kotlin_module is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.10.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.* 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 491ms Running Gradle task 'assembleRelease'... 583ms Gradle task assembleRelease failed with exit code 1
Stephen Muendo
05/02/2025, 9:21 AMA problem occurred configuring project ':gradle'.> Could not resolve all artifacts for configuration 'Gclasspath'. > Failed to transform kotlin-compiler-embeddable-1.9.24.jar (org.jetbrains.kotlinkotlin compiler embeddable1.9.24) to match attributes {artifactType=jar, org.gradle.category=library, org.gradle.internal.instrumented=instrumented-and-upgraded, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for ExternalDependencyInstrumentingArtifactTransform: C:\Users\STEVE\.gradle\caches\8.10.2\transforms\9478a9a76c123b2f65189f158657fc62\transformed\merge\instrumentation-dependencies.bin. > java.lang.IllegalStateException: Could not serialize types map to a file: C:\Users\STEVE\.gradle\caches\8.10.2\transforms\9478a9a76c123b2f65189f158657fc62\transformed\merge\instrumentation-dependencies.bin * 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 Error: Gradle task assembleDebug failed with exit code 1
Muhammad Moeen
05/02/2025, 4:20 PM> Task :gradle-plugin:react-native-gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:react-native-gradle-plugin:classes
> Task :gradle-plugin:react-native-gradle-plugin:jar
> Task :expo-dev-launcher-gradle-plugin:compileKotlin
> Task :expo-dev-launcher-gradle-plugin:compileJava NO-SOURCE
> Task :expo-dev-launcher-gradle-plugin:classes
> Task :expo-dev-launcher-gradle-plugin:jar
> Configure project :app
ℹ️ Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@5.1.10)
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/home/expo/workingdir/build/node_modules/expo-clipboard/android/build.gradle' line: 3
* What went wrong:
Plugin [id: 'expo-module-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (not a core plugin. For more available plugins, please refer to <https://docs.gradle.org/8.10.2/userguide/plugin_reference.html> in the Gradle documentation.)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (plugin dependency must include a version number for this source)
* 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>.
==============================================================================
2: Task failed with an exception.
-----------
* Where:
Script '/home/expo/workingdir/build/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 95
* What went wrong:
A problem occurred configuring project ':expo'.
> Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
* 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 1m 35s
18 actionable tasks: 18 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
James Daugherty
05/02/2025, 11:30 PMAnthony Spencer
05/02/2025, 11:44 PM