2022-07-30 16:39:57 +05:30
|
|
|
import java.time.Instant
|
|
|
|
|
2021-12-09 18:01:40 +05:30
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
2023-08-20 06:02:04 +05:30
|
|
|
id 'com.google.devtools.ksp'
|
2021-12-09 18:01:40 +05:30
|
|
|
id 'kotlin-android'
|
2023-01-18 06:28:21 +05:30
|
|
|
id 'kotlinx-serialization'
|
2023-06-09 07:04:19 +05:30
|
|
|
id 'kotlin-parcelize'
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2023-07-26 05:24:34 +05:30
|
|
|
compileSdk 34
|
2021-12-09 18:01:40 +05:30
|
|
|
|
|
|
|
defaultConfig {
|
2022-02-01 21:22:06 +05:30
|
|
|
applicationId 'com.github.libretube'
|
2022-02-27 00:27:05 +05:30
|
|
|
minSdk 21
|
2022-08-27 18:43:24 +05:30
|
|
|
targetSdk 33
|
2023-08-15 16:36:46 +05:30
|
|
|
versionCode 40
|
|
|
|
versionName '0.17.1'
|
2021-12-09 18:31:47 +05:30
|
|
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
2022-02-17 00:19:36 +05:30
|
|
|
resValue "string", "app_name", "LibreTube"
|
2022-11-18 22:31:11 +05:30
|
|
|
|
2023-08-20 06:02:04 +05:30
|
|
|
ksp {
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
|
|
arg("exportSchema", "true")
|
2022-11-18 22:31:11 +05:30
|
|
|
}
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
|
|
|
|
2022-07-01 00:35:31 +05:30
|
|
|
buildFeatures {
|
|
|
|
viewBinding true
|
|
|
|
}
|
|
|
|
|
2023-08-13 16:37:26 +05:30
|
|
|
applicationVariants.configureEach { variant ->
|
2022-07-30 16:03:01 +05:30
|
|
|
// use the date as version for debug builds
|
|
|
|
if (variant.name == 'debug') {
|
|
|
|
variant.outputs.each { output ->
|
2022-07-30 16:39:57 +05:30
|
|
|
output.versionCodeOverride = getUnixTime()
|
2022-07-30 16:03:01 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-09 18:01:40 +05:30
|
|
|
buildTypes {
|
|
|
|
release {
|
2022-02-27 23:21:17 +05:30
|
|
|
minifyEnabled true
|
2021-12-09 18:01:40 +05:30
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
2021-12-12 17:38:23 +05:30
|
|
|
|
2022-02-15 01:42:10 +05:30
|
|
|
debug {
|
|
|
|
debuggable true
|
|
|
|
applicationIdSuffix ".debug"
|
2022-02-17 00:19:36 +05:30
|
|
|
resValue "string", "app_name", "LibreTube Debug"
|
2022-02-15 01:42:10 +05:30
|
|
|
}
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
|
|
|
compileOptions {
|
2022-04-16 11:51:50 +05:30
|
|
|
coreLibraryDesugaringEnabled true
|
2023-04-18 06:07:36 +05:30
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
|
|
|
kotlinOptions {
|
2023-04-18 06:07:36 +05:30
|
|
|
jvmTarget = JavaVersion.VERSION_17
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
2022-02-27 23:21:17 +05:30
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
2022-06-07 12:22:11 +05:30
|
|
|
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
2022-08-18 16:59:07 +05:30
|
|
|
universalApk true
|
2022-02-27 23:21:17 +05:30
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
packagingOptions {
|
2022-04-15 11:45:17 +05:30
|
|
|
jniLibs {
|
|
|
|
excludes += ['lib/armeabi-v7a/*_neon.so']
|
|
|
|
}
|
2022-02-27 23:21:17 +05:30
|
|
|
}
|
2022-05-12 21:49:52 +05:30
|
|
|
namespace 'com.github.libretube'
|
2021-12-09 18:01:40 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-06-25 13:34:21 +05:30
|
|
|
//debugImplementation libs.square.leakcanary
|
2022-02-05 22:40:43 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* Android Core */
|
2023-07-12 09:23:02 +05:30
|
|
|
implementation libs.androidx.activity
|
2022-06-25 13:34:21 +05:30
|
|
|
implementation libs.androidx.appcompat
|
2023-04-09 17:18:35 +05:30
|
|
|
implementation libs.androidx.core
|
2022-06-25 13:34:21 +05:30
|
|
|
implementation libs.androidx.constraintlayout
|
2023-07-12 09:23:02 +05:30
|
|
|
implementation libs.androidx.fragment
|
2022-06-25 13:34:21 +05:30
|
|
|
implementation libs.androidx.legacySupport
|
|
|
|
implementation libs.androidx.navigation.fragment
|
|
|
|
implementation libs.androidx.navigation.ui
|
|
|
|
implementation libs.androidx.preference
|
2022-07-28 16:57:52 +05:30
|
|
|
implementation libs.androidx.work.runtime
|
2021-12-18 16:34:14 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* Android Lifecycle */
|
|
|
|
implementation libs.lifecycle.viewmodel
|
|
|
|
implementation libs.lifecycle.runtime
|
|
|
|
implementation libs.lifecycle.livedata
|
2023-02-06 06:47:07 +05:30
|
|
|
implementation libs.lifecycle.service
|
2022-08-27 17:27:41 +05:30
|
|
|
|
|
|
|
/* Testing */
|
2022-06-25 13:34:21 +05:30
|
|
|
androidTestImplementation libs.androidx.test.junit
|
|
|
|
androidTestImplementation libs.androidx.test.espressoCore
|
2021-12-18 16:34:14 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* Design */
|
|
|
|
implementation libs.material
|
2021-12-12 17:38:23 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* ExoPlayer */
|
2023-05-15 20:51:49 +05:30
|
|
|
implementation libs.androidx.media3.exoplayer
|
|
|
|
implementation libs.androidx.media3.ui
|
|
|
|
implementation libs.androidx.media3.exoplayer.hls
|
|
|
|
implementation libs.androidx.media3.exoplayer.dash
|
|
|
|
implementation libs.androidx.media3.session
|
|
|
|
implementation(libs.androidx.media3.datasource.cronet) { exclude group: 'com.google.android.gms' }
|
2022-02-26 22:49:42 +05:30
|
|
|
|
2023-01-19 14:08:21 +05:30
|
|
|
/* Retrofit and Kotlinx Serialization */
|
2022-06-25 13:34:21 +05:30
|
|
|
implementation libs.square.retrofit
|
2023-01-18 06:28:21 +05:30
|
|
|
implementation libs.kotlinx.serialization
|
|
|
|
implementation libs.kotlinx.datetime
|
|
|
|
implementation libs.kotlinx.serialization.retrofit
|
2022-03-16 19:02:42 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* Cronet and Coil */
|
2022-06-25 13:34:21 +05:30
|
|
|
coreLibraryDesugaring libs.desugaring
|
|
|
|
implementation libs.cronet.embedded
|
2022-07-21 19:06:15 +05:30
|
|
|
implementation libs.cronet.okhttp
|
2022-07-21 19:51:43 +05:30
|
|
|
implementation libs.coil
|
2022-08-04 12:38:46 +05:30
|
|
|
|
2022-08-27 17:27:41 +05:30
|
|
|
/* Room */
|
2023-08-20 06:02:04 +05:30
|
|
|
ksp libs.room.compiler
|
2022-08-13 23:34:07 +05:30
|
|
|
implementation libs.room
|
2022-05-27 01:07:00 +05:30
|
|
|
}
|
2022-07-30 16:03:01 +05:30
|
|
|
|
2022-07-30 16:39:57 +05:30
|
|
|
static def getUnixTime() {
|
|
|
|
return Instant.now().getEpochSecond()
|
2023-02-02 21:49:03 +05:30
|
|
|
}
|