How do you add a Gradle Composite Build to the buildscript classpath

I have included a sub-project using includeBuild in the settings.gradle file. I want to reference this project in the buildscript classpath. Both classpath project(":projectname") and classpath 'mygroup:subproject' in the build.gradle file but this does not seem to work. I tried explicit Dependency Substitutions for the latter case in settings.gradle file also with

which did not work.

The projects are not published as they are new and coding is WIP hence cannot be built as yet.

Upvotes: 3

Views: 559

Answers (1)

sunwei
sunwei

Reputation: 371

includeBuild('subproject') {
    dependencySubstitution { 
        substitute module("mygroup:subproject") using(project(':'))
    } 
}

Upvotes: 0

Related Questions