
Bundle our custom ExoPlayer components into aar instead of directly depending on the project. This just makes things far better regarding ease of use and reproducible builds.
134 lines
3.8 KiB
Groovy
134 lines
3.8 KiB
Groovy
apply plugin: "com.android.application"
|
|
apply plugin: "kotlin-android"
|
|
apply plugin: "kotlin-kapt"
|
|
apply plugin: "androidx.navigation.safeargs.kotlin"
|
|
|
|
android {
|
|
compileSdkVersion 32
|
|
buildToolsVersion "32.0.0"
|
|
|
|
defaultConfig {
|
|
applicationId "org.oxycblt.auxio"
|
|
versionName "2.0.1"
|
|
versionCode 10
|
|
|
|
minSdkVersion 21
|
|
targetSdkVersion 32
|
|
|
|
buildFeatures {
|
|
dataBinding true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
debuggable true
|
|
applicationIdSuffix = ".debug"
|
|
versionNameSuffix = "-DEBUG"
|
|
}
|
|
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
}
|
|
}
|
|
|
|
// ExoPlayer needs Java 8 to compile.
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
freeCompilerArgs += "-Xjvm-default=all"
|
|
}
|
|
|
|
compileOptions {
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
ktlint
|
|
}
|
|
|
|
afterEvaluate {
|
|
preDebugBuild.dependsOn ktlintFormat
|
|
}
|
|
|
|
dependencies {
|
|
// Kotlin
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
|
|
// --- SUPPORT ---
|
|
|
|
// General
|
|
implementation "androidx.core:core-ktx:1.7.0"
|
|
implementation "androidx.activity:activity-ktx:1.4.0"
|
|
implementation 'androidx.fragment:fragment-ktx:1.4.0'
|
|
|
|
// UI
|
|
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
|
implementation "androidx.dynamicanimation:dynamicanimation:1.0.0"
|
|
implementation "androidx.viewpager2:viewpager2:1.1.0-beta01"
|
|
|
|
// Lifecycle
|
|
def lifecycle_version = "2.4.0"
|
|
implementation "androidx.lifecycle:lifecycle-common:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
|
|
|
|
// Navigation
|
|
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
|
|
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
|
|
|
// Media
|
|
// TODO: Dumpster this for Media3
|
|
implementation "androidx.media:media:1.4.3"
|
|
|
|
// Preferences
|
|
implementation "androidx.preference:preference-ktx:1.1.1"
|
|
|
|
// --- THIRD PARTY ---
|
|
|
|
// Exoplayer
|
|
|
|
// Image loading
|
|
implementation 'io.coil-kt:coil:2.0.0-alpha06'
|
|
|
|
// Material
|
|
implementation 'com.google.android.material:material:1.5.0'
|
|
|
|
// --- DEBUG ---
|
|
|
|
// Lint
|
|
ktlint 'com.pinterest:ktlint:0.43.2'
|
|
|
|
// WARNING: THE EXOPLAYER VERSION MUST BE KEPT IN LOCK-STEP WITH THE CUSTOM EXTRACTOR AND FLAC
|
|
// EXTENSION BLOBS. IF NOT, VERY UNFRIENDLY BUILD FAILURES AND CRASHES MAY ENSUE.
|
|
def exoplayer_version = "2.16.1"
|
|
implementation("com.google.android.exoplayer:exoplayer-core:$exoplayer_version") {
|
|
exclude group: "com.google.android.exoplayer", module: "exoplayer-extractor"
|
|
}
|
|
|
|
implementation fileTree(dir: "libs", include: ["extension-*.aar"])
|
|
implementation fileTree(dir: "libs", include: ["library-*.aar"])
|
|
}
|
|
|
|
task ktlint(type: JavaExec, group: "verification") {
|
|
description = "Check Kotlin code style."
|
|
mainClass.set("com.pinterest.ktlint.Main")
|
|
classpath = configurations.ktlint
|
|
|
|
args "src/**/*.kt"
|
|
}
|
|
check.dependsOn ktlint
|
|
|
|
task ktlintFormat(type: JavaExec, group: "formatting") {
|
|
description = "Fix Kotlin code style deviations."
|
|
mainClass.set("com.pinterest.ktlint.Main")
|
|
classpath = configurations.ktlint
|
|
|
|
args "-F", "src/**/*.kt"
|
|
}
|