@@ -6,31 +6,38 @@ def usingCMakeCompile() {
66}
77
88android {
9- compileSdkVersion 25
10- if (usingCMakeCompile()) {
9+ compileSdkVersion rootProject. ext. android. compileSdkVersion
10+ buildToolsVersion rootProject. ext. android. buildToolsVersion
11+
12+ if (usingCMakeCompile()) {
1113 ndkVersion " 23.1.7779620"
1214 }
1315
1416 defaultConfig {
15- minSdkVersion 14
16- targetSdkVersion 22
17- versionCode 1
18- versionName " 2.4.6 "
17+ minSdkVersion rootProject . ext . android . minSdkVersion
18+ targetSdkVersion rootProject . ext . android . targetSdkVersion
19+ versionCode rootProject . ext . android . versionCode
20+ versionName rootProject . ext . android . versionName
1921
20- externalNativeBuild {
21- cmake {
22- arguments " -DCGE_USE_VIDEO_MODULE=1" ,
23- " -DANDROID_STL=c++_static" ,
24- " -DANDROID_ARM_NEON=TRUE" ,
25- " -DANDROID_GRADLE=1"
22+ if (usingCMakeCompile()) {
23+ externalNativeBuild {
24+ cmake {
25+ arguments " -DCGE_USE_VIDEO_MODULE=1" ,
26+ " -DANDROID_STL=c++_static" ,
27+ " -DANDROID_ARM_NEON=TRUE" ,
28+ " -DANDROID_GRADLE=1"
2629
27- cppFlags " -frtti -std=c++14"
30+ cppFlags " -frtti -std=c++14"
31+ }
2832 }
2933 }
3034 }
31- externalNativeBuild {
32- cmake {
33- path ' src/main/jni/CMakeLists.txt'
35+
36+ if (usingCMakeCompile()) {
37+ externalNativeBuild {
38+ cmake {
39+ path ' src/main/jni/CMakeLists.txt'
40+ }
3441 }
3542 }
3643
@@ -44,12 +51,11 @@ android {
4451 // //////////////////////////////////////
4552
4653 sourceSets. main {
47- if (usingCMakeCompile()) {
54+ if (usingCMakeCompile()) {
4855 jniLibs. srcDir ' src/main/libs' // set libs as .so's location instead of jni
49- }
50- else {
56+ } else {
5157 jni. srcDirs = [] // disable automatic ndk-build call with auto-generated Android.mk file
52- }
58+ }
5359 }
5460 compileOptions {
5561 sourceCompatibility JavaVersion . VERSION_1_8
@@ -58,6 +64,7 @@ android {
5864}
5965
6066dependencies {
61- compile fileTree(dir : ' libs' , include : [' *.jar' ])
62- compile ' com.android.support:appcompat-v7:25.2.0'
67+ implementation fileTree(dir : ' libs' , include : [' *.jar' ])
68+ implementation ' com.android.support:appcompat-v7:' + rootProject. ext. android. appcompatV7
69+ implementation ' androidx.appcompat:appcompat:' + rootProject. ext. android. appcompatX
6370}
0 commit comments