一个 Android
的代码库
-
进入项目执行:
git submodule add -b master --name android [email protected]:lx0758/Android.git android
-
然后在
setting.gradle
中按需添加模块. 如果使用gradle
则:include ':libraries:http' include ':libraries:io' ... def androidDir = rootProject.projectDir.path + File.separator + 'android' rootProject.children.each { project -> if (project.path.startsWith(':libraries')) { project.children.each { childProject -> childProject.projectDir = file(androidDir + File.separator + 'librarys' + File.separator + childProject.name) } } }
如果使用
kts
则:include(":libraries:http") include(":libraries:io") ... val librariesDir = File(File(rootDir, "android"), "libraries") fun traversal(project: ProjectDescriptor) { project.children.forEach { if (it.path.startsWith(":libraries:")) { it.projectDir = File(librariesDir, it.name) return@forEach } traversal(it) } } traversal(rootProject)
-
最后依赖使用. 如果使用
gradle
则:implementation project(':libraries:http') implementation project(':libraries:io')
如果使用
kts
则:implementation(project(":libraries:http")) implementation(project(":libraries:io"))
详见文档: README.md