-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
executable file
·68 lines (59 loc) · 1.61 KB
/
build.gradle
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "./buildConfig/app_config.gradle"
//apply from: "./buildConfig/upload.gradle"
buildscript {
ext.kotlin_version = '1.6.0'
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
// classpath 'com.xiaozhu:injectcode-gradle-plugin:1.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url uri('../snapshotRepo')
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//dependencies {
// implementation project(path: ':plugin')
//}
task checkoutGit() {
// doLast {
// println "开始进行下载"
// clone("main", "[email protected]:frontend/xuxiake.git", "master")
// }
}
/**
* 下载项目源码
* @param dir
* @param remote
* @param branch
*/
void clone(String dir, String remote, String branch) {
File dirFile = new File("${this.rootDir}/$dir")
println "现有路径是:$dirFile,是否存在:${dirFile.exists()},rootProject:${this.rootProject.rootDir.path}"
// if (dirFile.path == this.rootProject.path) {
// return
// }
def grGit
if (!dirFile.exists()) {
grGit = Grgit.clone(dir: dir, uri: remote)
grGit.checkout(branch: branch)
} else {
grGit = Grgit.open(dir: "${this.rootDir}")
// grGit.pull(rebase: false)
}
}