-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
73 lines (63 loc) · 2.43 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
69
70
71
72
73
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
if (Boolean.parseBoolean(USE_ALIYUN_REPO)) {
// Replacement of google()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
// Replacement of mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// Replacement of jcenter()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
} else {
google()
jcenter()
mavenCentral()
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "cn.hikyson.methodcanary:plugin:${METHOD_CANARY_VERSION_NAME}"
}
}
allprojects {
repositories {
if (Boolean.parseBoolean(USE_ALIYUN_REPO)) {
// Replacement of google()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
// Replacement of mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// Replacement of jcenter()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
} else {
google()
jcenter()
mavenCentral()
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def realVersionName = VERSION_NAME
def TRAVIS_TAG = System.getenv("TRAVIS_TAG")
if (TRAVIS_TAG != null && "" != TRAVIS_TAG) {
realVersionName = TRAVIS_TAG
println "[VERSION] Version name is [" + realVersionName + "] by git tag."
} else {
println "[VERSION] Version name is [" + realVersionName + "] by gradle.properties."
}
def versionPart = String.valueOf(realVersionName).split('\\.')
int realVersionCode = Integer.valueOf(versionPart[0]) * 1000000 + Integer.valueOf(versionPart[1]) * 1000 + Integer.valueOf(versionPart[2])
ext {
REAL_VERSION_NAME = realVersionName
REAL_VERSION_CODE = realVersionCode
}
println "[VERSION] Version name is [" + rootProject.ext.REAL_VERSION_NAME + "] and parsed version code is [" + rootProject.ext.REAL_VERSION_CODE + "]."
task copyForRelease(type: Copy) {
from './app/build/outputs/apk/release/app-release.apk'
into "./github_release"
}
task copyForDebug(type: Copy) {
from './app/build/outputs/apk/debug/app-debug.apk'
into "./github_release"
}