/
build.gradle
58 lines (51 loc) · 1.42 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
buildscript {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
// apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 8
targetSdkVersion 23
}
}
def jniLibsDir = "src/main/jniLibs"
def armeabiDir = "$jniLibsDir/armeabi-v7a"
def x86Dir = "$jniLibsDir/x86"
task copyCrystaxSo {
description 'Copies Crystax .so files to the appropriate folders.'
def found = 0
doLast {
def so = "libcrystax.so"
def PATH = System.env['PATH'].split(":").each { d ->
def libdirArmeabi = d + "/../arm-linux-androideabi/lib/"
def libdirX86 = d + "/../i686-linux-android/lib/"
if (file(libdirArmeabi + so).exists()) {
println " Found armeabi .so"
found ++
copy { from libdirArmeabi include so into armeabiDir }
}
if (file(libdirX86 + so).exists()) {
println " Found x86 .so"
found ++
copy { from libdirX86 include so into x86Dir }
}
}
if (found < 2) {
def missing = 2 - found
throw new GradleException("Missing $missing $so libraries, check PATH")
}
}
}