forked from alisonthemonster/Presently
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
60 lines (52 loc) · 1.77 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
apply from: 'versions.gradle'
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath "com.google.gms:google-services:$google_services_version"
classpath "io.fabric.tools:gradle:$fabric_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0-alpha02"
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
project.ext.androidVersionName = createVersionName()
project.ext.buildNumber = getBuildNumber()
project.ext.branchName = getBranchName()
}
def createVersionName() {
def buildNumber = getBuildNumber()
def patchNumber = 0
if (getBranchName().startsWith("release/")) {
patchNumber = buildNumber - 1
}
return major + "." + minor + "." + patchNumber
}
String getBranchName() {
return project.hasProperty("branchName") ? ((String) project.properties['branchName']).toString() : ""
}
//get the build number from the build server
String getBuildNumber() {
return project.hasProperty("buildNumber") ? ((String) project.properties['buildNumber']).toString() : ""
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// TODO add detekt