gradle: fix vtm-android install + generate source jars

This commit is contained in:
Hannes Janetzek 2014-11-19 23:50:37 +01:00
parent 77f383913d
commit aaec15a66a
5 changed files with 47 additions and 11 deletions

View File

@ -22,10 +22,10 @@ before_install:
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
# install android build tools
- wget https://dl-ssl.google.com/android/repository/build-tools_r21.0.2-linux.zip
- unzip build-tools_r21.0.2-linux.zip -d $ANDROID_HOME
- wget https://dl-ssl.google.com/android/repository/build-tools_r21.1.1-linux.zip
- unzip build-tools_r21.1.1-linux.zip -d $ANDROID_HOME
- mkdir -p $ANDROID_HOME/build-tools/
- mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.0.2
- mv $ANDROID_HOME/android-5.0 $ANDROID_HOME/build-tools/21.1.1
# Install required components.
# For a full list, run `android list sdk -a --extended`
# Note that sysimg-18 downloads the ARM, x86 and MIPS images (we should optimize this).

View File

@ -34,7 +34,7 @@ allprojects {
version = '0.6.0-SNAPSHOT'
ext.gdxVersion = "1.4.1"
ext.androidBuildVersionTools = "21.0.2"
ext.androidBuildVersionTools = "21.1.1"
repositories {
mavenCentral()

View File

@ -1,12 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'android-maven'
configurations {
eclipseCompile
}
dependencies {
compile project(':vtm')
provided files("${rootDir}/vtm-ext-libs/native-libs.jar")
//compile 'com.android.support:support-v4:21.+'
compile project(':appcompat')
compile 'com.android.support:support-v4:21.+'
eclipseCompile project(':appcompat')
}
android {
@ -28,9 +33,18 @@ android {
lintOptions.abortOnError false
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
}
eclipse {
classpath {
plusConfigurations += [ configurations.compile, configurations.provided ]
plusConfigurations += [ configurations.compile, configurations.eclipseCompile ]
//noExportConfigurations += [ configurations.provided ]
//customizing the classes output directory:
@ -45,16 +59,22 @@ eclipse {
// and generated copies
beforeMerged { classpath ->
// Remove all source entries to avoid overlap
classpath.entries.removeAll() { c -> c.kind == 'src' }
classpath.entries.removeAll() { c ->
c.kind == 'src'
}
}
// only used to explode jni .so into aar
whenMerged {
classpath ->
classpath.entries.findAll { entry ->
entry.path.contains('native-libs') ||
entry.path.contains('ANDROID_FRAMEWORK')
classpath.entries.findAll { c ->
c.path.contains('native-libs') ||
c.path.contains('ANDROID_FRAMEWORK')
}*.exported = false
classpath.entries.removeAll() { c ->
c.path.contains('support')
}
}
// Direct manipulation of the generated classpath XML

View File

@ -10,3 +10,11 @@ sourceSets {
main.java.srcDirs = ['src']
main.resources.srcDirs = ['resources']
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}

View File

@ -15,6 +15,14 @@ sourceSets {
main.compileClasspath += configurations.providedCompile
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
eclipse.classpath {
//you can tweak the classpath of the Eclipse project by adding extra configurations:
plusConfigurations += [ configurations.providedCompile ]