import java.text.SimpleDateFormat apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.android.compileSdkVersion defaultConfig { applicationId "com.zhidao.adas.magic" minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion multiDexEnabled true versionCode 2 versionName "2.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" packagingOptions { //解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误 exclude 'META-INF/rxjava.properties' } } signingConfigs { release { keyAlias = 'CarLauncher' storeFile file('../keystore/car_launcher.jks') storePassword 'ZDauto123456' keyPassword 'ZDauto123456' } releaseEB5 { keyAlias = 'android_platform' storeFile file('../keystore/EB5/car_launcher.jks') storePassword 'ZDauto123456' keyPassword 'ZDauto123456' } } buildTypes { debug { debuggable true minifyEnabled false zipAlignEnabled false shrinkResources false signingConfig signingConfigs.release } release { debuggable false minifyEnabled false zipAlignEnabled false shrinkResources false signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } //插入构建时间 buildTypes.each { //设置时间格式 SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd.HHmmss", Locale.getDefault()) //获取当前时间 Date curDate = new Date(System.currentTimeMillis()) String buildTime = formatter.format(curDate) it.buildConfigField 'String', 'BUILD_TIME', "\"${buildTime}\"" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation rootProject.ext.dependencies.material implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.androidxappcompat implementation "androidx.recyclerview:recyclerview:1.2.1" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' implementation rootProject.ext.dependencies.gson implementation project(':libraries:mogo-adas') implementation project(':libraries:mogo-adas-data') implementation 'org.greenrobot:eventbus:3.2.0' implementation 'com.android.support:multidex:1.0.3' }