I have a source dependency on a project that doesn’t use Gradle. I’m injecting a build using a one-off plugin:
package ....plugins.buildinjection;
import ...SomePlugin
class BuildInjectionPlugin implements Plugin<Settings> {
@Override
public void apply(Settings settings) {
settings.gradle.rootProject {
project.pluginManager.apply(SomePlugin.class)
}
}
}
I include the build for this plugin into the main project:
includeBuild('plugins/build-injection')
Everything works fine like this.
I would like to simplify things, though, by moving the code for this plugin to buildSrc
. If I do this, I start getting errors, because buildSrc
is not searched by the injected build:
* What went wrong:
Plugin [id: 'build-injection'] was not found in any of the following sources:
- Gradle Core Plugins (not a core plugin, please see https://docs.gradle.org/7.4.2/userguide/standard_plugins.html for available core plugins)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (plugin dependency must include a version number for this source)
Is there a technical reason why buildSrc
wouldn’t also be relevant for the injected build?