Buildship doesn’t work very well for composite builds (GHI #511, GHI #908), but at least some of the problems can be worked around when tweaking which projects actually use includeBuild
in their settings.gradle
. The problem is that settings.gradle
becomes difficult to maintain that way, because only Buildship requires those workarounds, not Gradle itself e.g. when executing on the shell or in Jenkins.
That’s why I thought of using different settings.gradle
with different names for different environments. I can think of various ways to do that: Eclipse manages its own config for executing Gradle and in that one can provide additional arguments, like –settings-file=somewhere/else/settings.gradle But each and every user would need to do that with each and every Eclipse-instance.
Is there some additional way using a plugin? I would like to have something like the following pseudocode. The applied plugin should detect Buildship and if so, apply settings from another settings.gradle
and abort things afterwards, so that includeBuild
is not executed anymore.
rootProject.name = 'de.am_soft.sm_mtg.api'
apply from: 'buildSrc/BuildshipHandler.gradle'
includeBuild('../de.am_soft.sm_mtg.parser.ks')
{
[...]
}
Is that possible? If so, how do I detect Buildship and how do I make applying the current settings file stop? I know that “return” works in settings.gradle
itself, but returning from a plugin is different.
Thanks!