Skip to content

Commit c80cdc9

Browse files
committed
see 08/16 log
1 parent 4565226 commit c80cdc9

File tree

1 file changed

+32
-45
lines changed

1 file changed

+32
-45
lines changed
Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import org.gradle.api.Action
22
import org.gradle.api.Project
3-
import org.gradle.api.Task
43
import org.gradle.api.invocation.Gradle
54

65
import java.text.SimpleDateFormat
@@ -34,55 +33,43 @@ class GitUtils {
3433
}
3534

3635
static void addGitPushTask(Project project) {
37-
project.task("gitPush", new Action<Task>() {
38-
@Override
39-
void execute(Task task) {
40-
task.doLast {
41-
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
42-
String date = simpleDateFormat.format(new Date())
43-
GLog.d(ShellUtils.execCmd([
44-
"git add -A",
45-
"git commit -m \"see $date log\"",
46-
"git push origin $sCurBranchName"
47-
] as String[]))
48-
}
49-
}
50-
})
36+
project.task("gitPush").doLast {
37+
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
38+
String date = simpleDateFormat.format(new Date())
39+
GLog.d(ShellUtils.execCmd([
40+
"git add -A",
41+
"git commit -m \"see $date log\"",
42+
"git push origin $sCurBranchName"
43+
] as String[]))
44+
}
5145
}
5246

5347
static void addGitPushAndMerge2MasterTask(Project project) {
54-
project.task("gitPushAndMerge2Master", new Action<Task>() {
55-
@Override
56-
void execute(Task task) {
57-
task.doLast {
58-
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
59-
String date = simpleDateFormat.format(new Date())
60-
GLog.d(ShellUtils.execCmd([
61-
"git add -A",
62-
"git commit -m \"see $date log\"",
63-
"git push origin $sCurBranchName",
64-
"git checkout master",
65-
"git merge $sCurBranchName",
66-
"git push origin master",
67-
"git checkout $sCurBranchName",
68-
] as String[]))
69-
}
70-
}
71-
})
48+
project.task("gitPushAndMerge2Master").doLast {
49+
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
50+
String date = simpleDateFormat.format(new Date())
51+
GLog.d(ShellUtils.execCmd([
52+
"git add -A",
53+
"git commit -m \"see $date log\"",
54+
"git push origin $sCurBranchName",
55+
"git checkout master",
56+
"git merge $sCurBranchName",
57+
"git push origin master",
58+
"git checkout $sCurBranchName",
59+
] as String[]))
60+
}
7261
}
7362

7463
static void addGitNewBranchTask(Project project) {
75-
project.task("gitNewBranch", new Action<Task>() {
76-
@Override
77-
void execute(Task task) {
78-
task.doLast {
79-
GLog.d(ShellUtils.execCmd([
80-
"git checkout master",
81-
"git checkout -b ${Config.versionName}",
82-
"git push origin ${Config.versionName}:${Config.versionName}",
83-
] as String[]))
84-
}
85-
}
86-
})
64+
project.task("gitNewBranch").doLast {
65+
GLog.d(ShellUtils.execCmd([
66+
"git checkout master",
67+
"git checkout -b ${Config.versionName}",
68+
"git push origin ${Config.versionName}:${Config.versionName}",
69+
] as String[]))
70+
}
8771
}
8872
}
73+
// ./gradlew gitPush
74+
// ./gradlew gitPushAndMerge2Master
75+
// ./gradlew gitNewBranch

0 commit comments

Comments
 (0)