1
0
mirror of https://github.com/libre-tube/LibreTube.git synced 2024-12-15 06:40:30 +05:30
LibreTube/app/build.gradle
2022-12-02 19:13:17 +01:00

131 lines
3.5 KiB
Groovy

import java.time.Instant
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdk 33
defaultConfig {
applicationId 'com.github.libretube'
minSdk 21
targetSdk 33
versionCode 24
versionName '0.9.0'
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
resValue "string", "app_name", "LibreTube"
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildFeatures {
viewBinding true
}
applicationVariants.all { variant ->
// use the date as version for debug builds
if (variant.name == 'debug') {
variant.outputs.each { output ->
output.versionCodeOverride = getUnixTime()
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable true
applicationIdSuffix ".debug"
resValue "string", "app_name", "LibreTube Debug"
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
universalApk true
}
}
packagingOptions {
jniLibs {
excludes += ['lib/armeabi-v7a/*_neon.so']
}
}
namespace 'com.github.libretube'
}
dependencies {
//debugImplementation libs.square.leakcanary
/* Android Core */
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.legacySupport
implementation libs.androidx.multidex
implementation libs.androidx.navigation.fragment
implementation libs.androidx.navigation.ui
implementation libs.androidx.preference
implementation libs.androidx.work.runtime
/* Android Lifecycle */
implementation libs.lifecycle.viewmodel
implementation libs.lifecycle.runtime
implementation libs.lifecycle.livedata
/* Testing */
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.androidx.test.espressoCore
/* Design */
implementation libs.material
implementation libs.circleimageview
/* ExoPlayer */
implementation libs.exoplayer
implementation(libs.exoplayer.extension.cronet) { exclude group: 'com.google.android.gms' }
implementation libs.exoplayer.extension.mediasession
implementation libs.exoplayer.dash
/* Retrofit and Jackson */
implementation libs.square.retrofit
implementation libs.square.retrofit.converterJackson
implementation libs.jacksonAnnotations
/* Cronet and Coil */
coreLibraryDesugaring libs.desugaring
implementation libs.cronet.embedded
implementation libs.cronet.okhttp
implementation libs.coil
/* Room */
kapt libs.room.compiler
implementation libs.room
}
static def getUnixTime() {
return Instant.now().getEpochSecond()
}