Can the evaluation of one module's buildscript depend on the artifacts of another module?

Effectively I want:

buildscript {


dependencies {

classpath project(’:plugin’)



apply plugin: ‘plugin-id-from-other-module’

I can’t seem to get it to work. I know you can have the the compilation of one module depend on artifacts from another, but can you have the evaluation of the buildscript delayed as well?

I should mention I can apply the plugin at execution time, but that doesn’t seem like the right way to go about things because I need the plugin to configure the build. I should also mention that it works if you’re able to build the dependent module first and separately (by commenting out the logic that uses the necessary classes from the sibling module’s buildscript). But that’s not a solution either.

Alternatively, an answer to the question, “how can you publish artifacts from a buildSrc project” would suffice.

A plugin that needs to be published needs to have its own build at this time. It isn’t possible to have one build script depend on another project, or to publish artifacts from ‘buildSrc’. (Unless you want to go for a hack such as setting Groovy source dirs of ‘buildSrc/build.gradle’ to a subproject’s source dirs. But that’s not a supported solution and has its own complications.)