my-tv/app/build.gradle

113 lines
3.2 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'
compileSdk 33
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 {
jvmTarget=17
}
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 {
def process = 'git rev-list --count HEAD'.execute()
process.waitFor()
return process.text.toInteger()
} catch (ignored) {
return 0
}
}
2023-12-06 20:07:27 +08:00
static def VersionName() {
2023-12-05 13:58:13 +08:00
try {
def process = 'git describe --tags --always'.execute()
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 {
2023-12-15 15:41:59 +08:00
def media3_version = "1.1.1"
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"
2023-12-15 13:04:32 +08:00
implementation 'com.google.protobuf:protobuf-kotlin:3.25.1'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-protobuf:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
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")
}