/
build.gradle
69 lines (65 loc) · 1.91 KB
1
2
3
4
5
6
7
8
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
def buildAsApplication = !buildAsLibrary
if (buildAsApplication) {
apply plugin: 'com.android.application'
}
else {
apply plugin: 'com.android.library'
}
9
10
android {
11
compileSdkVersion 26
12
buildToolsVersion "26.0.1"
13
defaultConfig {
14
15
16
if (buildAsApplication) {
applicationId "org.libsdl.app"
}
17
minSdkVersion 14
18
targetSdkVersion 26
19
20
versionCode 1
versionName "1.0"
21
22
23
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-14"
24
abiFilters 'armeabi-v7a', 'x86'
25
26
}
}
27
28
29
30
31
32
33
34
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
35
36
37
38
39
40
41
42
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
sourceSets.main {
jniLibs.srcDir 'libs'
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
43
}
44
45
46
47
48
}
lintOptions {
abortOnError false
}
49
50
51
52
53
54
55
56
57
58
59
60
if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith(".aar")) {
def fileName = "org.libsdl.app.aar";
output.outputFile = new File(outputFile.parent, fileName);
}
}
}
}
61
62
63
}
dependencies {
64
compile fileTree(include: ['*.jar'], dir: 'libs')
65
66
67
68
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
69
}