Blob Blame History Raw
// Top-level build file where you can add configuration options common to all sub-projects/modules.
Properties properties = new Properties()
File file = new File('release.properties')
if (file.canRead()) {
    properties.load(new FileInputStream(file))
}
   
if (!hasProperty('RELEASE_STORE_FILE')) {
    ext.RELEASE_STORE_FILE='nokeyfile'
}
if (!hasProperty('RELEASE_KEY_ALIAS')) {
    ext.RELEASE_KEY_ALIAS=''
}
if (!hasProperty('RELEASE_KEY_ALIAS')) {
    ext.RELEASE_KEY_ALIAS=''
}
if (!hasProperty('RELEASE_KEY_PASSWORD')) {
    ext.RELEASE_KEY_PASSWORD=''
}

def getVersionName = { ->
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine 'git', 'describe', '--tags'
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

ext {
    versionName = properties.get('VERSION_NAME', getVersionName())
    versionCode = properties.get('VERSION_CODE', 17)

    println '----------------- Project configuration -------------------'
    println 'VERSION_NAME:       ' + versionName
    println 'VERSION_CODE:       ' + versionCode
    println 'RELEASE_STORE_FILE: '+ RELEASE_STORE_FILE
    println 'RELEASE_KEY_ALIAS:  '+ RELEASE_KEY_ALIAS
    println '-----------------------------------------------------------'
}

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}