Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PushPlatformDemo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengjunjing
PushPlatformDemo
Commits
c864aad8
Commit
c864aad8
authored
May 31, 2021
by
pengjunjign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:优化导入脚本
parent
c53fd5ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
build.gradle
build.gradle
+15
-1
No files found.
build.gradle
View file @
c864aad8
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.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
ext
.
kotlin_version
=
'1.5.0'
ext
.
kotlin_version
=
'1.5.0'
...
@@ -27,8 +30,13 @@ task clean(type: Delete) {
...
@@ -27,8 +30,13 @@ task clean(type: Delete) {
delete
rootProject
.
buildDir
delete
rootProject
.
buildDir
}
}
//推送模块目前使用的分支
String
pushModuleCurrentBranch
=
"dev"
/**
/**
* 导入推送模块,如果push目录下为空(包含隐藏文件,.git文件),则初始化子模块,拉取代码.
* 导入推送模块,
* 如果push目录下为空(包含隐藏文件,.git文件),
* 则初始化子模块,拉取代码,切换到指定的分支
*/
*/
task
importPushModule
()
{
task
importPushModule
()
{
println
(
"add submodule before"
)
println
(
"add submodule before"
)
...
@@ -42,5 +50,11 @@ task importPushModule() {
...
@@ -42,5 +50,11 @@ task importPushModule() {
println
(
cmd2
)
println
(
cmd2
)
println
(
"no init submodule , only init once in project"
)
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"
)
println
(
"add submodule after"
)
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment