plugins { alias(libs.plugins.android.library) alias(libs.plugins.jetbrains.kotlin.android) `maven-publish` } 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_CURL=OFF" arguments += "-DGGML_NATIVE=OFF" arguments += "-DGGML_BACKEND_DL=ON" arguments += "-DGGML_CPU_ALL_VARIANTS=ON" arguments += "-DGGML_LLAMAFILE=OFF" } } aarMetadata { minCompileSdk = 35 } } buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } 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() } } } publishing { publications { register("release") { groupId = "com.arm" artifactId = "ai-chat" version = "0.1.0" afterEvaluate { from(components["release"]) } } } repositories { maven { name = "artifactory" url = uri(project.findProperty("artifactoryUrl") as? String ?: "") credentials { username = project.findProperty("artifactoryUsername") as? String ?: "" password = project.findProperty("artifactoryPassword") as? String ?: "" } } } } dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.datastore.preferences) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) }