| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- apply plugin: 'com.android.application'
- apply plugin: 'kotlin-android'
- apply plugin: 'kotlin-android-extensions'
- apply plugin: 'kotlin-kapt'
- apply plugin: "androidx.navigation.safeargs.kotlin"
- android {
- compileSdkVersion 29
- buildToolsVersion "29.0.3"
- def currentVersionCode = getVersionCode()
- defaultConfig {
- applicationId "com.bearya.kids"
- minSdkVersion 21
- targetSdkVersion 29
- versionCode currentVersionCode
- multiDexEnabled true
- vectorDrawables.useSupportLibrary true
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = ["room.schemaLocation" : "$projectDir/schemas".toString(),
- "room.expandProjection": "true"]
- }
- }
- buildFeatures {
- dataBinding true
- }
- flavorDimensions "1.2.1"
- }
- aaptOptions {
- noCompress "webp" //表示不让aapt压缩的文件后缀
- }
- sourceSets {
- main {
- java {
- srcDirs = ['src/main/java']
- }
- res {
- srcDirs = ['src/main/res']
- }
- }
- kids {
- assets {
- srcDirs = ['src/kids/assets']
- }
- }
- child {
- assets {
- srcDirs = ['src/child/assets']
- }
- }
- }
- productFlavors {
- kids {
- versionName "1.2.2"
- dimension "1.2.1"
- }
- child {
- versionName "1.2.2"
- dimension "1.2.1"
- }
- }
- signingConfigs {
- config {
- keyAlias 'BeiYa'
- storePassword 'BeiYa123'
- storeFile file('../bearya_keystore.jks')
- keyPassword 'BeiYa!@#'
- }
- }
- buildTypes {
- debug {
- debuggable true
- minifyEnabled false
- buildConfigField "String", "BuglyAppKey", BUGLY_APP_KEY
- signingConfig signingConfigs.config
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- release {
- debuggable false
- minifyEnabled false
- buildConfigField "String", "BuglyAppKey", BUGLY_APP_KEY
- signingConfig signingConfigs.config
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- android.applicationVariants.all { variant ->
- variant.outputs.each { output ->
- if ("release" == buildType.name)
- output.outputFileName =
- "${variant.productFlavors[0].name}_${defaultConfig.versionCode}_v${variant.productFlavors[0].versionName}_release.apk"
- else
- output.outputFileName =
- "${variant.productFlavors[0].name}_v${defaultConfig.versionName}.apk"
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = 1.8
- }
- }
- // 获取版本号
- def getVersionCode() {
- def versionFile = file('version.properties')// 读取第一步新建的文件
- if (versionFile.canRead()) {// 判断文件读取异常
- Properties versionProps = new Properties()
- versionProps.load(new FileInputStream(versionFile))
- def versionCode = versionProps['VERSION_CODE'].toInteger()// 读取文件里面的版本号
- versionProps['VERSION_CODE'] = (++versionCode).toString()
- versionProps.store(versionFile.newWriter(), null)
- return versionCode // 返回自增之后的版本号
- } else {
- throw new Exception("Could not find version.properties!")
- }
- }
- dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'androidx.core:core-ktx:1.3.1'
- implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
- implementation 'androidx.viewpager2:viewpager2:1.0.0'
- implementation 'androidx.paging:paging-runtime:2.1.2'
- implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
- implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
- implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
- implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
- implementation 'androidx.lifecycle:lifecycle-reactivestreams:2.2.0'
- implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
- implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
- implementation 'androidx.room:room-runtime:2.2.5'
- implementation 'androidx.room:room-ktx:2.2.5'
- implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
- implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
- implementation 'androidx.cardview:cardview:1.0.0'
- implementation 'androidx.recyclerview:recyclerview:1.1.0'
- implementation 'androidx.multidex:multidex:2.0.1'
- implementation 'com.google.code.gson:gson:2.8.6'
- implementation 'com.tencent.bugly:crashreport:3.1.9'
- implementation 'com.github.bumptech.glide:glide:4.11.0'
- implementation 'com.github.SheHuan:NiceImageView:1.0.5'
- implementation 'jp.wasabeef:glide-transformations:4.0.1'
- implementation 'com.orhanobut:logger:2.2.0'
- implementation 'com.kaopiz:kprogresshud:1.2.0'
- kapt 'com.github.bumptech.glide:compiler:4.11.0'
- kapt 'androidx.annotation:annotation:1.1.0'
- kapt 'androidx.room:room-compiler:2.2.5'
- }
|