build.gradle 4.07 KB
Newer Older
UIUANG\Zsc's avatar
UIUANG\Zsc committed
1 2 3 4 5 6
plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
}
UIUANG\Zsc's avatar
UIUANG\Zsc committed
7 8 9
static def releaseTime() {
    return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}
UIUANG\Zsc's avatar
UIUANG\Zsc committed
10 11 12 13 14 15 16 17
android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.ypsx.yppos"
        minSdkVersion 21
        targetSdkVersion 30
18 19
        versionCode 100017
        versionName "1.00.017"
UIUANG\Zsc's avatar
UIUANG\Zsc committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildFeatures {
        dataBinding = true
    }

    //使用Kotlin实验特性
    androidExtensions {
        experimental = true
    }

    signingConfigs {
        config {
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_KEY_PASSWORD
        }
    }

    buildTypes {

44
        debug {
UIUANG\Zsc's avatar
UIUANG\Zsc committed
45 46 47 48 49
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }

UIUANG\Zsc's avatar
UIUANG\Zsc committed
50 51 52 53 54
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
UIUANG\Zsc's avatar
UIUANG\Zsc committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    lintOptions {
        disable 'InvalidPackage'
        disable "ResourceType"
        abortOnError false
    }
    dexOptions {
        javaMaxHeapSize "4g"
        jumboMode = true
        preDexLibraries = false
        additionalParameters = [
                '--multi-dex',//多分包
                '--set-max-idx-number=60000'//每个包内方法数上限
        ]
    }

UIUANG\Zsc's avatar
UIUANG\Zsc committed
78 79
    android.applicationVariants.all { variant ->
        variant.outputs.all {
UIUANG\Zsc's avatar
UIUANG\Zsc committed
80
            outputFileName =  "yppos_v${variant.versionCode}-${variant.versionName}-${variant.buildType.name}-${releaseTime()}.apk"
UIUANG\Zsc's avatar
UIUANG\Zsc committed
81 82 83
        }
    }

UIUANG\Zsc's avatar
UIUANG\Zsc committed
84 85 86 87
}

dependencies {

88
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
UIUANG\Zsc's avatar
UIUANG\Zsc committed
89 90 91
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation project(path: ':base')
    implementation files('libs/platform_sdk_v3.1.0326.jar')
UIUANG\Zsc's avatar
UIUANG\Zsc committed
92
    implementation project(path: ':common')
UIUANG\Zsc's avatar
UIUANG\Zsc committed
93 94 95 96 97 98

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation 'androidx.appcompat:appcompat:1.3.0'
99
    implementation 'com.google.android.material:material:1.3.0'
UIUANG\Zsc's avatar
UIUANG\Zsc committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.cardview:cardview:1.0.0'


    //微信开源项目,替代SP
    implementation 'com.blankj:utilcodex:1.26.0'

    //屏幕适配
    implementation 'me.jessyan:autosize:1.2.1'
    //BaseAdapter
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'

    def room_version = "2.3.0"

    implementation("androidx.room:room-runtime:$room_version")
    annotationProcessor "androidx.room:room-compiler:$room_version"

    // To use Kotlin annotation processing tool (kapt)
    kapt("androidx.room:room-compiler:$room_version")

    // optional - Kotlin Extensions and Coroutines support for Room
    implementation("androidx.room:room-ktx:$room_version")

    implementation 'io.github.razerdp:BasePopup:3.1.8'
    implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
    implementation 'com.github.getActivity:ToastUtils:9.5'
    implementation 'com.aliyun.dpa:oss-android-sdk:2.1.0'
UIUANG\Zsc's avatar
UIUANG\Zsc committed
127 128 129 130
// 友盟统计SDK
    implementation  'com.umeng.umsdk:common:9.4.2'// 必选
    implementation  'com.umeng.umsdk:asms:1.4.0'// 必选
    implementation 'com.umeng.umsdk:apm:1.5.2'//崩溃
UIUANG\Zsc's avatar
UIUANG\Zsc committed
131

UIUANG\Zsc's avatar
UIUANG\Zsc committed
132 133 134 135 136 137
//    val work_version = "2.6.0"
    // Kotlin + coroutines
//    implementation("androidx.work:work-runtime-ktx:$work_version")
//防崩溃
//    implementation 'cat.ereza:customactivityoncrash:2.3.0'
}