213 lines
6.9 KiB
Groovy
213 lines
6.9 KiB
Groovy
plugins {
|
||
alias(libs.plugins.android.application)
|
||
alias(libs.plugins.kotlin.android)
|
||
|
||
}
|
||
android {
|
||
// 1. 定义渠道维度(必须配置,否则报错)
|
||
flavorDimensions "environment"
|
||
|
||
|
||
namespace 'com.qxcm.qxlive'
|
||
compileSdk 35
|
||
bundle {
|
||
language {
|
||
enableSplit = false
|
||
}
|
||
}
|
||
defaultConfig {
|
||
applicationId "com.qxcm.qxlive"
|
||
minSdk 24
|
||
targetSdk 33
|
||
versionCode Integer.parseInt(project.findProperty("APP_VERSION_CODE"))
|
||
versionName project.findProperty("APP_VERSION_NAME")
|
||
multiDexEnabled true
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
ndk {
|
||
//设置支持的so库
|
||
// abiFilters 'arm64-v8a', 'armeabi','arm64'
|
||
abiFilters 'arm64-v8a', 'armeabi-v7a'
|
||
}
|
||
|
||
javaCompileOptions {
|
||
annotationProcessorOptions {
|
||
arguments = [
|
||
AROUTER_MODULE_NAME: project.getName()
|
||
]
|
||
}
|
||
}
|
||
// 【默认图标占位符】后续会被渠道配置覆盖
|
||
manifestPlaceholders = [
|
||
icon: "@mipmap/ic_launcher" // 默认图标(main目录下的图标)
|
||
]
|
||
|
||
// signingConfig signingConfigs.release
|
||
// proguardFiles 'proguard-rules.pro'
|
||
|
||
}
|
||
|
||
// 2. 配置测试版和正式版渠道
|
||
productFlavors {
|
||
// 正式版配置
|
||
releas {
|
||
dimension "environment"
|
||
// 正式版包名:使用基础包名(com.example.myapp)
|
||
applicationIdSuffix ""
|
||
|
||
// 【正式版应用名称】通过resValue动态生成string资源
|
||
resValue "string", "app_name", "羽声语音"
|
||
|
||
// 【正式版图标】替换manifest中的占位符(使用main目录下的正式图标)
|
||
manifestPlaceholders = [
|
||
appIcon: "@mipmap/ic_launcher" // 需在main/res/mipmap放置该图标
|
||
]
|
||
}
|
||
|
||
// // 测试版配置
|
||
beta {
|
||
dimension "environment"
|
||
// 测试版包名:基础包名 + .beta(com.example.myapp.beta)
|
||
applicationIdSuffix ".beta"
|
||
// 测试版版本名:1.0-beta
|
||
versionNameSuffix "-beta"
|
||
|
||
// 【测试版应用名称】动态生成带标识的名称
|
||
resValue "string", "app_name", "羽声-测试版"
|
||
|
||
// 【测试版图标】替换为测试专用图标
|
||
manifestPlaceholders = [
|
||
appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
|
||
]
|
||
}
|
||
}
|
||
|
||
signingConfigs {
|
||
|
||
debug {
|
||
storeFile file("my-release-key.jks")
|
||
storePassword "123456"
|
||
keyAlias "mykey"
|
||
keyPassword "123456"
|
||
}
|
||
|
||
release {
|
||
storeFile file("my-release-key.jks")
|
||
storePassword "123456"
|
||
keyAlias "mykey"
|
||
keyPassword "123456"
|
||
}
|
||
|
||
|
||
}
|
||
buildTypes {
|
||
release {
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
signingConfig signingConfigs.release
|
||
|
||
applicationVariants.all { variant ->
|
||
if (variant.buildType.name == 'release') {
|
||
variant.outputs.each { output ->
|
||
def outputFile = output.outputFile
|
||
if (outputFile != null && outputFile.name.endsWith('.apk')) {
|
||
def versionName = variant.versionName
|
||
def versionCode = variant.versionCode
|
||
def fileName = "羽声_${versionName}_${versionCode}.apk"
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
debug {
|
||
debuggable true
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
signingConfig signingConfigs.debug
|
||
|
||
applicationVariants.all { variant ->
|
||
if (variant.buildType.name == 'debug') {
|
||
variant.outputs.each { output ->
|
||
def outputFile = output.outputFile
|
||
if (outputFile != null && outputFile.name.endsWith('.apk')) {
|
||
def versionName = variant.versionName
|
||
def versionCode = variant.versionCode
|
||
def fileName = "app-debug-sr_${versionName}_${versionCode}.apk"
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
buildFeatures {
|
||
dataBinding true
|
||
}
|
||
dataBinding {
|
||
enabled = true
|
||
}
|
||
packagingOptions {
|
||
exclude 'META-INF/gradle/incremental.annotation.processors'
|
||
exclude 'META-INF/LICENSE.txt'
|
||
exclude 'META-INF/NOTICE.txt'
|
||
// exclude 'lib/arm64-v8a/libagora-ffmpeg.so'
|
||
// exclude 'lib/arm64-v8a/libagora-fdkaac.so'
|
||
}
|
||
|
||
kotlinOptions {
|
||
jvmTarget = '17'
|
||
}
|
||
// dexOptions {
|
||
// dexInProcess true
|
||
// preDexLibraries true
|
||
// javaMaxHeapSize "6g"
|
||
// }
|
||
|
||
}
|
||
|
||
dependencies {
|
||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||
// implementation fileTree(dir: '../LocalAar/aar_libs', include: ['*.jar', '*.aar'] dir: 'libs')
|
||
|
||
implementation libs.appcompat
|
||
implementation libs.material
|
||
implementation libs.activity
|
||
implementation libs.constraintlayout
|
||
|
||
testImplementation libs.junit
|
||
androidTestImplementation libs.ext.junit
|
||
androidTestImplementation libs.espresso.core
|
||
|
||
|
||
implementation files('libs/auth_number_product-2.14.7-log-online-standard-cuum-release.aar')
|
||
implementation files('libs/logger-2.2.2-release.aar')
|
||
implementation files('libs/main-2.2.3-release.aar')
|
||
|
||
implementation files('libs/WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc.aar')
|
||
implementation files('libs/WbCloudNormal-v5.1.10-4e3e198.aar')
|
||
|
||
|
||
implementation(libs.arouter.api.v150)
|
||
//annotationProcessor
|
||
annotationProcessor libs.arouter.compiler
|
||
implementation project(':modulevocal') // 必须
|
||
annotationProcessor project(':modulevocal') // 关键!
|
||
|
||
api project(":moduleUtil")
|
||
api project(":moduleLogin")
|
||
implementation project(':modulemain')
|
||
|
||
//aar的名称,例如:WbCloudFaceLiveSdk-v6.0.0-1234567.aar,填入'WbCloudFaceLiveSdk-v6.0.0-1234567'
|
||
// implementation(name: 'WbCloudFaceLiveSdk-face-v6.6.2-8e4718fc', ext: 'aar')
|
||
////2. 云normal SDK,
|
||
////aar的名称,例如:WbCloudNormal-v5.1.10-123456789.aar,填入 'WbCloudNormal-v5.1.10-123456789.aar'
|
||
// implementation(name: 'WbCloudNormal-v5.1.10-4e3e198', ext: 'aar')
|
||
} |