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 multiDexEnabled true //解决64k 分包限制 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" //java环境roomSchemaLocation配置 // javaCompileOptions { // annotationProcessorOptions { // arguments = [ // "room.schemaLocation" : "$projectDir/schemas".toString(), // "room.incremental" : "true", // "room.expandProjection" :"true" // ] // } // } //Kotlin环境RoomSchemaLocation配置 kapt{ arguments{ arg("room.schemaLocation","$projectDir/schemas") } } } /*构建类型: 定义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 project(path: ':videoplayer') 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.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' //Gson implementation customDependencies.Gson //protobuf implementation customDependencies.protobuf_java implementation customDependencies.protobuf_java_format //grpc implementation customDependencies.annotation_api implementation customDependencies.grpc_okhttp implementation customDependencies.grpc_android implementation customDependencies.grpc_protobuf implementation customDependencies.grpc_stub //XPopup implementation customDependencies.XPopup implementation customDependencies.XPopupExt //精美日历 calendarview implementation customDependencies.CalendarView // FlexBoxLayoutManager implementation customDependencies.FlexBoxLayoutManager //图标 implementation customDependencies.Chart //Room implementation customDependencies.Room_Runtime kapt customDependencies.Room_Compiler //Paging // implementation customDependencies.Paging //Room_Paging // implementation(customDependencies.Room_Paging){ // force = true // } // implementation "me.zhanghai.android.materialratingbar:library:1.4.0" implementation 'com.xl.ratingbar:ratingbar:0.1.1' }