-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathbuild.gradle
More file actions
146 lines (125 loc) · 3.71 KB
/
Copy pathbuild.gradle
File metadata and controls
146 lines (125 loc) · 3.71 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
apply plugin: 'com.android.application'
android {
namespace = 'org.koreader.launcher'
ndkVersion = '23.2.8568313'
ndkPath = System.getenv('ANDROID_NDK_HOME')
compileSdk = rootProject.ext.compileSdk
def baseVersionCode = versCode as Integer
defaultConfig {
applicationId = "org.koreader.launcher"
versionName = versName
minSdkVersion rootProject.ext.minSdk
targetSdkVersion rootProject.ext.targetSdk
manifestPlaceholders.APP_NAME = projectName
buildConfigField "String", "APP_NAME", '"' + projectName + '"'
buildConfigField "boolean", "IN_APP_UPDATES", "false"
buildConfigField "boolean", "SUPPORTS_RUNTIME_CHANGES", "false"
buildConfigField "String", "SEVENZIP_LIB", '"' + sevenZipLib + '"'
}
sourceSets {
main {
assets.srcDirs = [ '../assets', assetsPath ]
jniLibs.srcDirs = [ libsPath ]
}
}
dependenciesInfo {
includeInApk = false
}
buildFeatures {
buildConfig = true
viewBinding = true
}
buildTypes {
release {
minifyEnabled = true
shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix = ".debug"
minifyEnabled = false
debuggable = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
flavorDimensions = [ 'ABI', 'CHANNEL' ]
productFlavors {
arm {
ndk { abiFilters "armeabi-v7a" }
dimension = 'ABI'
versionCode = baseVersionCode * 10 + 1
}
arm64 {
ndk { abiFilters "arm64-v8a" }
dimension = 'ABI'
versionCode = baseVersionCode * 10 + 2
}
x86 {
ndk { abiFilters "x86" }
dimension = 'ABI'
versionCode = baseVersionCode * 10 + 3
}
x86_64 {
ndk { abiFilters "x86_64" }
dimension = 'ABI'
versionCode = baseVersionCode * 10 + 4
}
fdroid {
dimension = 'CHANNEL'
applicationIdSuffix = '.fdroid'
}
rocks {
dimension = 'CHANNEL'
buildConfigField "boolean", "IN_APP_UPDATES", "true"
buildConfigField "boolean", "SUPPORTS_RUNTIME_CHANGES", "true"
}
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
resources {
excludes += '/kotlin/**.kotlin_builtins'
excludes += '/kotlin/**.kotlin_metadata'
excludes += '/META-INF/**.kotlin_module'
excludes += '/META-INF/**.version'
}
}
lint {
disable 'ChromeOsAbiSupport'
disable 'GradleDependency'
disable 'QueryAllPackagesPermission'
disable 'SameParameterValue'
htmlReport = false
xmlReport = false
}
androidResources {
noCompress '7z'
}
}
androidComponents {
onVariants(selector().all()) {
outputs.forEach {
it.outputFileName.set("NativeActivity.apk")
}
}
}
repositories {
google()
mavenCentral()
}
dependencies {
implementation "androidx.core:core-ktx:$androidx_core_version"
implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
implementation "androidx.legacy:legacy-support-v4:$androidx_supportv4_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_plugin_version"
}