12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- plugins {
- id 'com.android.application'
- id 'kotlin-android'
- }
-
- android {
- compileSdk rootProject.ext.compile_sdk_version
-
- defaultConfig {
- applicationId "com.xkl.cdl"
- minSdk 21
- targetSdk 30
- versionCode 1
- versionName "1.0"
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- /*构建类型: 定义Gradle在构建阶段和打包应用时使用的某些属性*/
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
-
- //配置产品变种 与 构建变体
- //flavorDimensions :变种维度
- flavorDimensions "version"
- productFlavors{ //产品变种
- demo{
- dimension "version"
- //applicationId后追加 .demo 也可以重新定义applicationId 属性
- applicationIdSuffix ".demo"
- versionNameSuffix "-demo"
- }
- full {
- dimension "version"
- applicationIdSuffix ".full"
- versionNameSuffix '-full'
- }
- }
- //变体过滤器
- variantFilter { variant ->
- def names = variant.flavors*.name
- if (name.contains("demo")){
- setIgnore(true)
- }
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = '1.8'
- }
- buildFeatures {
- viewBinding true
- }
- }
-
- dependencies {
-
- implementation 'androidx.core:core-ktx:1.3.2'
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'com.google.android.material:material:1.3.0'
- testImplementation 'junit:junit:4.+'
- androidTestImplementation 'androidx.test.ext:junit:1.1.2'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
- }
|