Parag Chandra
08/05/2024, 4:05 PMincludeBuild(featureA) and featureA in turn includeBuild(libraryB) and so on, how can I get a task reference to something like :libraryB:unitTest from the top-level project? right now i can only seem to get task references one level deep, e.g. `featureAunitTest`; but not :featureA:libraryB:unitTest or :libraryB:unitTest.Vampire
08/05/2024, 4:31 PMlibraryB.
If you want the included build of libraryB be used in the top-level build, you also need to include libraryB in the top-level build.
And then you refer to it with :libraryB:unitTest.
If you do not have that include in the top-level build, libraryB will be used when building featureA, but when using featureA in the top-level build, then not.Vampire
08/05/2024, 4:31 PMParag Chandra
08/05/2024, 4:33 PMVampire
08/05/2024, 4:34 PMParag Chandra
08/05/2024, 4:35 PMVampire
08/05/2024, 4:45 PMVampire
08/05/2024, 6:29 PMlibraryB and only featureA is including that build, it is still substituted from the included build.
But that note in the docs is mainly majorly confusing.
gradle.parent of libraryB and featureA is both the top-level build, that is meant with flattening
And if you refer to tasks from the builds from the commandline it is :featureA:build and :libraryB:build, that is also meant with flattening.
But gradle.includedBuilds for the top build contains only featureA
and for featureA contains libraryB.
And also with gradle.includedBuild(...) you can only access featureA from the top build and libraryB from featureA.
So there no flattening is done but the tree is preserved.
That seems to be a bit inconsistent. š¤·āāļø
So if you want to access tasks of the included build, you can indeed only access tasks from builds directly included in the same build.
So for that you would indeed need to include libraryB in the top-level build too.
Or alternatively you need to have the reference in featureA in a way that you can refer to that from the top-level build.Parag Chandra
08/05/2024, 6:31 PMdependsOn certain tasks of the child projects and composite builds, but that is only working for actual subprojects and direct `includeBuilds`; not nested composite builds.Parag Chandra
08/05/2024, 6:33 PMfeatureA would itself declare a task that dependsOn whatever I want from libraryB, and so on up the chainVampire
08/05/2024, 6:34 PMParag Chandra
08/05/2024, 6:35 PM