-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (67 loc) · 1.91 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
74
75
76
77
78
79
80
81
/**
* This file is part of INU Club.
*
* Copyright (C) 2021 INU Global App Center <[email protected]>
*
* INU Club is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* INU Club is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// THE VERSION NAME!
ext.base = '0.0.1'
ext.phase = 'alpha8'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"
classpath 'com.google.gms:google-services:4.3.5'
}
}
allprojects {
ext {
versionCode = getRevisionCount()
versionName = getVersionName(base, phase)
compileSdkVersion = 29
targetSdkVersion = 29
minSdkVersion = 26
}
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
/**
* We will use the git revision count as a version code.
* @return the git revision count, integer.
*/
static def getRevisionCount() {
return Integer.parseInt("git rev-list --count HEAD".execute().text.trim())
}
static def getVersionName(base, phase) {
String build = System.getenv("BITRISE_BUILD_NUMBER")
String all = ""
if (base)
all += base
if (build)
all += ".$build"
if (phase)
all += "-$phase"
return all
}