Skip to content

Instantly share code, notes, and snippets.

@JSBerrocoso
Last active August 29, 2015 14:17
Show Gist options
  • Save JSBerrocoso/20e6c3e535c743bf327d to your computer and use it in GitHub Desktop.
Save JSBerrocoso/20e6c3e535c743bf327d to your computer and use it in GitHub Desktop.
signing.debug.storePassword=myPassword
signing.debug.keyAlias=androiddebugkey
signing.debug.keyPassword=myPassword
signing.release.storePassword=myReleasePassword
signing.release.keyAlias=androidreleasekey
signing.release.keyPassword=myReleasePassword
deploygate.userName=myUserName
deploygate.token=myToken
deploygate.distributionKey=myDistributionKey
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
classpath 'com.deploygate:gradle:0.3'
}
}
apply plugin: 'android'
apply plugin: 'deploygate'
repositories {
mavenCentral()
}
def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
}
def gitLastCommit() {
return 'git log -1 --no-merges --pretty=oneline --abbrev-commit'.execute().text.trim()
}
dependencies {
compile fileTree(dir: 'libs', includes: ['*.jar'])
compile 'com.android.support:support-v4:18.0.+'
}
Properties props = new Properties()
props.load(new FileInputStream(file(project.property("AYI.properties"))))
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
buildConfig """\
public static final String GIT_SHA = "${gitSha()}";
"""
}
productFlavors {
dogfood {
packageName "com.areyouinterested.android.dogfood"
versionName "DF-${gitSha()}"
}
}
signingConfigs {
debug {
storeFile file("../build/config/debug.keystore")
storePassword props['signing.debug.storePassword']
keyAlias props['signing.debug.keyAlias']
keyPassword props['signing.debug.keyPassword']
}
release {
storeFile file("../build/config/release.keystore")
storePassword props['signing.release.storePassword']
keyAlias props['signing.release.keyAlias']
keyPassword props['signing.release.keyPassword']
}
}
buildTypes {
debug {
packageNameSuffix ".debug"
zipAlign = true
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
}
}
}
deploygate {
userName = props['deploygate.userName']
token = props['deploygate.token']
apks {
AYI {
sourceFile = file("build/apk/AYI-dogfood-release.apk")
message = "${gitLastCommit()}"
distributionKey = props['deploygate.distributionKey']
releaseNote = "${gitLastCommit()}"
}
}
}
AYI.properties=../build/config/ayi.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment