Files
digital_person/app/build.gradle
2026-03-05 13:55:57 +08:00

95 lines
3.2 KiB
Groovy

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.digitalperson'
compileSdk 34
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 21
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()}"
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'
}