Commit c864aad8 authored by pengjunjign's avatar pengjunjign

add:优化导入脚本

parent c53fd5ee
import java.lang.reflect.Field
import java.text.SimpleDateFormat
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.5.0'
......@@ -27,8 +30,13 @@ task clean(type: Delete) {
delete rootProject.buildDir
}
//推送模块目前使用的分支
String pushModuleCurrentBranch = "dev"
/**
* 导入推送模块,如果push目录下为空(包含隐藏文件,.git文件),则初始化子模块,拉取代码.
* 导入推送模块,
* 如果push目录下为空(包含隐藏文件,.git文件),
* 则初始化子模块,拉取代码,切换到指定的分支
*/
task importPushModule() {
println("add submodule before")
......@@ -42,5 +50,11 @@ task importPushModule() {
println(cmd2)
println("no init submodule , only init once in project")
}
//切换所有子仓库的分支,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释
("git submodule foreach git checkout " + pushModuleCurrentBranch).execute()
//拉取最新代码,有网络操作,会增加编译耗时,项目第一次完整构建完后视情况自行注释
"git submodule foreach git pull".execute()
println("git submodule foreach git branch".execute().text)
println("add submodule after")
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment