xwords/xwords4/android/XWords4/build.gradle
Eric House 7aff11d7b0 files necessary for a gradle build (untested; need to commit and clone
elsewhere to be sure). I'm not moving things to the conventional
gradle locations yet -- want to keep the ant build working too for
now.
2015-11-04 06:28:57 -08:00

100 lines
2.4 KiB
Groovy

def VARIANT_NAME = 'xw4'
def INITIAL_CLIENT_VERS = 6
def CHAT_ENABLED = true
def THUMBNAIL_ENABLED = true
def BUILD_TARGET = 'debug'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
apply plugin: 'android'
repositories {
jcenter()
}
dependencies {
compile files('libs/gcm.jar')
}
// The sample build uses multiple directories to
// keep boilerplate and common code separate from
// the main sample code.
List<String> dirs = [
'main', // main sample code; look here for the interesting stuff.
'common', // components that are reused by multiple samples
'template'] // boilerplate code that is generated by the sample template process
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 14
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
dirs.each { dir ->
java.srcDirs "src/${dir}/java"
res.srcDirs "src/${dir}/res"
}
manifest.srcFile 'AndroidManifest.xml'
assets.srcDirs = ['assets']
res.srcDirs = ['res']
jniLibs.srcDir 'libs' // use the jni .so compiled from the manual ndk-build command
jni.srcDirs = [] // disable automatic ndk-build call
}
// androidTest.setRoot('tests')
// androidTest.java.srcDirs = ['tests/src']
}
lintOptions {
abortOnError false
}
}
task genVers(type: Exec) {
workingDir './'
commandLine '../scripts/genvers.sh', VARIANT_NAME,
INITIAL_CLIENT_VERS, CHAT_ENABLED, THUMBNAIL_ENABLED
}
task mkImages(type: Exec) {
workingDir './'
commandLine '../scripts/mkimages.sh'
}
task copyStrings(type: Exec) {
workingDir './'
commandLine '../scripts/copy-strings.py'
}
task myPreBuild(dependsOn: ['genVers', 'mkImages', 'copyStrings']) {
}
task ndkBuild(type: Exec) {
commandLine '../scripts/ndkbuild.sh', '-j3', "CHAT_ENABLED=$CHAT_ENABLED",
"THUMBNAIL_ENABLED=$THUMBNAIL_ENABLED", "BUILD_TARGET=$BUILD_TARGET",
"INITIAL_CLIENT_VERS=$INITIAL_CLIENT_VERS", "VARIANT=$VARIANT_NAME", 'V=1'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn myPreBuild
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}