Skip to content

Instantly share code, notes, and snippets.

@rwoberholzer
Created June 20, 2016 13:10
Show Gist options
  • Save rwoberholzer/f56cf8a8c209045ad6baca27a2581298 to your computer and use it in GitHub Desktop.
Save rwoberholzer/f56cf8a8c209045ad6baca27a2581298 to your computer and use it in GitHub Desktop.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.triplet.gradle:play-publisher:1.1.2'
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:+'
}
}
allprojects {
repositories {
jcenter()
}
}
ext {
compileSdkVersion = 22
buildToolsVersion = "22.0.1"
minSdkVersion = 10
targetSdkVersion = 22
versionMajor = 6
versionMinor = 1
versionPatch = 6
versionCode = versionMajor * 1000000 + versionMinor * 1000 + versionPatch
versionName = "${versionMajor}.${versionMinor}.${versionPatch}"
def Properties properties = new Properties()
if(file('local.properties').exists())
properties.load(project.rootProject.file('local.properties').newDataInputStream())
keystorePassword = getValue(properties, "KEYSTORE_PASS")
keyAlias = getValue(properties, "ALIAS_NAME")
keyPassword = getValue(properties, "ALIAS_PASS")
bugsnagToken = getValue(properties, "BUGSNAG_TOKEN")
serviceAccountEmail = getValue(properties, "SERVICE_EMAIL")
bintrayUser = getValue(properties, "BINTRAY_USER")
bintrayPassword = getValue(properties, "BINTRAY_API_KEY")
}
def getValue(def props, def name){
if(props && props[name])
return props[name]
else if(System.getenv(name))
return System.getenv(name)
else {
logger.log(LogLevel.ERROR, name + " has not been provided, add it to your local.properties file")
return "DEFAULT"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment