-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
85 lines (73 loc) · 2.23 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs file("libs")
}
maven {
url 'https://dl.bintray.com/ark338/maven'
}
maven { url "https://jitpack.io" }
maven { url "http://clojars.org/repo" }
google()
}
}
// call regular ndk-build(.cmd) script from app directory
def GetNDKDir() {
def localProperties = new Properties()
def NDK_SEARCH_VARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK_ROOT', 'NDKROOT', 'NDKHOME']
def ndk_path = null
def lim = (Os.isFamily(Os.FAMILY_WINDOWS)) ? '\\' : '/'
// Search Local.Properties file
try {
localProperties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkDir = localProperties.getProperty('ndk.dir')
ndk_path = ndkDir != null ? ndkDir + lim : null;
} catch (java.io.FileNotFoundException e) {
println 'local.properties file not found'
}
// Search env var
if (ndk_path == null){
for (String var : NDK_SEARCH_VARS) {
def v = System.getenv(var)
if (v != null) {
ndk_path = v + lim
println "found in System Environment *$var = " + ndk_path
break
}
}
} else {
println 'found in local.properties *NDK_PATH = ' + ndk_path
}
if (ndk_path == null) {
println 'No NDK_PATH found'
ndk_path = ''
}
return ndk_path
}
def NDKCommand() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
return GetNDKDir() + "ndk-build.cmd"
} else {
return GetNDKDir() + "ndk-build"
}
}