1
0

build.gradle.kts 1.8 KB

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