
Drop support for Lollipop and Marshmallow. I legit cannot build for them anymore. There's some insane dependency tangle between Kapt and Room that makes it impossible to use anything BUT Java 17 (maybe Java 11). If I use Java 17 or Java 11, suddenly the whole app crashes since Lollipop and Marshmallow only support some weird Java 8/11 chimera abomination. This issue has persisted probably since the move to Java 11, making it basically unusable anyway, so at this point just cut the charade and officially drop support.
160 lines
5 KiB
Groovy
160 lines
5 KiB
Groovy
plugins {
|
|
id "com.android.application"
|
|
id "kotlin-android"
|
|
id "androidx.navigation.safeargs.kotlin"
|
|
id "com.diffplug.spotless"
|
|
id "kotlin-parcelize"
|
|
id "dagger.hilt.android.plugin"
|
|
id "kotlin-kapt"
|
|
id 'org.jetbrains.kotlin.android'
|
|
}
|
|
|
|
android {
|
|
compileSdk 33
|
|
// NDK is not used in Auxio explicitly (used in the ffmpeg extension), but we need to specify
|
|
// it here so that binary stripping will work.
|
|
// TODO: Eventually you might just want to start vendoring the FFMpeg extension so the
|
|
// NDK use is unified
|
|
ndkVersion = "23.2.8568313"
|
|
namespace "org.oxycblt.auxio"
|
|
|
|
defaultConfig {
|
|
applicationId namespace
|
|
versionName "3.1.0"
|
|
versionCode 30
|
|
|
|
minSdk 24
|
|
targetSdk 33
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
freeCompilerArgs += "-Xjvm-default=all"
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix ".debug"
|
|
versionNameSuffix "-DEBUG"
|
|
}
|
|
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
|
|
dependenciesInfo {
|
|
includeInApk = false
|
|
includeInBundle = false
|
|
}
|
|
}
|
|
}
|
|
packagingOptions {
|
|
jniLibs {
|
|
excludes += ['**/kotlin/**', '**/okhttp3/**']
|
|
}
|
|
resources {
|
|
excludes += ['DebugProbesKt.bin', 'kotlin-tooling-metadata.json', '**/kotlin/**', '**/okhttp3/**', 'META-INF/*.version']
|
|
}
|
|
}
|
|
|
|
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
}
|
|
|
|
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"
|
|
|
|
def coroutines_version = '1.7.1'
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version"
|
|
|
|
// --- SUPPORT ---
|
|
|
|
// General
|
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
implementation "androidx.core:core-ktx:1.10.1"
|
|
implementation "androidx.activity:activity-ktx:1.7.2"
|
|
implementation "androidx.fragment:fragment-ktx:1.5.7"
|
|
|
|
// UI
|
|
implementation "androidx.recyclerview:recyclerview:1.3.0"
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
|
|
implementation "androidx.viewpager2:viewpager2:1.1.0-beta02"
|
|
implementation 'androidx.core:core-ktx:1.10.1'
|
|
|
|
// Lifecycle
|
|
def lifecycle_version = "2.6.1"
|
|
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-runtime-ktx:$lifecycle_version"
|
|
|
|
// Navigation
|
|
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
|
|
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
|
|
|
// Media
|
|
implementation "androidx.media:media:1.6.0"
|
|
|
|
// Preferences
|
|
implementation "androidx.preference:preference-ktx:1.2.0"
|
|
|
|
// Database
|
|
def room_version = '2.6.0-alpha01'
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
kapt "androidx.room:room-compiler:$room_version"
|
|
implementation "androidx.room:room-ktx:$room_version"
|
|
|
|
// --- THIRD PARTY ---
|
|
|
|
// Exoplayer (Vendored)
|
|
implementation project(":media-lib-exoplayer")
|
|
implementation project(":media-lib-decoder-ffmpeg")
|
|
|
|
// Image loading
|
|
implementation 'io.coil-kt:coil-base:2.4.0'
|
|
|
|
// Material
|
|
// TODO: Stuck on 1.8.0-alpha01 until ripple bug with tab layout is actually available
|
|
// in a version that I can build with
|
|
// TODO: Exactly figure out the conditions that the 1.7.0 ripple bug occurred so you can just
|
|
// PR a fix.
|
|
implementation "com.google.android.material:material:1.8.0-alpha01"
|
|
|
|
// Dependency Injection
|
|
implementation "com.google.dagger:dagger:$hilt_version"
|
|
kapt "com.google.dagger:dagger-compiler:$hilt_version"
|
|
implementation "com.google.dagger:hilt-android:$hilt_version"
|
|
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
|
|
|
|
// Testing
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.11'
|
|
testImplementation "junit:junit:4.13.2"
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
}
|
|
|
|
spotless {
|
|
kotlin {
|
|
target "src/**/*.kt"
|
|
ktfmt().dropboxStyle()
|
|
licenseHeaderFile("NOTICE")
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
preDebugBuild.dependsOn spotlessApply
|
|
}
|