apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'resTools' // 资源重命名插件 apply plugin: 'com.jakewharton.butterknife' // 配置资源重命名插件 resConfig { new_prefix = 'dynamic_' // 资源前缀 old_prefix = '' // 老前缀,可为''空字符串 } kapt { arguments { arg("AROUTER_MODULE_NAME", "dynamic") } } android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: "dynamic"] } } flavorDimensions "versionCode"//Flavor 维度信息 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } //前缀的名字 //resourcePrefix "dynamic_" //Flavor 信息 publishNonDefault true productFlavors { ydl {} xlzx {} } sourceSets { main { manifest.srcFile 'src/main/AndroidManifest.xml' res.srcDirs = [ 'src/main/res' ] } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } packagingOptions { exclude 'META-INF/rxjava.properties' } } dependencies { api fileTree(dir: 'libs', include: ['*.aar','*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' kapt 'com.alibaba:arouter-compiler:1.2.2' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0' implementation 'com.pnikosis:materialish-progress:1.7' implementation 'com.daimajia.numberprogressbar:library:1.4@aar' implementation 'com.github.faruktoptas:FancyShowCaseView:0.1.1' kapt rootProject.ext.dependencies["butterknife-compiler"] api rootProject.ext.dependencies["butterknife"] api rootProject.ext.dependencies["ydl-user-router"] if (rootProject.ext.dev_mode){ //开发时使用 api project(':ydl-webview') api project(':ydl-platform') api project(":ydl-pay") implementation modularPublication('com.ydl:m-im-api') implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-dynamic-api') implementation modularPublication('com.ydl:m-tests-api') implementation modularPublication('com.ydl:m-course-api') implementation modularPublication('com.ydl:m-fm-api') implementation modularPublication('com.ydl:m-consultant-api') implementation modularPublication('com.ydl:m-confide-api') }else { //发布时使用 api rootProject.ext.dependencies["ydl-pay"] compileOnly rootProject.ext.dependencies["ydl-m-im-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"] compileOnly rootProject.ext.dependencies["ydl-m-tests-api"] compileOnly rootProject.ext.dependencies["ydl-m-course-api"] compileOnly rootProject.ext.dependencies["ydl-m-fm-api"] compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"] compileOnly rootProject.ext.dependencies["ydl-m-confide-api"] api rootProject.ext.dependencies["ydl-webview"] api(rootProject.ext.dependencies["ydl-platform"]) { transitive = true } } }