Previously I had everything in my main build.gradle file. I would like to break it up and have each component have its own build.gradle file, then include those libraries from the sub-components to the main build file.
Before: build.gradle
model.components {
mainApp(NativeExecutableSpec) {
sources.cpp.lib library: "lib1", linkage: "static"
sources.cpp.lib library: "lib2", linkage: "static"
}
lib1(NativeExecutableSpec) {
//defined source set
}
lib2(NativeExecutableSpec) {
//defined source set
}
}
What I’m trying to do:
build.gradle
model.components {
mainApp(NativeExecutableSpec) {
sources.cpp.lib library: ":lib1", linkage: "static"
sources.cpp.lib library: ":lib2", linkage: "static"
}
settings.gradle
include libFolder
libFolder/build.gradle
model.components {
lib1(NativeExecutableSpec) {
//defined source set
}
lib2(NativeExecutableSpec) {
//defined source set
}
}
My error now is that the main build.gradle file cannot locate the libraries by the :lib1 name. Can someone tell me what I’m missing or if this is possible? Thanks in advance!