From 629b626306ec79325685fb293e892eaa97c33f40 Mon Sep 17 00:00:00 2001 From: "Markus M. May" Date: Wed, 31 Jan 2018 21:46:30 +0100 Subject: [PATCH] Download jniLibs as dependency, delete on clean (in gradle) --- .gitignore | 1 + app/build.gradle | 25 +++++++++++++++++++++++++ build.gradle | 8 ++++++++ 3 files changed, 34 insertions(+) diff --git a/.gitignore b/.gitignore index 79927b784d..1cd8d2622a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ *.apk build/ .idea/ +app/src/main/jniLibs diff --git a/app/build.gradle b/app/build.gradle index 5cd4c9af95..3d34fd6c61 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -179,6 +179,7 @@ dependencies { compile("com.crashlytics.sdk.android:answers:1.3.12@aar") { transitive = true; } + compile 'MilosKozak:danars-support-lib:master@zip' compile "com.android.support:appcompat-v7:${supportLibraryVersion}" compile "com.android.support:support-v4:${supportLibraryVersion}" @@ -228,3 +229,27 @@ dependencies { androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}" androidTestCompile "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}" } + +task unzip(type: Copy) { + def zipPath = configurations.compile.find {it.name.startsWith("danars") } + println zipPath + def zipFile = file(zipPath) + def outputDir = file("${buildDir}/unpacked/dist") + + from zipTree(zipFile) + into outputDir + + def src = new File(outputDir, "danars-support-lib-master") + def target = file("src/main/jniLibs") + target.mkdirs() + + from src + into target +} + +task full_clean(type: Delete) { + delete file("src/main/jniLibs") +} + +clean.dependsOn full_clean +preBuild.dependsOn unzip \ No newline at end of file diff --git a/build.gradle b/build.gradle index e13cb27485..e3e404b4e9 100644 --- a/build.gradle +++ b/build.gradle @@ -21,9 +21,17 @@ allprojects { maven { url "https://maven.google.com" } + ivy { + url 'https://github.com/' + layout 'pattern', { + artifact '/[organisation]/[module]/archive/[revision].[ext]' + } + } } } task clean(type: Delete) { delete rootProject.buildDir } + +