Javi
03/10/2025, 10:46 AMtasks.register("compile") { dependsOn(tasks.withType<KotlinCompile>() }
, but KGP, Java, and any plugin that compiles could depends on it.
• `generate`: I don't want to run ksp, proto, sqldelight, or whatever random task to generate everything in the project without compile (so, I don't want to run assemble
). In some side projects I am doing tasks.register("generate") { dependsOn(tasks.named { it.contains("generate") && it != "generate" } }
. But it would be great if plugins can just use a official one so I don't have to workaround any generation task that does not contain generate
.ephemient
03/10/2025, 12:12 PMassemble
ephemient
03/10/2025, 12:15 PMephemient
03/10/2025, 12:17 PMsourcesJar
should effectively cause all sources to be generated, without extra compilationJavi
03/10/2025, 12:19 PMephemient
03/10/2025, 2:56 PMtasks.withType<Test>().configureEach {
onlyIf { !project.hasProperty("skip.tests") }
}
./gradlew test -Pskip.tests
Vampire
03/12/2025, 8:39 PMcompile
would currently more be classes
and testClasses
(and any further <sourceSet>Classes
)
assemble
would not include test but would do other stuff like building jar and so on.
generate
I would actually second, then IDEs would have a way to get all sources to disk. I usually create such a task myself and use idea-ext
to configure IJ to call the task after sync, but would be nice if it just worked.Javi
03/12/2025, 11:18 PMVampire
03/13/2025, 3:15 AMidea-ext
configuring an after-sync task, because that is documented and officially supported behaviorJavi
03/13/2025, 9:47 AMVampire
03/13/2025, 2:56 PM