3

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

  • includeBuild('subproject') { dependencySubstitution { substitute module('mygroup:subproject') with project(':') } },
  • includeBuild('subproject') { dependencySubstitution { substitute module('mygroup:subproject') with project(':subproject') } } and
  • includeBuild('subproject') { dependencySubstitution { substitute module('mygroup:subproject') with project('subproject') } }.

which did not work.

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

  • For the record, buildscript syntax is `classpath 'mygroup:subproject'` (don't wrap in in `project()`) so not sure why it didn't work – Blundell Jan 10 '23 at 14:04

1 Answers1

0
includeBuild('subproject') {
    dependencySubstitution { 
        substitute module("mygroup:subproject") using(project(':'))
    } 
}
sunwei
  • 371
  • 3
  • 14