build.gradle.kts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. plugins {
  2. id("com.android.library")
  3. id("org.jetbrains.kotlin.android")
  4. }
  5. android {
  6. namespace = "android.llama.cpp"
  7. compileSdk = 34
  8. defaultConfig {
  9. minSdk = 33
  10. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  11. consumerProguardFiles("consumer-rules.pro")
  12. ndk {
  13. // Add NDK properties if wanted, e.g.
  14. // abiFilters += listOf("arm64-v8a")
  15. }
  16. externalNativeBuild {
  17. cmake {
  18. arguments += "-DCMAKE_BUILD_TYPE=Release"
  19. cppFlags += listOf()
  20. arguments += listOf()
  21. cppFlags("")
  22. }
  23. }
  24. }
  25. buildTypes {
  26. release {
  27. isMinifyEnabled = false
  28. proguardFiles(
  29. getDefaultProguardFile("proguard-android-optimize.txt"),
  30. "proguard-rules.pro"
  31. )
  32. }
  33. }
  34. externalNativeBuild {
  35. cmake {
  36. path("src/main/cpp/CMakeLists.txt")
  37. version = "3.22.1"
  38. }
  39. }
  40. compileOptions {
  41. sourceCompatibility = JavaVersion.VERSION_1_8
  42. targetCompatibility = JavaVersion.VERSION_1_8
  43. }
  44. kotlinOptions {
  45. jvmTarget = "1.8"
  46. }
  47. packaging {
  48. resources {
  49. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  50. }
  51. }
  52. }
  53. dependencies {
  54. implementation("androidx.core:core-ktx:1.12.0")
  55. implementation("androidx.appcompat:appcompat:1.6.1")
  56. implementation("com.google.android.material:material:1.11.0")
  57. testImplementation("junit:junit:4.13.2")
  58. androidTestImplementation("androidx.test.ext:junit:1.1.5")
  59. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
  60. }