Skip to content

Instantly share code, notes, and snippets.

@mdrabic
Last active December 29, 2015 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdrabic/7591395 to your computer and use it in GitHub Desktop.
Save mdrabic/7591395 to your computer and use it in GitHub Desktop.
build.gradle template
apply plugin: 'com.android.application'
// Manifest version information!
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 15
targetSdkVersion 20
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
buildConfigField "String", "BUILD_TIME", "\"${buildTime}\""
}
buildTypes {
debug {
applicationIdSuffix '.dev'
versionNameSuffix '-dev'
}
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.0.0'
compile 'com.squareup.dagger:dagger:1.2.1'
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
compile 'com.squareup.okhttp:okhttp:1.3.0'
compile 'com.squareup.picasso:picasso:2.2.0'
compile 'com.squareup.retrofit:retrofit:1.4.1'
compile 'com.jakewharton:butterknife:4.0.1'
compile 'com.netflix.rxjava:rxjava-core:0.20.1'
compile 'com.netflix.rxjava:rxjava-android:0.20.1'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment