build.gradle 3.21 KB
Newer Older
1
/*
Marvin W.'s avatar
Marvin W. committed
2
3
 * SPDX-FileCopyrightText: 2013, microG Project Team
 * SPDX-License-Identifier: Apache-2.0
4
5
6
 */

buildscript {
Marvin W.'s avatar
Marvin W. committed
7
    ext.nlpVersion = '2.0-alpha6'
8
    ext.remoteDroidGuardVersion = '0.1.2'
9
    ext.safeParcelVersion = '1.7.0'
Marvin W.'s avatar
Marvin W. committed
10
11
    ext.wearableVersion = '0.1.1'

Marvin W.'s avatar
Marvin W. committed
12
13
    ext.kotlinVersion = '1.4.32'
    ext.coroutineVersion = '1.3.8'
Marvin W.'s avatar
Marvin W. committed
14

Marvin W.'s avatar
Marvin W. committed
15
    ext.annotationVersion = '1.2.0'
Marvin W.'s avatar
Marvin W. committed
16
    ext.appcompatVersion = '1.2.0'
17
    ext.coreVersion = '1.3.0'
Marvin W.'s avatar
Marvin W. committed
18
    ext.fragmentVersion = '1.2.5'
Marvin W.'s avatar
Marvin W. committed
19
20
    ext.lifecycleVersion = '2.3.1'
    ext.mediarouterVersion = '1.2.2'
Marvin W.'s avatar
Marvin W. committed
21
    ext.multidexVersion = '2.0.1'
Marvin W.'s avatar
Marvin W. committed
22
    ext.navigationVersion = '2.3.5'
Marvin W.'s avatar
Marvin W. committed
23
24
    ext.preferenceVersion = '1.1.1'
    ext.recyclerviewVersion = '1.1.0'
Marvin W.'s avatar
Marvin W. committed
25
    ext.webkitVersion = '1.4.0'
Marvin W.'s avatar
Marvin W. committed
26

27
28
    ext.supportLibraryVersion = '28.0.0'
    ext.slf4jVersion = '1.7.25'
Marvin W.'s avatar
Marvin W. committed
29
    ext.volleyVersion = '1.2.0'
30
    ext.wireVersion = '3.2.2'
Marvin W.'s avatar
Marvin W. committed
31

Marvin W.'s avatar
Marvin W. committed
32
    ext.androidBuildGradleVersion = '4.1.0'
Marvin W.'s avatar
Marvin W. committed
33

Marvin W.'s avatar
Marvin W. committed
34
    ext.androidBuildVersionTools = '30.0.2'
Marvin W.'s avatar
Marvin W. committed
35
36
37

    ext.androidMinSdk = 14
    ext.androidTargetSdk = 29
38
    ext.androidCompileSdk = 30
Marvin W.'s avatar
Marvin W. committed
39

40
41
    repositories {
        jcenter()
42
        google()
43
    }
Marvin W.'s avatar
Marvin W. committed
44

45
    dependencies {
Marvin W.'s avatar
Marvin W. committed
46
47
        classpath "com.android.tools.build:gradle:$androidBuildGradleVersion"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
48
        classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion"
49
50
51
    }
}

Marvin W.'s avatar
Marvin W. committed
52
53
54
55
56
57
58
59
60
def execResult(...args) {
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine args
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

Marvin W.'s avatar
Marvin W. committed
61
def gmsVersion = "20.47.14"
Marvin W.'s avatar
Marvin W. committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
}


84
85
allprojects {
    apply plugin: 'idea'
Marvin W.'s avatar
Marvin W. committed
86
87
88
89

    group = 'org.microg.gms'
    version = ourVersionName
    ext.appVersionCode = ourVersionCode
90
91
92
    ext.isReleaseVersion = false
}

Marvin W.'s avatar
Marvin W. committed
93
94
@Deprecated
def androidCompileSdk() { return androidCompileSdk }
95

Marvin W.'s avatar
Marvin W. committed
96
97
@Deprecated
def androidTargetSdk() { return androidTargetSdk }
98

Marvin W.'s avatar
Marvin W. committed
99
100
@Deprecated
def androidMinSdk() { return androidMinSdk }
101

Marvin W.'s avatar
Marvin W. committed
102
@Deprecated
103
def versionCode() {
Marvin W.'s avatar
Marvin W. committed
104
    return ourVersionCode
105
106
}

Marvin W.'s avatar
Marvin W. committed
107
@Deprecated
108
def versionName() {
Marvin W.'s avatar
Marvin W. committed
109
    return ourVersionName
110
111
}

Marvin W.'s avatar
Marvin W. committed
112
113
114
subprojects {
    repositories {
        jcenter()
115
        google()
116
    }
Marvin W.'s avatar
Marvin W. committed
117
118
}