123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- @file:Suppress("CAST_NEVER_SUCCEEDS")
-
- import java.text.SimpleDateFormat
- import java.util.Date
-
- @Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
- plugins {
- alias(libs.plugins.androidApplication)
- alias(libs.plugins.kotlinAndroid)
- }
-
- android {
- namespace = "com.xhkjedu.manageapp"
- compileSdk = 34
-
- defaultConfig {
- applicationId = "com.xhkjedu.manageapp"
- minSdk = 24
- targetSdk = 30
- versionCode = 25
- versionName = "1.0.24"
-
- testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- vectorDrawables {
- useSupportLibrary = true
- }
- ndk{
- abiFilters += listOf("armeabi","armeabi-v7a","arm64-v8a","x86","x86_64")
- }
- }
- viewBinding{
- enable=true
- }
-
- signingConfigs {
- create("keystore") {
- keyAlias = "xinghuo"
- keyPassword = "xhkjedu"
- storeFile = file("xinghuo.keystore")
- storePassword = "xhkjedu"
- }
- }
- buildFeatures {
- compose = true
- buildConfig=true
- }
- buildTypes {
- /* release {
- isMinifyEnabled = false
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }*/
- val signConfig=signingConfigs.getByName("keystore")
- getByName("release") {
- isMinifyEnabled = false
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- signingConfig=signConfig
- buildConfigField("boolean", "IS_DEBUG", "false")
- }
- getByName("debug") {
- isMinifyEnabled = false
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- signingConfig=signConfig
- buildConfigField("boolean", "IS_DEBUG", "true")
- }
- }
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = "1.8"
- }
-
- composeOptions {
- kotlinCompilerExtensionVersion = "1.4.3"
- }
- packaging {
- resources {
- excludes += "/META-INF/{AL2.0,LGPL2.1}"
- }
- }
- lint {
- abortOnError=false
- }
-
- fun releaseTime(): String {
- val dateFormat = SimpleDateFormat("yyyyMMdd")
- return dateFormat.format(Date())
- }
-
- applicationVariants.all{
- val versionName = this.versionName
- val versionCode = this.versionCode
- val variantName = this.name
- outputs.all {
- if (this is com.android.build.gradle.internal.api.ApkVariantOutputImpl){
- val fileName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
- this.outputFileName=fileName
- }
- }
- }
- /* applicationVariants.all(
- object : Action<com.android.build.gradle.api.ApplicationVariant> {
- override fun execute(variant: com.android.build.gradle.api.ApplicationVariant) {
- println("variant: $variant")
- variant.outputs.all(
- object : Action<com.android.build.gradle.api.BaseVariantOutput> {
- override fun execute(
- output: com.android.build.gradle.api.BaseVariantOutput
- ) {
- val versionName = variant.versionName
- val versionCode = variant.versionCode
- val variantName = variant.name
- val outputImpl = output as com.android.build.gradle.internal.api.BaseVariantOutputImpl
- val fileName = "Manage_App-$variantName-$versionName-$versionCode-${releaseTime()}.apk"
- println("output file name: $fileName")
- outputImpl.outputFileName = fileName
- }
- }
- )
- }
- }
- )*/
- }
-
- dependencies {
-
- implementation(libs.core.ktx)
- implementation(libs.lifecycle.runtime.ktx)
- implementation(libs.activity.compose)
- implementation(platform(libs.compose.bom))
- implementation(libs.ui)
- implementation(libs.ui.graphics)
- implementation(libs.ui.tooling.preview)
- implementation(libs.material3)
- implementation(libs.appcompat)
- implementation(libs.androidx.recyclerview)
- implementation(project(mapOf("path" to ":websocket")))
- implementation(libs.androidx.cardview)
- testImplementation(libs.junit)
- implementation("com.baidu.lbsyun:BaiduMapSDK_Location_All:9.3.7")
- implementation("com.tencent.bugly:crashreport:latest.release")
- //第三方cardview
- implementation("org.linwg1988:lcardview:1.5.4")
- androidTestImplementation(libs.androidx.test.ext.junit)
- androidTestImplementation(libs.espresso.core)
- androidTestImplementation(platform(libs.compose.bom))
- androidTestImplementation(libs.ui.test.junit4)
- debugImplementation(libs.ui.tooling)
- debugImplementation(libs.ui.test.manifest)
- }
|