build.gradle.kts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 += "-DLLAMA_BUILD_COMMON=ON"
  19. arguments += "-DGGML_LLAMAFILE=OFF"
  20. arguments += "-DCMAKE_BUILD_TYPE=Release"
  21. cppFlags += listOf()
  22. arguments += listOf()
  23. cppFlags("")
  24. }
  25. }
  26. }
  27. buildTypes {
  28. release {
  29. isMinifyEnabled = false
  30. proguardFiles(
  31. getDefaultProguardFile("proguard-android-optimize.txt"),
  32. "proguard-rules.pro"
  33. )
  34. }
  35. }
  36. externalNativeBuild {
  37. cmake {
  38. path("src/main/cpp/CMakeLists.txt")
  39. version = "3.22.1"
  40. }
  41. }
  42. compileOptions {
  43. sourceCompatibility = JavaVersion.VERSION_1_8
  44. targetCompatibility = JavaVersion.VERSION_1_8
  45. }
  46. kotlinOptions {
  47. jvmTarget = "1.8"
  48. }
  49. packaging {
  50. resources {
  51. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  52. }
  53. }
  54. }
  55. dependencies {
  56. implementation("androidx.core:core-ktx:1.12.0")
  57. implementation("androidx.appcompat:appcompat:1.6.1")
  58. implementation("com.google.android.material:material:1.11.0")
  59. testImplementation("junit:junit:4.13.2")
  60. androidTestImplementation("androidx.test.ext:junit:1.1.5")
  61. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
  62. }