• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>null9 plugins {
10   id("com.android.application")
11   id("org.jetbrains.kotlin.android")
12 }
13 
<lambda>null14 android {
15   namespace = "com.example.executorchdemo"
16   compileSdk = 34
17 
18   defaultConfig {
19     applicationId = "com.example.executorchdemo"
20     minSdk = 24
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>null46 dependencies {
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.soloader:soloader:0.10.5")
59   implementation("com.facebook.fbjni:fbjni:0.5.1")
60   implementation("org.pytorch.executorch:executorch") {
61     exclude("com.facebook.fbjni", "fbjni-java-only")
62   }
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>null72 tasks.register("setup") {
73   doFirst {
74     exec {
75       commandLine("sh", "examples/demo-apps/android/LlamaDemo/setup.sh")
76       workingDir("../../../../../")
77     }
78   }
79 }
80