build.gradle.kts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. plugins {
  2. alias(libs.plugins.android.library)
  3. alias(libs.plugins.jetbrains.kotlin.android)
  4. }
  5. android {
  6. namespace = "com.arm.aichat"
  7. compileSdk = 36
  8. ndkVersion = "29.0.13113456"
  9. defaultConfig {
  10. minSdk = 33
  11. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  12. consumerProguardFiles("consumer-rules.pro")
  13. ndk {
  14. abiFilters += listOf("arm64-v8a", "x86_64")
  15. }
  16. externalNativeBuild {
  17. cmake {
  18. arguments += "-DCMAKE_BUILD_TYPE=Release"
  19. arguments += "-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG"
  20. arguments += "-DCMAKE_VERBOSE_MAKEFILE=ON"
  21. arguments += "-DBUILD_SHARED_LIBS=ON"
  22. arguments += "-DLLAMA_BUILD_COMMON=ON"
  23. arguments += "-DLLAMA_CURL=OFF"
  24. arguments += "-DGGML_NATIVE=OFF"
  25. arguments += "-DGGML_BACKEND_DL=ON"
  26. arguments += "-DGGML_CPU_ALL_VARIANTS=ON"
  27. arguments += "-DGGML_LLAMAFILE=OFF"
  28. }
  29. }
  30. aarMetadata {
  31. minCompileSdk = 35
  32. }
  33. }
  34. externalNativeBuild {
  35. cmake {
  36. path("src/main/cpp/CMakeLists.txt")
  37. version = "3.31.6"
  38. }
  39. }
  40. compileOptions {
  41. sourceCompatibility = JavaVersion.VERSION_17
  42. targetCompatibility = JavaVersion.VERSION_17
  43. }
  44. kotlin {
  45. jvmToolchain(17)
  46. compileOptions {
  47. targetCompatibility = JavaVersion.VERSION_17
  48. }
  49. }
  50. packaging {
  51. resources {
  52. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  53. }
  54. }
  55. publishing {
  56. singleVariant("release") {
  57. withJavadocJar()
  58. }
  59. }
  60. }
  61. dependencies {
  62. implementation(libs.androidx.core.ktx)
  63. implementation(libs.androidx.datastore.preferences)
  64. testImplementation(libs.junit)
  65. androidTestImplementation(libs.androidx.junit)
  66. }