forked from brevent/Brevent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (75 loc) · 2.31 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
82
83
84
85
86
87
88
89
buildscript {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
if (file('brevent-server').exists()) {
// https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml
classpath 'io.fabric.tools:gradle:1.24.4'
}
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven {
url 'https://maven.fabric.io/public'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def getBreventVersion = { ->
def tag = 'git describe --tags --always --dirty'.execute().text.trim()
if (tag.startsWith('v')) {
tag = tag.substring(1)
}
return tag
}
def isIde = { ->
def ide = false
def taskRequests = project.gradle.startParameter.taskRequests
if (taskRequests?.empty) {
ide = true
} else {
taskRequests[0].args.any {
if (it.endsWith('generateDebugSources') || it.endsWith('assembleDebug')) {
ide = true
return true
}
}
return ide
}
}
project.ext.abiFilters = ['armeabi', 'arm64-v8a', 'x86', 'x86_64']
project.ext.supportLibraryVersion = '27.0.1'
project.ext.buildToolsVersion = '27.0.0'
project.ext.minSdkVersion = 21
project.ext.targetSdkVersion = 27
project.ext.versionCode = 124
if (rootProject.file('.git').exists()) {
project.ext.simpleVersionName = getBreventVersion()
} else {
project.ext.simpleVersionName = rootProject.file('brevent-server.txt').text.trim().substring(1)
}
project.ext.versionName = project.ext.simpleVersionName
if (rootProject.file('ant.properties').exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(rootProject.file('ant.properties')))
if (properties['build.codename'] != null) {
project.ext.versionName = properties['build.codename'] + '(' + project.ext.simpleVersionName + ')'
}
}
project.ext.isIde = isIde()
project.ext.hiddenApi = files(project(':hidden-api').file('build/intermediates/bundles/release/classes.jar'))