I have a settings plugin that is multi-project aware. It currently applies itself to every project identified in settings.gradle
. However, this is a problem because each subproject doesn't have the same configuration, and I control some plugin behavior through project properties set on the command-line via -P
.
The problem is that this fails on projects that don't have the configuration necessary to use that property, and I know of know way to apply a property to a specific subproject via the command-line.
Instead of iterating over settings.gradle.allprojects
, is there a way to know what projects have actually been included as part of the build? For example when I do:
gradle :subproject-name:build :other-subproject-name:build -PsomeProperty
I would like to know that only subproject-name
and other-subproject-name
were called so that I can apply the settings plugin to only those projects.
Or is there a way to "scope" project properties somehow, to only a particular project?