Update gradle

This commit is contained in:
Victor Shcherb 2015-01-21 10:52:10 +01:00
parent 5b180cd1ae
commit eaf19c09b9

View file

@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
// 0. Download OsmAndCore_wrapper for build
// +1. AndroidManifest.xml (+versionCode/APK_NUMBER_VERSION, +package, +android:process, +icon)
// 2. no_translate.xml (versionFeatures, app.edition, build.version )
@ -222,10 +223,18 @@ collectExternalResources.dependsOn collectVoiceAssets,
collectRegionsInfo,
collectHelpContents,
collectMiscResources
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn << collectExternalResources
}
task downloadAAR {
def f = new File("libs/OsmAndCore_wrapper.jar")
if (!f.exists()) {
new URL("http://builder.osmand.net:81/binaries/android/OsmAndCore_wrapper.jar").withInputStream{ i -> f.withOutputStream{ it << i }}
}
}
// Legacy core build
import org.apache.tools.ant.taskdefs.condition.Os
task buildOsmAndCore(type: Exec) {
@ -246,7 +255,7 @@ task cleanupDuplicatesInCore(type: Delete) {
delete "libs/x86/libgnustl_shared.so"
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn << [buildOsmAndCore, cleanupDuplicatesInCore]
compileTask -> compileTask.dependsOn << [buildOsmAndCore, downloadAAR, cleanupDuplicatesInCore]
}
repositories {
@ -259,6 +268,7 @@ repositories {
}
}
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"], exclude: ["QtAndroid-bundled.jar", "QtAndroidAccessibility-bundled.jar", "android-support*.jar", "OsmAndCore_wrapper.jar"])
compile 'com.android.support:appcompat-v7:21.0.3'