Skip to content

Commit 2e108df

Browse files
committed
update
1 parent 90a7339 commit 2e108df

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
ndk.dir="xxxxxxxx"
4444
CLIENT_ID = "xxxxxx"
4545
CLIENT_SECRET = "xxxxxx"
46-
> ### 最后记得配置 [`CMake` 环境](https://blog.csdn.net/laibowon/article/details/79939962)
46+
> ### 如果需要测试 `CMake` ,要打开 Gradle 中的 `needCMakeTest` ,记得配置 [`CMake` 环境](https://blog.csdn.net/laibowon/article/details/79939962)
4747
4848

4949
  [ 注册 Github APP 传送门](https://github.com/settings/applications/new),当然,前提是你现有一个github账号(~ ̄▽ ̄)~ 。

app/build.gradle

+20-12
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ apply plugin: 'kotlin-kapt'
88

99
apply plugin: 'realm-android'
1010

11+
12+
///是否需要测试 CMake
13+
def needCMakeTest = false
14+
1115
android {
1216
compileSdkVersion 28
1317
defaultConfig {
1418
applicationId "com.shuyu.github.kotlin"
1519
minSdkVersion 21
1620
targetSdkVersion 28
17-
versionCode 8
18-
versionName "1.0.8"
21+
versionCode 10
22+
versionName "1.1.0"
1923
javaCompileOptions {
2024
annotationProcessorOptions {
2125
includeCompileClasspath = true
@@ -28,13 +32,15 @@ android {
2832
buildConfigField "String", "CLIENT_ID", properties.getProperty("CLIENT_ID")
2933
buildConfigField "String", "CLIENT_SECRET", properties.getProperty("CLIENT_SECRET")
3034

31-
//CMake
32-
externalNativeBuild {
33-
cmake {
34-
cppFlags ""
35-
}
36-
ndk {
37-
abiFilters 'armeabi-v7a'
35+
if (needCMakeTest) {
36+
//CMake
37+
externalNativeBuild {
38+
cmake {
39+
cppFlags ""
40+
}
41+
ndk {
42+
abiFilters 'armeabi-v7a'
43+
}
3844
}
3945
}
4046

@@ -43,9 +49,11 @@ android {
4349
}
4450
}
4551

46-
externalNativeBuild {
47-
cmake {
48-
path 'CMakeLists.txt'
52+
if (needCMakeTest) {
53+
externalNativeBuild {
54+
cmake {
55+
path 'CMakeLists.txt'
56+
}
4957
}
5058
}
5159

0 commit comments

Comments
 (0)