Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
description:升级gradle和插件至as4.0匹配的版本,加快构建速度,合并lib_config和module_config,整理version.gradle
- Loading branch information
Showing
28 changed files
with
210 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
//除app外的所有组件的公有配置(包括lib和业务模块) | ||
//如需要配置app,请前往app模块 | ||
|
||
if (isSingleModuleDebug.toBoolean()) { | ||
apply plugin: 'com.android.application' | ||
} else { | ||
apply plugin: 'com.android.library' | ||
} | ||
|
||
apply plugin: 'kotlin-android' | ||
|
||
apply plugin: 'kotlin-android-extensions' | ||
|
||
apply plugin: 'kotlin-kapt' | ||
|
||
android { | ||
compileSdkVersion build_versions.compile_sdk | ||
buildToolsVersion build_versions.build_tools | ||
|
||
defaultConfig { | ||
minSdkVersion build_versions.min_sdk | ||
targetSdkVersion build_versions.target_sdk | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
|
||
kapt { | ||
//Arouter | ||
arguments { | ||
arg("AROUTER_MODULE_NAME", project.getName()) | ||
} | ||
} | ||
|
||
multiDexEnabled true | ||
} | ||
//module模块独有配置 | ||
modulesConfiguration(project) { | ||
resourcePrefix "${project.getName().replaceAll("module_", "")}_" | ||
sourceSets { | ||
main { | ||
//debug时能独立执行Main模块的配置 | ||
if (isSingleModuleDebug.toBoolean()) { | ||
manifest.srcFile 'src/main/module/AndroidManifest.xml' | ||
} else { | ||
manifest.srcFile 'src/main/AndroidManifest.xml' | ||
java { | ||
exclude 'debug/**' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
//lib模块独有配置 | ||
libsConfiguration(project) { | ||
resourcePrefix "${project.getName().replaceAll("lib_", "")}_" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
dataBinding { | ||
enabled = true | ||
} | ||
} | ||
|
||
//lib模块独有配置 | ||
static def libsConfiguration(Project project, Closure closure) { | ||
if (project.name.matches("lib_.+")) | ||
closure() | ||
} | ||
//module模块独有配置 | ||
static def modulesConfiguration(Project project, Closure closure) { | ||
if (project.name.matches("module_.+")) | ||
closure() | ||
} | ||
|
||
// 需要直接依赖到每个模块的,kapt必须写到这里 | ||
// 如果确认始终只有一个模块会用,可以添加到模块自身的build.gradle | ||
dependencies { | ||
if (project.name != "lib_common") | ||
implementation project(':lib_common') | ||
kapt deps.arouter.compiler | ||
kapt deps.room.compiler | ||
kapt deps.lifecycle.compiler | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule lib_common
updated
8 files
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule module_course
updated
8 files
Submodule module_discover
updated
18 files
Submodule module_main
updated
5 files
Submodule module_mine
updated
2 files
+3 −3 | build.gradle | |
+11 −9 | src/main/java/com/mredrock/cyxbs/mine/page/edit/EditInfoActivity.kt |
Submodule module_othercourse
updated
26 files
Submodule module_qa
updated
74 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.