Files
digital_person/app/build.gradle
gcw_4spBpAfv 4e33063a98 add photo
2026-04-23 15:21:24 +08:00

130 lines
4.4 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}
def oneSentenceAsrAar = file('libs/asr-one-sentence-release.aar')
kapt {
// Room uses javac stubs under kapt; keep parameter names for :bind variables.
javacOptions {
option("-parameters")
}
}
android {
namespace 'com.digitalperson'
compileSdk 34
sourceSets {
main {
// app/note/ref → assets 中为 ref/...(与 AppConfig.RefCorpus.ASSETS_ROOT 一致)
assets.srcDirs = ['src/main/assets', 'note']
}
}
buildFeatures {
buildConfig true
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
// 与 school_teacher 一致:调试构建下可避免某些设备/系统对 jniLibs 打包的校验问题
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
// 不压缩大文件,避免内存不足错误
aaptOptions {
noCompress 'rknn', 'rkllm', 'onnx', 'model', 'bin', 'json'
}
defaultConfig {
applicationId "com.digitalperson"
minSdk 22
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// Read from gradle.properties / local.properties:
// LLM_API_URL=...
// LLM_API_KEY=...
// LLM_MODEL=...
buildConfigField "String", "LLM_API_URL", "\"${(project.findProperty('LLM_API_URL') ?: 'https://ark.cn-beijing.volces.com/api/v3/chat/completions').toString()}\""
buildConfigField "String", "LLM_API_KEY", "\"${(project.findProperty('LLM_API_KEY') ?: '').toString()}\""
buildConfigField "String", "LLM_MODEL", "\"${(project.findProperty('LLM_MODEL') ?: 'doubao-1-5-pro-32k-character-250228').toString()}\""
buildConfigField "boolean", "USE_LIVE2D", "${(project.findProperty('USE_LIVE2D') ?: 'true').toString()}"
// 腾讯云「一句话识别」Android SDK将 asr-one-sentence-release.aar 放入 app/libs/ 后为 true
buildConfigField "boolean", "HAS_TENCENT_ASR_SDK", "${oneSentenceAsrAar.exists()}"
ndk {
abiFilters "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// ExoPlayer for video playback (used to show silent / speaking videos)
implementation 'com.google.android.exoplayer:exoplayer:2.18.6'
implementation 'androidx.camera:camera-core:1.3.4'
implementation 'androidx.camera:camera-camera2:1.3.4'
implementation 'androidx.camera:camera-lifecycle:1.3.4'
implementation 'androidx.camera:camera-view:1.3.4'
implementation project(':framework')
implementation files('../Live2DFramework/Core/android/Live2DCubismCore.aar')
// Tencent Cloud TTS SDK
implementation files('libs/realtime_tts-release-v2.0.16-20260128-d80cafe.aar')
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
// Room dependencies
implementation 'androidx.room:room-runtime:2.5.2'
kapt 'androidx.room:room-compiler:2.5.2'
implementation 'androidx.room:room-ktx:2.5.2'
implementation project(':tuanjieLibrary')
implementation files('../tuanjieLibrary/libs/unity-classes.jar')
// BGE tokenizer (BasicTokenizer) + SimilarityManager 批量相似度测试
implementation 'com.google.guava:guava:31.1-android'
implementation 'org.ejml:ejml-core:0.43.1'
implementation 'org.ejml:ejml-simple:0.43.1'
// 腾讯云「一句话识别」通过 OkHttp 直接实现 TC3 签名,无需 AAR SDK
}