build.gradle 2.89 KB
Newer Older
Andy Trevorah's avatar
Andy Trevorah committed
1 2
apply plugin: 'com.android.application'

Eric Eastwood's avatar
Eric Eastwood committed
3 4
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
5
def secretProperties = new Properties()
Eric Eastwood's avatar
Eric Eastwood committed
6 7 8 9 10
if (secretsPropertiesFile.exists()) {
    secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
11 12 13 14
    secretProperties.setProperty("oauth_client_id", "\"${System.getenv('oauth_client_id')}\"")
    secretProperties.setProperty("oauth_client_secret", "\"${System.getenv('oauth_client_secret')}\"")
    secretProperties.setProperty("oauth_redirect_uri", "\"${System.getenv('oauth_redirect_uri')}\"")
    secretProperties.setProperty("google_project_id", "\"${System.getenv('google_project_id') ?: "null"}\"")
15 16 17
    secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
    secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
    secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
Eric Eastwood's avatar
Eric Eastwood committed
18
}
19

Andy Trevorah's avatar
Andy Trevorah committed
20
android {
Eric Eastwood's avatar
Eric Eastwood committed
21
    compileSdkVersion 26
22
    buildToolsVersion '28.0.3'
Andy Trevorah's avatar
Andy Trevorah committed
23 24 25

    defaultConfig {
        applicationId "im.gitter.gitter"
Andy Trevorah's avatar
Andy Trevorah committed
26
        minSdkVersion 19
Eric Eastwood's avatar
Eric Eastwood committed
27
        targetSdkVersion 26
Eric Eastwood's avatar
Eric Eastwood committed
28 29
        versionCode 81
        versionName "3.2.0"
30

31 32 33 34
        buildConfigField("String", "oauth_client_id", "${secretProperties['oauth_client_id']}")
        buildConfigField("String", "oauth_client_secret", "${secretProperties['oauth_client_secret']}")
        buildConfigField("String", "oauth_redirect_uri", "${secretProperties['oauth_redirect_uri']}")
        buildConfigField("String", "google_project_id", "${secretProperties['google_project_id']}" ?: "null")
Andy Trevorah's avatar
Andy Trevorah committed
35
    }
36 37 38 39
    signingConfigs {
        release {
            // You need to specify either an absolute path or include the
            // keystore file in the same directory as the build.gradle file.
40
            storeFile file("../android-signing-keystore.jks")
41 42 43 44 45
            storePassword "${secretProperties['signing_keystore_password']}"
            keyAlias "${secretProperties['signing_key_alias']}"
            keyPassword "${secretProperties['signing_key_password']}"
        }
    }
Andy Trevorah's avatar
Andy Trevorah committed
46 47
    buildTypes {
        release {
48
            minifyEnabled false
Andy Trevorah's avatar
Andy Trevorah committed
49
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
50
            signingConfig signingConfigs.release
Andy Trevorah's avatar
Andy Trevorah committed
51 52 53 54
        }
    }
}

Andy Trevorah's avatar
Andy Trevorah committed
55 56 57 58
repositories {
    mavenCentral()
}

Andy Trevorah's avatar
Andy Trevorah committed
59
dependencies {
60 61 62
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:design:24.2.1'
    implementation 'com.android.volley:volley:1.0.0'
63
    implementation "com.google.android.gms:play-services-gcm:10.2.1"
64 65 66 67
    implementation 'joda-time:joda-time:2.5'
    implementation 'com.github.rahatarmanahmed:circularprogressview:2.4.0'
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    testImplementation 'junit:junit:4.12'
Andy Trevorah's avatar
Andy Trevorah committed
68
}