Arjan van Wieringen (avwie)
06/01/2025, 8:19 AMArjan van Wieringen (avwie)
06/01/2025, 8:24 AM./gradlew projects
...
Included builds
+--- Included build ':apps'
\--- Included build ':libs'
...
./gradlew :libs:projects
...
Project ':libs'
\--- Project ':libs:asset-mapper'
\--- Project ':libs:asset-mapper:asset-mapper-core'
Included builds
+--- Included build ':apps'
\--- Included build ':libs'
....
./gradlew :libs:tasks
....
test - Runs the test suite
....
./gradlew :libs:test
FAILURE: Build failed with an exception.
* What went wrong:
Cannot locate tasks that match ':libs:test' as task 'test' not found in project ':libs'.
and this works (obviously):
./gradlew :libs:asset-mapper:asset-mapper-core:test
With "normal" projects (so no composite builds) this works just fine. And it is also how I expect Gradle to behave. That subproject tasks are discovered and executed if they exist when calling it at toplevel.
I assume I have a config error somewhere, but the libs project does not include any other builds or dependencies. And it is the only includeBuild at root level.Adam
06/01/2025, 8:26 AMArjan van Wieringen (avwie)
06/01/2025, 8:29 AMVampire
06/01/2025, 10:37 AMtest in some project (does not have to be the root project) it executes test in that project and all descendents where it exists. If you execute :test it only executes the test task of the given project, in this case the root project.
If you call :libs:test, that is with path and so it does exactly what you asked for, running the test task in the libs project (not build).
For what you want, you have to call without path, so gw -p libs test.Arjan van Wieringen (avwie)
06/01/2025, 11:40 AMArjan van Wieringen (avwie)
06/01/2025, 12:00 PM./gradlew :lib:tasks shows me the test task as well. I understand why it happens, but it implied that :lib:test is available when it isn't. It is when using 'normal' projects, but not with composite builds.Vampire
06/01/2025, 1:56 PMVampire
06/01/2025, 1:59 PMVampire
06/01/2025, 2:00 PMgw doc:tasks I see asciidoctor, but calling gw doc:asciidoctor does not work, calling gw -p doc asciidoctor would work though.Vampire
06/01/2025, 2:01 PM--all, the tasks task displays which tasks would be exectuable if you execute Gradle in that that project's directory without specifying an explicit path.Vampire
06/01/2025, 2:01 PM--all it shows the explicit individual tasks of the projects.Vampire
06/01/2025, 2:01 PMArjan van Wieringen (avwie)
06/01/2025, 2:29 PM