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=formatTime() 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.brandVersionCode}.${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()) } } } 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 { 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' } 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' }