185 lines
4.8 KiB
Groovy
185 lines
4.8 KiB
Groovy
plugins {
|
||
alias(libs.plugins.android.application)
|
||
alias(libs.plugins.kotlin.android)
|
||
id 'com.google.devtools.ksp' version '2.0.0-1.0.24'
|
||
id 'com.google.protobuf'
|
||
}
|
||
|
||
android {
|
||
namespace 'com.zs.smarthuman'
|
||
compileSdk 35
|
||
defaultConfig {
|
||
applicationId "com.zs.smarthuman"
|
||
minSdk 22
|
||
targetSdk 35
|
||
versionCode 1
|
||
versionName "1.0.0"
|
||
multiDexEnabled true
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
externalNativeBuild {
|
||
cmake {
|
||
cppFlags ""
|
||
}
|
||
}
|
||
|
||
ndk {
|
||
// 设置支持的SO库架构,第三方给的so库哪几种架构,就配置这几种架构
|
||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||
}
|
||
}
|
||
|
||
|
||
lintOptions {
|
||
abortOnError false
|
||
}
|
||
|
||
packagingOptions {
|
||
doNotStrip '*/armeabi-v7a/*.so'
|
||
doNotStrip '*/arm64-v8a/*.so'
|
||
}
|
||
|
||
signingConfigs {
|
||
release {
|
||
keyAlias 'zs'
|
||
keyPassword '123456'
|
||
storeFile file('../zs.jks')
|
||
storePassword '123456'
|
||
}
|
||
}
|
||
|
||
buildFeatures {
|
||
buildConfig = true // 显式启用
|
||
}
|
||
|
||
buildTypes {
|
||
debug {
|
||
minifyEnabled false
|
||
shrinkResources false
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
signingConfig signingConfigs.release
|
||
}
|
||
|
||
release {
|
||
minifyEnabled true
|
||
shrinkResources true
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
signingConfig signingConfigs.release
|
||
}
|
||
}
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_17
|
||
targetCompatibility JavaVersion.VERSION_17
|
||
}
|
||
kotlinOptions {
|
||
jvmTarget = '17'
|
||
}
|
||
|
||
ksp {
|
||
arg("rxhttp_rxjava", "3.1.6")
|
||
}
|
||
|
||
viewBinding {
|
||
enable = true
|
||
}
|
||
|
||
ndkVersion '27.0.12077973'
|
||
|
||
applicationVariants.configureEach { variant ->
|
||
if (variant.buildType.name != 'release') return
|
||
variant.outputs.configureEach { output ->
|
||
def date = new Date().format("yyyyMMddhhmm", TimeZone.getTimeZone("GMT+08"))
|
||
outputFileName = "SmartHuman-${output.name}-${variant.versionName}-${variant.versionCode}-${date}.apk"
|
||
def file = new File("${rootDir}/#outputAPK/${output.name}")
|
||
variant.packageApplication.outputDirectory = file
|
||
}
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
jniLibs.srcDirs = ['src/main/jniLibs']
|
||
}
|
||
}
|
||
|
||
externalNativeBuild {
|
||
cmake {
|
||
path "CMakeLists.txt"
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
protobuf {
|
||
protoc {
|
||
artifact = 'com.google.protobuf:protoc:3.25.1'
|
||
}
|
||
//配置生成目录,编译后会在 build 的目录下生成对应的java文件
|
||
generateProtoTasks {
|
||
all().each { task ->
|
||
task.builtins {
|
||
java {}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
dependencies {
|
||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||
implementation libs.androidx.core.ktx
|
||
implementation libs.androidx.appcompat
|
||
implementation libs.material
|
||
implementation libs.androidx.activity
|
||
implementation libs.androidx.constraintlayout
|
||
implementation libs.androidx.lifecycle.runtime.android
|
||
testImplementation libs.junit
|
||
androidTestImplementation libs.androidx.junit
|
||
androidTestImplementation libs.androidx.espresso.core
|
||
|
||
def rxhttp_version = '3.3.2'
|
||
implementation libs.okhttp
|
||
implementation libs.rxhttp
|
||
ksp "com.github.liujingxing.rxhttp:rxhttp-compiler:$rxhttp_version"
|
||
|
||
//RxJava3
|
||
implementation libs.rxjava
|
||
implementation libs.rxandroid
|
||
implementation libs.rxlife.rxjava3 //管理RxJava3生命周期,页面销毁,关闭请求
|
||
|
||
implementation libs.glide
|
||
annotationProcessor libs.compiler
|
||
|
||
implementation libs.utilcodex
|
||
// ViewModel KTX 扩展(包含 viewModelScope)
|
||
implementation libs.androidx.lifecycle.viewmodel.ktx
|
||
debugImplementation libs.leakcanary.android
|
||
|
||
// 透明状态栏
|
||
implementation libs.immersionbar
|
||
implementation libs.immersionbar.ktx
|
||
implementation libs.immersionbar.components
|
||
|
||
implementation libs.baserecyclerviewadapterhelper
|
||
|
||
implementation libs.androidx.recyclerview
|
||
|
||
|
||
implementation libs.protobuf.java
|
||
implementation libs.fastjson
|
||
compileOnly files('libs/netty-tcp-4.1.33-1.0.jar')
|
||
implementation libs.core
|
||
implementation libs.androidx.multidex
|
||
implementation libs.gsyvideoplayer
|
||
|
||
|
||
implementation project(':unityLibrary')
|
||
implementation fileTree(dir: project(':unityLibrary').getProjectDir().toString() + ('\\libs'), include: ['*.jar'])
|
||
|
||
|
||
implementation libs.okhttp.sse
|
||
|
||
implementation libs.androidautosize
|
||
|
||
implementation files('libs/sherpa-onnx-1.12.23.aar')
|
||
|
||
} |