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 */ 8plugins { 9 id("com.android.application") version "8.1.0" apply false 10} 11 12group 'org.pytorch.executorch' 13 14apply plugin: "com.android.application" 15 16android { 17 namespace 'org.pytorch.executorch' 18 compileSdk = 34 19 20 defaultConfig { 21 minSdk = 28 22 targetSdk = 33 23 versionCode 1 24 versionName "1.0" 25 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 26 } 27 compileOptions { 28 sourceCompatibility JavaVersion.VERSION_1_8 29 targetCompatibility JavaVersion.VERSION_1_8 30 } 31 sourceSets { 32 androidTest { 33 resources.srcDirs += [ 'src/androidTest/resources' ] 34 } 35 } 36} 37 38dependencies { 39 implementation 'com.facebook.soloader:nativeloader:0.10.5' 40 implementation("com.facebook.fbjni:fbjni:0.5.1") 41 implementation(files("src/libs/executorch.aar")) 42 testImplementation 'junit:junit:4.13.2' 43 androidTestImplementation 'androidx.test.ext:junit:1.1.5' 44 androidTestImplementation 'androidx.test:rules:1.2.0' 45 androidTestImplementation 'commons-io:commons-io:2.4' 46 androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' 47 androidTestImplementation 'com.google.gms:google-services:4.3.3' 48} 49 50task('setupNativeLibs', type: Exec){ 51 commandLine("bash", "setup.sh") 52} 53 54gradle.projectsEvaluated { 55 preBuild.dependsOn setupNativeLibs 56} 57