90 lines
2.3 KiB
Groovy
90 lines
2.3 KiB
Groovy
import org.apache.tools.ant.taskdefs.condition.Os
|
|
|
|
plugins {
|
|
id 'com.android.library'
|
|
id 'org.jetbrains.kotlin.android'
|
|
id "com.google.devtools.ksp"
|
|
id "com.diffplug.spotless"
|
|
id "kotlin-parcelize"
|
|
id "org.jetbrains.dokka"
|
|
id "org.mozilla.rust-android-gradle.rust-android"
|
|
}
|
|
|
|
android {
|
|
namespace 'org.oxycblt.musikr'
|
|
compileSdk target_sdk
|
|
ndkVersion "$ndk_version"
|
|
|
|
defaultConfig {
|
|
minSdk min_sdk
|
|
targetSdk target_sdk
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
|
|
ndk {
|
|
stl "c++_static"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// R8 flips out that random classes were stripped for unknown reasons
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
coreLibraryDesugaringEnabled true
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
freeCompilerArgs += "-Xjvm-default=all"
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig true
|
|
}
|
|
}
|
|
|
|
|
|
cargo {
|
|
module = "./src/main/jni"
|
|
libname = "metadatajni"
|
|
targets = ["arm", "arm64", "x86", "x86_64"]
|
|
prebuiltToolchains = true
|
|
profile = "release"
|
|
}
|
|
|
|
dependencies {
|
|
// Kotlin
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
|
|
|
|
// AndroidX
|
|
implementation "androidx.core:core-ktx:$core_version"
|
|
|
|
// Database
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
ksp "androidx.room:room-compiler:$room_version"
|
|
implementation "androidx.room:room-ktx:$room_version"
|
|
|
|
// Build
|
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugaring_version"
|
|
|
|
// Testing
|
|
testImplementation "junit:junit:4.13.2"
|
|
testImplementation "io.mockk:mockk:1.13.7"
|
|
testImplementation "org.robolectric:robolectric:4.11"
|
|
testImplementation 'androidx.test:core-ktx:1.6.1'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
}
|
|
|
|
clean {
|
|
delete "$projectDir/build/rustJniLibs"
|
|
}
|