Skip to content

Instantly share code, notes, and snippets.

@stefanhoth
Created December 3, 2012 18:24
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 stefanhoth/4196894 to your computer and use it in GitHub Desktop.
Save stefanhoth/4196894 to your computer and use it in GitHub Desktop.
A buildfile for the Gradle build system for Android
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.2'
}
}
apply plugin: 'android'
android {
target = 'android-16'
defaultConfig {
versionCode = 3
versionName = '1.0.1'
signingStoreLocation = "deployment/debug.keystore"
signingStorePassword = "android"
signingKeyAlias = "androiddebugkey"
signingKeyPassword = "android"
}
sourceSets {
main {
manifest {
srcFile 'AndroidManifest.xml'
}
java {
srcDir 'src'
//exclude 'some/unwanted/package/**'
}
res {
srcDir 'res'
}
assets {
srcDir 'assets'
}
resources {
srcDir 'src'
}
}
test {
java {
srcDir 'tests/src'
}
}
// Could also be done with:
//main.manifest.srcFile 'AndroidManifest.xml'
//main.java.srcDir 'src'
//main.res.srcDir 'res'
//main.assets.srcDir 'assets'
//main.resources.srcDir 'src'
//test.java.srcDir 'tests/src'
}
//buildTypes {
// debug {
// packageNameSuffix = ".debug"
// }
// staging {
// packageNameSuffix = ".staging"
// debuggable = true
// debugSigned = true
// zipAlign = false
// }
//}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
tasks.withType(Compile) {
options.encoding = 'UTF-8'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment