* add Usage * LookupCustomMetadataMap() is deprecated in 1.13.1, so change to 1.12.1 Co-authored-by: weiliang <weiliang.chong@day-care.cn>
74 lines
1.9 KiB
Groovy
74 lines
1.9 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
}
|
|
|
|
android {
|
|
compileSdk 32
|
|
|
|
configurations {
|
|
extractForNativeBuild
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "cn.org.wenet.wekws"
|
|
minSdk 21
|
|
targetSdk 32
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
externalNativeBuild {
|
|
cmake {
|
|
targets "wekws"
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path "src/main/cpp/CMakeLists.txt"
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
|
implementation 'com.google.android.material:material:1.4.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
|
implementation 'com.microsoft.onnxruntime:onnxruntime-mobile:1.12.1'
|
|
extractForNativeBuild 'com.microsoft.onnxruntime:onnxruntime-mobile:1.12.1'
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
}
|
|
|
|
task extractAARForNativeBuild {
|
|
doLast {
|
|
configurations.extractForNativeBuild.files.each {
|
|
def file = it.absoluteFile
|
|
copy {
|
|
from zipTree(file)
|
|
into "$buildDir/$file.name"
|
|
include "headers/**"
|
|
include "jni/**"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.whenTaskAdded { task ->
|
|
if (task.name.contains('externalNativeBuild')) {
|
|
task.dependsOn(extractAARForNativeBuild)
|
|
}
|
|
}
|