- 添加根目录 AGENTS.md 定义全仓工程总览及各端开发规范 - 添加 webrtc_controller_flutter/AGENTS.md 定义 Flutter 项目技术栈、架构与编码规范 - 修正 WebRTCController app/build.gradle 中 appName 返回值
198 lines
6.7 KiB
Groovy
198 lines
6.7 KiB
Groovy
plugins {
|
||
id 'com.android.application'
|
||
id 'com.google.protobuf'
|
||
id 'org.jetbrains.kotlin.android'
|
||
id 'org.jetbrains.kotlin.kapt'
|
||
}
|
||
|
||
def releaseTime() {
|
||
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
|
||
}
|
||
|
||
def appName() {
|
||
return "WebRTCController"
|
||
}
|
||
|
||
android {
|
||
namespace 'com.ttstd.controller'
|
||
compileSdk 34
|
||
|
||
defaultConfig {
|
||
applicationId "com.ttstd.controller"
|
||
minSdk 24
|
||
targetSdk 34
|
||
versionCode 1
|
||
versionName "1.0"
|
||
|
||
// 服务端地址(信令 wss 与 HTTP api 同源)。部署时通过 flavor / CI 注入真实值。
|
||
buildConfigField "String", "API_BASE", "\"http://192.168.5.224:8080\""
|
||
buildConfigField "String", "WS_URL", "\"ws://192.168.5.224:8080/ws/signal\""
|
||
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
kotlinOptions {
|
||
jvmTarget = '1.8'
|
||
}
|
||
|
||
buildFeatures {
|
||
dataBinding true
|
||
buildConfig true
|
||
aidl true
|
||
}
|
||
|
||
signingConfigs {
|
||
keypub {
|
||
storeFile file(rootProject.ext.signingConfigs.keypub.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.keypub.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.keypub.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.keypub.keyPassword
|
||
}
|
||
|
||
crosshatch {
|
||
storeFile file(rootProject.ext.signingConfigs.crosshatch.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.crosshatch.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.crosshatch.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.crosshatch.keyPassword
|
||
}
|
||
|
||
zhanxun {
|
||
storeFile file(rootProject.ext.signingConfigs.zhanxun.storeFile)
|
||
storePassword rootProject.ext.signingConfigs.zhanxun.storePassword
|
||
keyAlias rootProject.ext.signingConfigs.zhanxun.keyAlias
|
||
keyPassword rootProject.ext.signingConfigs.zhanxun.keyPassword
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
zhanRuiDebug.initWith(debug)
|
||
zhanRuiDebug {
|
||
debuggable true
|
||
signingConfig signingConfigs.zhanxun
|
||
}
|
||
|
||
zhanRuiRelease.initWith(release)
|
||
zhanRuiRelease {
|
||
signingConfig signingConfigs.zhanxun
|
||
}
|
||
|
||
CrosshatchDebug.initWith(debug)
|
||
CrosshatchDebug {
|
||
debuggable true
|
||
signingConfig signingConfigs.crosshatch
|
||
}
|
||
|
||
CrosshatchRelease.initWith(release)
|
||
CrosshatchRelease {
|
||
signingConfig signingConfigs.crosshatch
|
||
}
|
||
|
||
debug {
|
||
versionNameSuffix "_debug"
|
||
debuggable true
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
signingConfig signingConfigs.keypub
|
||
}
|
||
|
||
release {
|
||
minifyEnabled false
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
//签名
|
||
signingConfig signingConfigs.keypub
|
||
}
|
||
}
|
||
|
||
// Add application variant configuration here instead
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def buildType = variant.buildType.name
|
||
|
||
if (buildType.contains("debug")) {
|
||
output.outputFileName = "${appName()}_V${defaultConfig.versionName}_${releaseTime()}.apk"
|
||
} else {
|
||
output.outputFileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType}.apk"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
protobuf {
|
||
protoc {
|
||
artifact = 'com.google.protobuf:protoc:3.25.1'
|
||
}
|
||
generateProtoTasks {
|
||
all().each { task ->
|
||
task.builtins {
|
||
java {}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||
implementation 'com.google.android.material:material:1.11.0'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||
implementation "androidx.multidex:multidex:2.0.1"
|
||
implementation "androidx.recyclerview:recyclerview:1.1.0"
|
||
// Room依赖
|
||
implementation "androidx.room:room-runtime:2.8.4"
|
||
implementation "androidx.room:room-rxjava3:2.8.4"
|
||
kapt "androidx.room:room-compiler:2.8.4"
|
||
// ViewModel和LiveData
|
||
implementation "androidx.lifecycle:lifecycle-viewmodel:2.10.0"
|
||
implementation "androidx.lifecycle:lifecycle-livedata:2.10.0"
|
||
implementation "androidx.lifecycle:lifecycle-runtime:2.10.0"
|
||
kapt "androidx.lifecycle:lifecycle-compiler:2.10.0"
|
||
// LifecycleService 核心库
|
||
implementation "androidx.lifecycle:lifecycle-service:2.10.0"
|
||
// 安全存储:加密 SharedPreferences(保存激活得到的 deviceSecret / deviceUid / accessToken)
|
||
implementation 'androidx.security:security-crypto:1.1.0'
|
||
|
||
testImplementation 'junit:junit:4.13.2'
|
||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||
|
||
//RxJava
|
||
implementation 'io.reactivex.rxjava3:rxjava:3.1.12'
|
||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
|
||
|
||
implementation 'com.squareup.moshi:moshi:1.15.2'
|
||
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
|
||
implementation 'com.squareup.okhttp3:logging-interceptor:5.3.2'
|
||
implementation 'com.squareup.retrofit2:retrofit:3.0.0'
|
||
implementation 'com.squareup.retrofit2:converter-gson:3.0.0'
|
||
// implementation 'com.squareup.retrofit2:adapter-rxjava2:3.0.0'
|
||
implementation "com.squareup.retrofit2:adapter-rxjava3:3.0.0"
|
||
|
||
// Gson for JSON(信令消息仍使用 JSON)
|
||
implementation 'com.google.code.gson:gson:2.14.0'
|
||
// Protobuf(DataChannel 控制指令二进制)
|
||
implementation 'com.google.protobuf:protobuf-java:3.25.1'
|
||
|
||
// WebRTC
|
||
implementation 'io.github.webrtc-sdk:android:144.7559.09'
|
||
// implementation 'org.webrtc:google-webrtc:1.0.32006'
|
||
|
||
//生命周期管理
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components-preference:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
|
||
//glide
|
||
implementation 'com.github.bumptech.glide:glide:4.15.1'
|
||
kapt 'com.github.bumptech.glide:compiler:4.15.1'
|
||
|
||
implementation 'com.tencent:mmkv-static:2.4.0'
|
||
}
|