将所有模块支持Kotlin,解决ARout加载异常问题

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-21 18:28:01 +08:00
parent 05d917d805
commit 483b7c694d
42 changed files with 416 additions and 300 deletions

View File

@@ -1,7 +1,10 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'com.alibaba.arouter'
}
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -12,14 +15,15 @@ android {
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
//ARouter apt 参数
kapt {
useBuildCache = false
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
}
buildTypes {
@@ -44,9 +48,11 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.material
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.androidxrecyclerview
if (Boolean.valueOf(RELEASE)) {

View File

@@ -34,17 +34,6 @@ public class InternalFunctionLauncher extends BaseAppLauncher {
@Override
public void launch( Context context, AppInfo appInfo ) {
switch ( appInfo.getPackageName() ) {
case "com.autonavi.amapauto":
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
try {
launch( context, AppEnum.AUTO_NAVI.getPkg() );
} catch ( Exception e ) {
e.printStackTrace();
}
} else {
AppServiceHandler.getApis().getSearchManagerApi().showSearch();
}
break;
case "com.mogo.launcher.applist":
AppsListActivity.start( mContext );
break;