forked from microg/GmsCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (93 loc) · 3.15 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* SPDX-FileCopyrightText: 2013, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
ext.nlpVersion = '2.0-alpha2'
ext.remoteDroidGuardVersion = '0.1.2'
ext.safeParcelVersion = '1.6.0'
ext.wearableVersion = '0.1.1'
ext.kotlinVersion = '1.3.72'
ext.coroutineVersion = '1.3.7'
ext.annotationVersion = '1.1.0'
ext.appcompatVersion = '1.1.0'
ext.coreVersion = '1.3.0'
ext.fragmentVersion = '1.2.5'
ext.lifecycleVersion = '2.2.0'
ext.mediarouterVersion = '1.1.0'
ext.multidexVersion = '2.0.1'
ext.navigationVersion = '2.3.0'
ext.preferenceVersion = '1.1.1'
ext.recyclerviewVersion = '1.1.0'
ext.supportLibraryVersion = '28.0.0'
ext.slf4jVersion = '1.7.25'
ext.wireVersion = '3.2.2'
ext.androidBuildGradleVersion = '3.6.3'
ext.androidBuildVersionTools = '29.0.3'
ext.androidMinSdk = 14
ext.androidTargetSdk = 29
ext.androidCompileSdk = 29
repositories {
jcenter()
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$androidBuildGradleVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion"
}
}
def execResult(...args) {
def stdout = new ByteArrayOutputStream()
exec {
commandLine args
standardOutput = stdout
}
return stdout.toString().trim()
}
def gmsVersion = "20.24.14"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD"))
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0]
def gitDirty = execResult('git', 'status', '--porcelain').size() > 0
def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.'))
def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1))
def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0)
def ourVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "")
logger.lifecycle('Starting build for version {} ({})...', ourVersionName, ourVersionCode)
@Deprecated
String getMyVersionName() {
return ourVersionName
}
@Deprecated
int getMyVersionCode() {
return ourVersionCode
}
allprojects {
apply plugin: 'idea'
group = 'org.microg.gms'
version = ourVersionName
ext.appVersionCode = ourVersionCode
ext.isReleaseVersion = false
}
@Deprecated
def androidCompileSdk() { return androidCompileSdk }
@Deprecated
def androidTargetSdk() { return androidTargetSdk }
@Deprecated
def androidMinSdk() { return androidMinSdk }
@Deprecated
def versionCode() {
return ourVersionCode
}
@Deprecated
def versionName() {
return ourVersionName
}
subprojects {
repositories {
jcenter()
google()
}
}