my-tv/app/build.gradle

125 lines
3.8 KiB
Groovy
Raw Normal View History

2023-12-04 19:36:29 +08:00
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.lizongying.mytv'
2024-02-05 06:12:01 +08:00
compileSdk 34
2023-12-04 19:36:29 +08:00
2023-12-15 13:04:32 +08:00
viewBinding {
enabled = true
}
2023-12-04 19:36:29 +08:00
defaultConfig {
applicationId "com.lizongying.mytv"
2023-12-29 13:02:14 +08:00
minSdk 17
2023-12-04 19:36:29 +08:00
targetSdk 33
2023-12-06 20:07:27 +08:00
versionCode VersionCode()
versionName VersionName()
2023-12-15 13:04:32 +08:00
// This block is different from the one you use to link Gradle
// to your CMake or ndk-build script.
externalNativeBuild {
// For ndk-build, instead use the ndkBuild block.
cmake {
2023-12-18 10:12:52 +08:00
arguments "-DIS_SO_BUILD=${project.hasProperty('IS_SO_BUILD') ? project.IS_SO_BUILD : true}"
2023-12-15 13:04:32 +08:00
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
// Similar to other properties in the defaultConfig block,
// you can configure the ndk block for each product flavor
// in your build configuration.
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your app.
abiFilters "armeabi-v7a", "arm64-v8a"
}
2023-12-29 13:02:14 +08:00
multiDexEnabled true
2023-12-04 19:36:29 +08:00
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
2024-03-18 18:29:56 +08:00
jvmTarget = 17
2023-12-04 19:36:29 +08:00
}
2023-12-15 13:04:32 +08:00
// Encapsulates your external native build configurations.
externalNativeBuild {
// Encapsulates your CMake build configurations.
cmake {
// Provides a relative path to your CMake build script.
path = file("CMakeLists.txt")
}
}
2023-12-04 19:36:29 +08:00
}
2023-12-06 20:07:27 +08:00
static def VersionCode() {
2023-12-05 13:58:13 +08:00
try {
2024-03-18 18:29:56 +08:00
def p = "git describe --tags --always"
def process = p.execute()
2023-12-05 13:58:13 +08:00
process.waitFor()
2024-03-18 18:29:56 +08:00
def replace = [v: "", ".": " ", "-": " "]
def arr = (process.text.trim().replace(replace) + " 0").split(" ")
def versionCode = arr[0].toInteger() * 16777216 + arr[1].toInteger() * 65536 + arr[2].toInteger() * 256 + arr[3].toInteger()
println("VersionCode $versionCode")
return versionCode
2023-12-05 13:58:13 +08:00
} catch (ignored) {
return 0
}
}
2023-12-06 20:07:27 +08:00
static def VersionName() {
2023-12-05 13:58:13 +08:00
try {
2024-03-18 18:29:56 +08:00
def process = "git describe --tags --always".execute()
2023-12-05 13:58:13 +08:00
process.waitFor()
2023-12-06 23:51:17 +08:00
return process.text.trim() - "v"
2023-12-05 13:58:13 +08:00
} catch (ignored) {
return "1.0.0"
}
}
2023-12-04 19:36:29 +08:00
dependencies {
2024-02-05 06:12:01 +08:00
def media3_version = "1.2.1"
2023-12-15 15:41:59 +08:00
2023-12-25 19:23:45 +08:00
implementation "androidx.media3:media3-ui:$media3_version"
2023-12-15 15:41:59 +08:00
// For media playback using ExoPlayer
implementation "androidx.media3:media3-exoplayer:$media3_version"
// For HLS playback support with ExoPlayer
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
2024-01-11 15:19:57 +08:00
// 21:2.9.0 17:2.6.4
def retrofit2_version = "2.9.0"
2023-12-15 13:04:32 +08:00
implementation 'com.google.protobuf:protobuf-kotlin:3.25.1'
2024-01-11 15:19:57 +08:00
implementation "com.squareup.retrofit2:converter-gson:$retrofit2_version"
implementation "com.squareup.retrofit2:converter-protobuf:$retrofit2_version"
implementation "com.squareup.retrofit2:retrofit:$retrofit2_version"
2023-12-15 13:04:32 +08:00
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2"
2023-12-04 19:36:29 +08:00
implementation 'androidx.core:core-ktx:1.11.0-beta02'
2023-12-16 15:09:09 +08:00
implementation 'androidx.leanback:leanback:1.2.0-alpha02'
2023-12-04 19:36:29 +08:00
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.2"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0-RC")
2024-02-16 22:13:59 +08:00
implementation 'com.google.android.exoplayer:exoplayer-ui:2.13.3'
implementation 'com.google.android.exoplayer:exoplayer-core:2.13.3'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.13.3'
2023-12-04 19:36:29 +08:00
}