Download jniLibs as dependency, delete on clean (in gradle)

This commit is contained in:
Markus M. May 2018-01-31 21:46:30 +01:00
parent be6047066a
commit 629b626306
3 changed files with 34 additions and 0 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@
*.apk *.apk
build/ build/
.idea/ .idea/
app/src/main/jniLibs

View file

@ -179,6 +179,7 @@ dependencies {
compile("com.crashlytics.sdk.android:answers:1.3.12@aar") { compile("com.crashlytics.sdk.android:answers:1.3.12@aar") {
transitive = true; transitive = true;
} }
compile 'MilosKozak:danars-support-lib:master@zip'
compile "com.android.support:appcompat-v7:${supportLibraryVersion}" compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile "com.android.support:support-v4:${supportLibraryVersion}" compile "com.android.support:support-v4:${supportLibraryVersion}"
@ -228,3 +229,27 @@ dependencies {
androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}" androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:${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

View file

@ -21,9 +21,17 @@ allprojects {
maven { maven {
url "https://maven.google.com" url "https://maven.google.com"
} }
ivy {
url 'https://github.com/'
layout 'pattern', {
artifact '/[organisation]/[module]/archive/[revision].[ext]'
}
}
} }
} }
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }