Newer
Older
SafeTreeController / app / build.gradle
import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    signingConfigs {
        release {
            storeFile file('SafeTreeController.jks')
            storePassword '123456789'
            keyAlias 'key0'
            keyPassword '123456789'
        }
    }
    compileSdkVersion 33

    defaultConfig {
        applicationId "com.casic.app.safetreecontroller"
        minSdkVersion 23
        targetSdkVersion 33
        versionCode 1005
        versionName "1.0.0.5"
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    kotlin {
        experimental {
            coroutines 'enable'
        }
    }

    buildFeatures {
        viewBinding true
    }

    applicationVariants.configureEach { variant ->
        variant.outputs.configureEach {
            outputFileName = "SafeTreeController_" + getBuildDate() + "_" + defaultConfig.versionName + ".apk"
        }
    }
}

static def getBuildDate() {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd", Locale.CHINA)
    return dateFormat.format(System.currentTimeMillis())
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //基础依赖库
    implementation 'com.github.AndroidCoderPeng:Kotlin-lite-lib:1.1.0'
    implementation 'androidx.core:core-ktx:1.9.0'
    def base_version = "1.6.1"
    implementation "androidx.appcompat:appcompat:${base_version}"
    implementation "com.google.android.material:material:${base_version}"
    //Google官方授权框架
    implementation 'pub.devrel:easypermissions:3.0.0'
    //沉浸式状态栏。基础依赖包,必须要依赖
    implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
    def vm_version = "2.5.1"
    //Kotlin协程
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:${vm_version}"
    //MVVM+LiveData
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:${vm_version}"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${vm_version}"
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    //返回值转换器
    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
    //okhttp3日志拦截器
    implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
    //网络请求和接口封装
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
    //官方Json解析库
    implementation 'com.google.code.gson:gson:2.10.1'
    //视频播放器,RTSP流
    implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.4.0-release-jitpack'
    //是否需要ExoPlayer模式
    implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v8.4.0-release-jitpack'
    //更多ijk的编码支持
    implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v8.4.0-release-jitpack'
    //图表
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    //HTML解析
    implementation 'org.jsoup:jsoup:1.15.3'
    //异常日志记录
    implementation 'com.tencent.bugly:crashreport:latest.release'
}