以前我的main build.gradle文件中包含了所有内容。我想分解它,让每个组件都有自己的build.gradle文件,然后将子组件中的那些库包含到主构建文件中。
之前: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
}
}
我正在尝试做什么:
的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
}
}
我现在的错误是主build.gradle文件无法通过:lib1名称找到库。有人能告诉我我错过了什么,或者这是否可能? 提前谢谢!