-
Notifications
You must be signed in to change notification settings - Fork 60
/
build.gradle
90 lines (80 loc) · 2.75 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
86
87
88
89
90
buildscript {
repositories {
mavenCentral()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
// view-source:https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/maven-metadata.xml
classpath 'com.android.tools.build:gradle:4.2.2' // 7.2.0
// view-source:https://repo1.maven.org/maven2/com/github/dcendents/android-maven-gradle-plugin/maven-metadata.xml
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
mavenCentral()
maven {
url 'https://dl.google.com/dl/android/maven2/'
}
}
}
if (!rootProject.hasProperty('compileSdkVersion')) {
project.ext.compileSdkVersion = 32
project.ext.targetSdkVersion = 32
project.ext.minSdkVersion = 16
project.ext.versionCode = 1
project.ext.versionName = '1'
project.ext.appcompatVersion = '1.4.1'
project.ext.buildToolsVersion = '30.0.3' // build tools 31.0.0+ requires agp 7.0.0+
project.ext.ndkVersion = '23.1.7779620'
} else {
project.ext.compileSdkVersion = rootProject.compileSdkVersion
project.ext.targetSdkVersion = rootProject.targetSdkVersion
project.ext.minSdkVersion = rootProject.minSdkVersion
project.ext.versionCode = rootProject.versionCode
project.ext.versionName = rootProject.versionName
project.ext.appcompatVersion = rootProject.appcompatVersion
project.ext.buildToolsVersion = rootProject.buildToolsVersion
project.ext.ndkVersion = rootProject.ndkVersion
}
apply plugin: 'com.android.library'
android {
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion
ndkVersion project.ndkVersion
defaultConfig {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode project.versionCode
versionName project.versionName
buildConfigField 'int', 'APP_VERSION_CODE', "${versionCode}"
buildConfigField 'String', 'APP_VERSION_NAME', "\"${versionName}\""
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}
externalNativeBuild {
ndkBuild {
cFlags '-DVERSION=' + project.versionCode
}
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation "androidx.appcompat:appcompat:${project.appcompatVersion}"
}
task deleteNativeBuild(type: Delete) {
delete file('.externalNativeBuild')
delete file('.cxx')
}
clean.finalizedBy deleteNativeBuild