
Switch to the spotless linter with ktfmt used as a backend instead of ktlint. This switch was done for two reasons: 1. ktfmt is more thorough than ktlint 2. License headers can be added more effectively with spotless than the default Android Studio behavior. Dump all of the changes now so I don't have to deal with it over a long period of time. I don't care.
113 lines
3.2 KiB
Groovy
113 lines
3.2 KiB
Groovy
apply plugin: "com.android.application"
|
|
apply plugin: "kotlin-android"
|
|
apply plugin: "kotlin-kapt"
|
|
apply plugin: "androidx.navigation.safeargs.kotlin"
|
|
apply plugin: "com.diffplug.spotless"
|
|
|
|
android {
|
|
compileSdkVersion 32
|
|
buildToolsVersion "32.0.0"
|
|
|
|
defaultConfig {
|
|
applicationId "org.oxycblt.auxio"
|
|
versionName "2.2.2"
|
|
versionCode 14
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
preDebugBuild.dependsOn spotlessApply
|
|
}
|
|
|
|
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.1"
|
|
|
|
// 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.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-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.5.0"
|
|
|
|
// Preferences
|
|
implementation "androidx.preference:preference-ktx:1.2.0"
|
|
|
|
// --- THIRD PARTY ---
|
|
|
|
// Exoplayer
|
|
// WARNING: THE EXOPLAYER VERSION MUST BE KEPT IN LOCK-STEP WITH THE FLAC EXTENSION.
|
|
// IF NOT, VERY UNFRIENDLY BUILD FAILURES AND CRASHES MAY ENSUE.
|
|
def exoplayerVersion = "2.17.1"
|
|
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayerVersion"
|
|
implementation fileTree(dir: "libs", include: ["extension-*.aar"])
|
|
|
|
// Image loading
|
|
implementation "io.coil-kt:coil:2.0.0-rc01"
|
|
|
|
// Material
|
|
implementation "com.google.android.material:material:1.6.0-alpha03"
|
|
}
|
|
|
|
spotless {
|
|
kotlin {
|
|
target "src/**/*.kt"
|
|
|
|
ktfmt('0.30').dropboxStyle()
|
|
licenseHeaderFile("NOTICE")
|
|
}
|
|
}
|