vtm/vtm-android-example/build.gradle
2014-06-10 22:16:07 +02:00

90 lines
2.1 KiB
Groovy

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.11.1'
}
}
repositories {
maven { url "${System.env.ANDROID_HOME}/extras/android/m2repository" }
}
apply plugin: 'android'
dependencies {
compile project(':vtm-android')
compile project(':vtm-jeo')
compile project(':vtm-extras')
compile project(':vtm-themes')
}
android {
compileSdkVersion 19
buildToolsVersion '19.1'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src', 'assets']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
// remove duplicates
packagingOptions {
exclude 'META-INF/services/org.jeo.data.Driver'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
// ignore deprecated
lintOptions.abortOnError false
}
// Including configurations into Eclipse
// Configuring Eclipse classpath
eclipse.classpath {
plusConfigurations += configurations.compile
defaultOutputDir = file('bin/classes')
file {
// Direct manipulation of the generated classpath XML
withXml {
def node = it.asNode()
node.appendNode('classpathentry kind="src" path="src"')
node.appendNode('classpathentry kind="src" path="gen"')
}
}
}
eclipse.project {
natures = ['com.android.ide.eclipse.adt.AndroidNature',
'org.eclipse.jdt.core.javanature']
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
}
task run (dependsOn: 'installDebug'){
doFirst {
println(">> adb run...")
String adb = System.getenv()['ANDROID_HOME'] + '/platform-tools/adb'
String cmd = "${adb} shell am start -n org.oscim.android.test/.Samples"
def proc = cmd.execute()
proc.in.eachLine {line -> println line}
proc.err.eachLine {line -> System.err.println( 'ERROR: ' + line)}
proc.waitFor()
}
}