Hide commonizer import error message for unsupported kotlin plugin.
This commit is contained in:
@@ -30,7 +30,12 @@ class KotlinCommonizerModelBuilder : AbstractModelBuilderService() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val classLoader = kotlinExt.javaClass.classLoader
|
val classLoader = kotlinExt.javaClass.classLoader
|
||||||
val clazz = Class.forName(COMMONIZER_SETUP_CLASS, false, classLoader)
|
val clazz = try {
|
||||||
|
Class.forName(COMMONIZER_SETUP_CLASS, false, classLoader)
|
||||||
|
} catch (e: ClassNotFoundException) {
|
||||||
|
//It can be old version mpp gradle plugin. Supported only 1.4+
|
||||||
|
return null
|
||||||
|
}
|
||||||
val isAllowCommonizerFun = clazz.getMethodOrNull("isAllowCommonizer", Project::class.java) ?: return null
|
val isAllowCommonizerFun = clazz.getMethodOrNull("isAllowCommonizer", Project::class.java) ?: return null
|
||||||
|
|
||||||
val isAllowCommonizer = isAllowCommonizerFun.invoke(Boolean::class.java, project) as Boolean
|
val isAllowCommonizer = isAllowCommonizerFun.invoke(Boolean::class.java, project) as Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user