-
Notifications
You must be signed in to change notification settings - Fork 980
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (99 loc) · 3.23 KB
/
build.gradle
File metadata and controls
115 lines (99 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
plugins {
id "com.android.library" version "8.9.0"
id "com.vanniktech.maven.publish" version "0.31.0"
id 'com.diffplug.spotless' version '8.0.0'
alias(libs.plugins.jetbrains.kotlin.android)
}
spotless {
kotlin {
target '**/*.kt'
ktfmt()
}
}
def qnnVersion = System.properties['qnnVersion']
def execuTorchVersion = System.properties['execuTorchVersion']
def flavor = System.properties['flavor']
android {
namespace = "org.pytorch.executorch"
compileSdk = 34
defaultConfig {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceSets {
main {
jniLibs.srcDirs = ['../../../cmake-out-android-so/']
}
androidTest {
resources.srcDirs += ['src/androidTest/resources']
}
}
kotlinOptions {
jvmTarget = "1.8"
}
}
task copyTestRes(type: Exec) {
commandLine 'bash', 'android_test_setup.sh'
}
dependencies {
implementation 'com.facebook.fbjni:fbjni:0.7.0'
implementation 'com.facebook.soloader:nativeloader:0.10.5'
implementation libs.core.ktx
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.27.2'
testImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.23'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'commons-io:commons-io:2.4'
androidTestImplementation 'org.json:json:20250107'
androidTestImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.23'
if (qnnVersion) {
implementation "com.qualcomm.qti:qnn-runtime:$qnnVersion"
}
}
mavenPublishing {
publishToMavenCentral()
signAllPublications()
coordinates("org.pytorch", "executorch-android" + ((flavor && flavor != "xnnpack") ? "-" + flavor : ""), execuTorchVersion ? execuTorchVersion : "1.2.0-SNAPSHOT")
pom {
name = "ExecuTorch Android"
description = "ExecuTorch Android API"
inceptionYear = "2025"
url = "https://github.com/pytorch/executorch/"
licenses {
license {
name = "BSD 3-Clause"
url = "https://github.com/pytorch/executorch/blob/main/LICENSE"
distribution = "https://github.com/pytorch/executorch/blob/main/LICENSE"
}
}
developers {
developer {
id = "pytorch"
name = "pytorch"
url = "https://github.com/pytorch/executorch/"
}
}
scm {
url = "https://github.com/pytorch/executorch.git"
connection = "scm:git:https://github.com/pytorch/executorch"
developerConnection = "scm:git:git@github.com:pytorch/executorch.git"
}
}
}
repositories {
maven {
url "https://central.sonatype.com/repository/maven-snapshots/"
}
}