96 lines
2.2 KiB
Groovy
96 lines
2.2 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:0.8.+'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'android'
|
|
|
|
dependencies {
|
|
compile project(':vtm-android')
|
|
compile fileTree(dir: 'libs', include: '*.jar')
|
|
}
|
|
|
|
task copyAssets(type: Copy) {
|
|
from "$rootDir/vtm/assets"
|
|
into "assets"
|
|
include '**/*'
|
|
}
|
|
|
|
tasks.withType(JavaCompile) { compileTask ->
|
|
compileTask.dependsOn copyAssets }
|
|
|
|
android {
|
|
compileSdkVersion 19
|
|
buildToolsVersion '19.0.1'
|
|
|
|
sourceSets {
|
|
main {
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
java.srcDirs = ['src', 'assets']
|
|
resources.srcDirs = ['src', 'assets']
|
|
aidl.srcDirs = ['src', 'assets']
|
|
renderscript.srcDirs = ['src', 'assets']
|
|
res.srcDirs = ['res']
|
|
assets.srcDirs = ['assets']
|
|
}
|
|
|
|
debug.setRoot('build-types/debug')
|
|
release.setRoot('build-types/release')
|
|
}
|
|
}
|
|
|
|
// Including configurations into Eclipse
|
|
eclipse.classpath.plusConfigurations += configurations.compile
|
|
|
|
eclipse.jdt{
|
|
sourceCompatibility = 1.6
|
|
targetCompatibility = 1.6
|
|
}
|
|
|
|
// Configuring Eclipse classpath
|
|
eclipse.classpath {
|
|
//customizing the classes output directory:
|
|
defaultOutputDir = file('bin/classes')
|
|
|
|
file {
|
|
|
|
// Manipulation of the classpath XML before merging local
|
|
// and generated copies
|
|
beforeMerged { classpath ->
|
|
// Remove all source entries to avoid overlap
|
|
classpath.entries.removeAll() { c ->
|
|
c.kind == 'src'
|
|
}
|
|
}
|
|
|
|
// Direct manipulation of the generated classpath XML
|
|
withXml {
|
|
// Since non-default source directories are used
|
|
// they need to be manually added to the classpath XML
|
|
def node = it.asNode()
|
|
|
|
// Main source directory
|
|
node.appendNode('classpathentry kind="src" path="src"')
|
|
// Generated code directory
|
|
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'
|
|
|
|
linkedResource name: 'assets', type: '2',
|
|
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
|
|
}
|
|
|