123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- import java.text.SimpleDateFormat
- import java.time.LocalDateTime
- plugins {
- id 'com.android.application'
- id 'kotlin-android'
- id 'kotlin-kapt'
- }
- static int formatTime() {
- LocalDateTime now = LocalDateTime.now()
- int year = now.year % 100 // 取年份的最后两位
- int month = now.monthValue
- int day = now.dayOfMonth
- int hour = now.hour
- int randomNumber = new Random().nextInt(10) // 生成0到9之间的随机数
- return Integer.parseInt(String.format("%02d%02d%02d%02d%d", year, month, day, hour, randomNumber))
- }
- ext{
- versionCode=Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
- brandCode="034A"
- brandVersionCode=versionCode
- model="3015"
- }
- android {
- compileSdk 31
- defaultConfig {
- applicationId "com.develop.foodcooking"
- minSdk 21
- targetSdk 26
- versionCode project.ext.versionCode
- versionName "${project.ext.model}.${project.ext.brandCode}.${project.ext.versionCode}"
- archivesBaseName = "cofar-cooking_${versionName}"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
- }
- }
- kapt {
- arguments {
- arg("AROUTER_MODULE_NAME", project.getName())
- arg("room.schemaLocation", "$projectDir/schemas".toString())
- }
- }
- packagingOptions {
- pickFirst 'lib/armeabi-v7a/libc++_shared.so'
- }
- }
- flavorDimensions "platform"
- productFlavors {
- brandDefault {
- dimension "platform"
- applicationId "com.develop.foodcooking"
- buildConfigField("String", "UpdatePlatform", "\"normal\"")
- resValue("string", "app_theme", "@style/SplashTheme")
- }
- brand000ATuya {
- dimension "platform"
- applicationId "com.develop.foodcooking"
- buildConfigField("String", "UpdatePlatform", "\"normal\"")
- resValue("string", "app_theme", "@style/SplashTheme")
- }
-
- brand034 {
- dimension "platform"
- applicationId "com.develop.foodcooking"
- buildConfigField("String", "UpdatePlatform", "\"night\"")
- resValue("string", "app_theme", "@style/Splash034Theme")
- }
- brand012ATuya {
- dimension "platform"
- applicationId "com.develop.foodcooking"
- buildConfigField("String", "UpdatePlatform", "\"normal\"")
- resValue("string", "app_theme", "@style/SplashTheme")
- }
- }
- signingConfigs {
- debug {
- storeFile file('..\\signature\\rk.jks')
- storePassword '123456'
- keyAlias 'rk'
- keyPassword '123456'
- }
- foodCooking {
- storeFile file("..\\signature\\rk.jks")
- storePassword '123456'
- keyAlias 'rk'
- keyPassword '123456'
- }
-
- release {
- storeFile file('..\\signature\\rk.jks')
- storePassword '123456'
- keyAlias 'rk'
- keyPassword '123456'
- }
- }
- buildTypes {
- release {
- debuggable true
- minifyEnabled false
- productFlavors.brand034.signingConfig signingConfigs.release
- productFlavors.brand000ATuya.signingConfig signingConfigs.release
- productFlavors.brand012ATuya.signingConfig signingConfigs.release
- productFlavors.brandDefault.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'
- }
- viewBinding {
- enabled = true
- }
- }
- dependencies {
- implementation project(path: ':libBase')
- implementation project(path: ':BusinessRouter')
- implementation project(path: ':BusinessAuth')
- implementation project(path: ':BusinessSetting')
- implementation project(path: ':BusinessMain')
- implementation project(path: ':BusinessStep')
- kapt 'com.alibaba:arouter-compiler:1.5.1'
- }
|