|
|
@@ -9,31 +9,69 @@ android {
|
|
|
buildToolsVersion "29.0.3"
|
|
|
|
|
|
def currentVersionCode = getVersionCode()
|
|
|
- def currentVersionName = getVersionName()
|
|
|
|
|
|
defaultConfig {
|
|
|
applicationId "com.bearya.kids"
|
|
|
minSdkVersion 21
|
|
|
targetSdkVersion 29
|
|
|
versionCode currentVersionCode
|
|
|
- versionName currentVersionName
|
|
|
multiDexEnabled true
|
|
|
vectorDrawables.useSupportLibrary true
|
|
|
javaCompileOptions {
|
|
|
annotationProcessorOptions {
|
|
|
- arguments = ["room.schemaLocation": "$projectDir/schemas".toString(),
|
|
|
- "room.expandProjection":"true"]
|
|
|
+ arguments = ["room.schemaLocation" : "$projectDir/schemas".toString(),
|
|
|
+ "room.expandProjection": "true"]
|
|
|
}
|
|
|
}
|
|
|
- buildFeatures{
|
|
|
+ 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'
|
|
|
@@ -63,9 +101,11 @@ android {
|
|
|
android.applicationVariants.all { variant ->
|
|
|
variant.outputs.each { output ->
|
|
|
if ("release" == buildType.name)
|
|
|
- output.outputFileName = "Kids_${defaultConfig.versionCode}_v${defaultConfig.versionName}_release.apk"
|
|
|
+ output.outputFileName =
|
|
|
+ "${variant.productFlavors[0].name}_${defaultConfig.versionCode}_v${variant.productFlavors[0].versionName}_release.apk"
|
|
|
else
|
|
|
- output.outputFileName = "Kids_v${defaultConfig.versionName}.apk"
|
|
|
+ output.outputFileName =
|
|
|
+ "${variant.productFlavors[0].name}_v${defaultConfig.versionName}.apk"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -78,11 +118,6 @@ android {
|
|
|
jvmTarget = 1.8
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-kapt {
|
|
|
- generateStubs = true
|
|
|
}
|
|
|
|
|
|
// 获取版本号
|
|
|
@@ -100,30 +135,17 @@ def getVersionCode() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-def getVersionName() {
|
|
|
- def versionFile = file('version.properties')// 读取第一步新建的文件
|
|
|
- if (versionFile.canRead()) {// 判断文件读取异常
|
|
|
- Properties versionProps = new Properties()
|
|
|
- versionProps.load(new FileInputStream(versionFile))
|
|
|
- def versionName = versionProps['VERSION_NAME'].toString()// 读取文件里面的版本号
|
|
|
- return versionName // 返回版本
|
|
|
- } 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.7'
|
|
|
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7'
|
|
|
+ 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.1.0'
|
|
|
- implementation 'androidx.core:core-ktx:1.3.0'
|
|
|
- implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
|
|
+ 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'
|
|
|
@@ -131,8 +153,8 @@ dependencies {
|
|
|
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-beta01'
|
|
|
- implementation 'androidx.navigation:navigation-ui-ktx:2.3.0-beta01'
|
|
|
+ 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'
|
|
|
@@ -151,7 +173,7 @@ dependencies {
|
|
|
implementation 'com.orhanobut:logger:2.2.0'
|
|
|
implementation 'com.kaopiz:kprogresshud:1.2.0'
|
|
|
|
|
|
- annotationProcessor 'com.github.bumptech.glide:compiler:4.11.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'
|
|
|
}
|