-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
48 lines (42 loc) · 1.22 KB
/
build.gradle
File metadata and controls
48 lines (42 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'org.ajoberstar:grgit:2.0.0'
}
}
apply plugin: 'org.ajoberstar.grgit'
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task pushToOrigin {
description = 'Pushes current branch\'s committed changes to origin repo.'
doLast {
def credentials = new org.ajoberstar.grgit.Credentials(username, password)
def grgit1 = grgit.open {
currentDir = ""
creds = credentials
}
grgit1.add(update: true, patterns: ['.'])
grgit1.commit(message: "changes")
grgit1.push()
grgit1.close()
}
}
task initGit {
dependsOn 'pushToOrigin'
dependsOn ':app:buildAndPush'
dependsOn ':TestGitAutoPushSubModule:app:buildAndPush'
tasks.getByPath(":app:buildAndPush").mustRunAfter(":TestGitAutoPushSubModule:app:buildAndPush")
tasks.findByName('pushToOrigin').mustRunAfter(":app:buildAndPush")
}
task clean(type: Delete) {
delete rootProject.buildDir
}