build.gradle 2.11 KB
Newer Older
Daniel Wolf's avatar
Daniel Wolf committed
1
2
// Top-level build file where you can add configuration options common to all sub-projects/modules.

3
4
5
6
7
8
9
10
static def getSystemVariableOrDefault(String variable, String defaultValue) {
    def value = System.getenv(variable)
    if(value == null) {
        return defaultValue
    }
    return value
}

Daniel Wolf's avatar
Daniel Wolf committed
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
def getArtifactoryUser() {
    def user = System.getenv("ARTIFACTORY_USER")
    if (user == null) {
        user = artifactory_username
    }

    if (user == null) {
        throw new Exception("Artifactory user not set!")
    }

    return user
}

def getArtifactoryPassword() {
    def pw = System.getenv("ARTIFACTORY_PASSWORD")
    if (pw == null) {
        pw = artifactory_password
    }
    if (pw == null) {
        throw new Exception("Artifactory password not set!")
    }

    return pw
}

ext.artifactory_username = getArtifactoryUser()
ext.artifactory_password = getArtifactoryPassword()

buildscript {
Daniel Wolf's avatar
Daniel Wolf committed
40
    ext.kotlin_version = '1.3.61'
Daniel Wolf's avatar
Daniel Wolf committed
41
42
43
    repositories {
        google()
        jcenter()
Daniel Wolf's avatar
Daniel Wolf committed
44
45
46
        maven {
            url 'http://storage.googleapis.com/r8-releases/raw'
        }
Daniel Wolf's avatar
Daniel Wolf committed
47
48
    }
    dependencies {
Daniel Wolf's avatar
Daniel Wolf committed
49
        classpath 'com.android.tools.build:gradle:3.5.3'
Daniel Wolf's avatar
Daniel Wolf committed
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
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://artifactory.frostnerd.com/artifactory/libs-release-local'
            credentials {
                username = "$artifactory_username"
                password = "$artifactory_password"
            }
        }
        maven {
            url 'https://artifactory.frostnerd.com/artifactory/libs-snapshot-local'
            credentials {
                username = "$artifactory_username"
                password = "$artifactory_password"
            }
        }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
Daniel Wolf's avatar
Daniel Wolf committed
76
        maven { url 'https://jitpack.io' }
Daniel Wolf's avatar
Daniel Wolf committed
77
78
79
80
81
82
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}