plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } def androidConfig = rootProject.ext.android android { compileSdk androidConfig.compile_sdk_version buildToolsVersion androidConfig.build_tools_version defaultConfig { applicationId androidConfig.applicationId minSdk androidConfig.min_sdk_version targetSdk androidConfig.target_sdk_version versionCode androidConfig.version_code versionName androidConfig.version_name 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 { coreLibraryDesugaringEnabled true //为了使用jdk8的脱糖属性 sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } buildFeatures { viewBinding true dataBinding true } sourceSets { main { res.srcDirs("svg") } } } dependencies { implementation fileTree(include: ['*.jar',"*.aar"], dir: 'libs') // implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation project(path: ':lib:common') // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1' // implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' // implementation 'androidx.appcompat:appcompat:1.2.0' // implementation 'com.google.android.material:material:1.3.0' // implementation 'androidx.constraintlayout:constraintlayout:2.0.4' // implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' // implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' rootProject.ext.dependencies_required.each{ k, v -> implementation v} testImplementation rootProject.ext.dependencies_testImplementation.junit rootProject.ext.dependencies_androidTestImplementation.each{ k,v -> androidTestImplementation v} def customDependencies = rootProject.ext.dependencies_custom //SmartRefreshLayout implementation customDependencies.SmartRefreshLayout implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头 //SqlCipher implementation customDependencies.SqlCipher //androidx-sqlite implementation customDependencies.Sqlite //Lottie implementation customDependencies.Lottie coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' }