-
Notifications
You must be signed in to change notification settings - Fork 233
/
build.gradle
79 lines (68 loc) · 2.21 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
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext.abiCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86":3, "x86_64":4]
ext.universalBase = 8000
android {
namespace 'is.xyz.mpv'
compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
versionCode 37
versionName "2024-06-05-release"
vectorDrawables.useSupportLibrary = true
}
flavorDimensions "default"
productFlavors {
"default" {
isDefault true
}
api29 {
targetSdkVersion 29
versionNameSuffix "-oldapi"
}
}
buildFeatures {
viewBinding = true
buildConfig = true
}
splits {
abi {
enable true
reset()
// include only the ABIs that were actually built
project.ext.abiCodes.each { abi, _ ->
if (new File(project.projectDir, "src/main/jniLibs/${abi}").exists())
include(abi)
}
universalApk true // build an APK with all ABIs too
}
}
// https://youtrack.jetbrains.com/issue/KT-55947
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
}
// Map versionCode so each ABI gets a different one
// e.g. x86 with version 21 gets a versionCode of 3021
import com.android.build.VariantOutput
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def base = project.ext.abiCodes.get(output.getFilter(VariantOutput.ABI))
// universal APK just gets a constant added to it
if (base != null)
output.versionCodeOverride = base * 1000 + variant.versionCode
else
output.versionCodeOverride = universalBase + variant.versionCode
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.media:media:1.7.0'
}