gradle cannto find subproject of dependency -
i have following structure:
./mainproject/ -settings.gradle -build.gradle -subproject/ -build.gradle -/src/... ./libraryproject -settings.gradle -build.gradle -subproject_interfaces/ -build.gradle -src/... -subproject_impl/ -build.gradle -src/...
libraryproject/settings.gralde:
rootproject.name = 'library' include 'subproject_interfaces','subproject_impl'
libraryproject/build.gradle
dependencies { compile project(':subproject_interfaces') compile project(':subprojects_impl') }
mainproject/settings.gradle
include "library" project(':library').projectdir = new file(settingsdir,"../libraryproject")
mainproject/subproject/build.gradle
dependencies{ compile project(':library') }
- i can gradle build libraryproject fine.
- i can gradle build libraryproject via project dependency on mainproject fine.
- i cannot build mainproject due to:
project path: 'subproject_interfaces' not found in project ' library'
you misunderstood multi-project feature.
in 1 multi-project build have one settings.gradle
, there have build whole project tree.
cannot delegate main build settings.gradle
library build settings.gradle
.
if want work that, have include subprojects of library project in settings.gradle
of main build.
alternatively, can depend on library means of coordinates , deploy library repository mavenlocal()
, of course library project not automatically rebuilt if build main project, have manually (vai gradle task) deploy library artifacts.
alternatively can call library build task of type gradlebuild , depend on output of build. library build remains complete own gradle build triggered main build.
Comments
Post a Comment