summaryrefslogtreecommitdiff
path: root/llama.cpp/examples/llama.android/lib/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp/examples/llama.android/lib/build.gradle.kts')
-rw-r--r--llama.cpp/examples/llama.android/lib/build.gradle.kts78
1 files changed, 78 insertions, 0 deletions
diff --git a/llama.cpp/examples/llama.android/lib/build.gradle.kts b/llama.cpp/examples/llama.android/lib/build.gradle.kts
new file mode 100644
index 0000000..9b290d6
--- /dev/null
+++ b/llama.cpp/examples/llama.android/lib/build.gradle.kts
@@ -0,0 +1,78 @@
+plugins {
+ alias(libs.plugins.android.library)
+ alias(libs.plugins.jetbrains.kotlin.android)
+}
+
+android {
+ namespace = "com.arm.aichat"
+ compileSdk = 36
+
+ ndkVersion = "29.0.13113456"
+
+ defaultConfig {
+ minSdk = 33
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles("consumer-rules.pro")
+
+ ndk {
+ abiFilters += listOf("arm64-v8a", "x86_64")
+ }
+ externalNativeBuild {
+ cmake {
+ arguments += "-DCMAKE_BUILD_TYPE=Release"
+ arguments += "-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG"
+ arguments += "-DCMAKE_VERBOSE_MAKEFILE=ON"
+
+ arguments += "-DBUILD_SHARED_LIBS=ON"
+ arguments += "-DLLAMA_BUILD_COMMON=ON"
+ arguments += "-DLLAMA_OPENSSL=OFF"
+
+ arguments += "-DGGML_NATIVE=OFF"
+ arguments += "-DGGML_BACKEND_DL=ON"
+ arguments += "-DGGML_CPU_ALL_VARIANTS=ON"
+ arguments += "-DGGML_LLAMAFILE=OFF"
+ }
+ }
+ aarMetadata {
+ minCompileSdk = 35
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path("src/main/cpp/CMakeLists.txt")
+ version = "3.31.6"
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+ kotlin {
+ jvmToolchain(17)
+
+ compileOptions {
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+ }
+
+ packaging {
+ resources {
+ excludes += "/META-INF/{AL2.0,LGPL2.1}"
+ }
+ }
+
+ publishing {
+ singleVariant("release") {
+ withJavadocJar()
+ }
+ }
+}
+
+dependencies {
+ implementation(libs.androidx.core.ktx)
+ implementation(libs.androidx.datastore.preferences)
+
+ testImplementation(libs.junit)
+ androidTestImplementation(libs.androidx.junit)
+}