1 /* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * All rights reserved. 4 * 5 * This source code is licensed under the BSD-style license found in the 6 * LICENSE file in the root directory of this source tree. 7 */ 8 <lambda>null9plugins { 10 id("com.android.application") 11 id("org.jetbrains.kotlin.android") 12 } 13 <lambda>null14android { 15 namespace = "com.example.executorchllamademo" 16 compileSdk = 34 17 18 defaultConfig { 19 applicationId = "com.example.executorchllamademo" 20 minSdk = 28 21 targetSdk = 33 22 versionCode = 1 23 versionName = "1.0" 24 25 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 26 vectorDrawables { useSupportLibrary = true } 27 externalNativeBuild { cmake { cppFlags += "" } } 28 } 29 30 buildTypes { 31 release { 32 isMinifyEnabled = false 33 proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 34 } 35 } 36 compileOptions { 37 sourceCompatibility = JavaVersion.VERSION_1_8 38 targetCompatibility = JavaVersion.VERSION_1_8 39 } 40 kotlinOptions { jvmTarget = "1.8" } 41 buildFeatures { compose = true } 42 composeOptions { kotlinCompilerExtensionVersion = "1.4.3" } 43 packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } 44 } 45 <lambda>null46dependencies { 47 implementation("androidx.core:core-ktx:1.9.0") 48 implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") 49 implementation("androidx.activity:activity-compose:1.7.0") 50 implementation(platform("androidx.compose:compose-bom:2023.03.00")) 51 implementation("androidx.compose.ui:ui") 52 implementation("androidx.compose.ui:ui-graphics") 53 implementation("androidx.compose.ui:ui-tooling-preview") 54 implementation("androidx.compose.material3:material3") 55 implementation("androidx.appcompat:appcompat:1.6.1") 56 implementation("androidx.camera:camera-core:1.3.0-rc02") 57 implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha12") 58 implementation("com.facebook.fbjni:fbjni:0.5.1") 59 implementation("com.google.code.gson:gson:2.8.6") 60 implementation(files("libs/executorch.aar")) 61 implementation("com.google.android.material:material:1.12.0") 62 implementation("androidx.activity:activity:1.9.0") 63 testImplementation("junit:junit:4.13.2") 64 androidTestImplementation("androidx.test.ext:junit:1.1.5") 65 androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") 66 androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00")) 67 androidTestImplementation("androidx.compose.ui:ui-test-junit4") 68 debugImplementation("androidx.compose.ui:ui-tooling") 69 debugImplementation("androidx.compose.ui:ui-test-manifest") 70 } 71 <lambda>null72tasks.register("setup") { 73 doFirst { 74 exec { 75 commandLine("sh", "examples/demo-apps/android/LlamaDemo/setup.sh") 76 workingDir("../../../../../") 77 } 78 } 79 } 80 <lambda>null81tasks.register("setupQnn") { 82 doFirst { 83 exec { 84 commandLine("sh", "examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh") 85 workingDir("../../../../../") 86 } 87 } 88 } 89 <lambda>null90tasks.register("download_prebuilt_lib") { 91 doFirst { 92 exec { 93 commandLine("sh", "examples/demo-apps/android/LlamaDemo/download_prebuilt_lib.sh") 94 workingDir("../../../../../") 95 } 96 } 97 } 98