From eaf19c09b9571490f7ab74030f3ed920a4cd63fa Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 21 Jan 2015 10:52:10 +0100 Subject: [PATCH] Update gradle --- OsmAnd/build.gradle | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index fc1c884a89..3bf377682e 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -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'