Fix subplugin options for K/N

This commit is contained in:
Ilya Matveev
2019-02-12 18:50:11 +03:00
parent 2678ada5ae
commit 7c3c21790b
2 changed files with 3 additions and 3 deletions
@@ -397,7 +397,7 @@ open class KotlinNativeTargetConfigurator(
private fun AbstractKotlinNativeCompile.addCompilerPlugins() { private fun AbstractKotlinNativeCompile.addCompilerPlugins() {
SubpluginEnvironment SubpluginEnvironment
.loadSubplugins(project, kotlinPluginVersion) .loadSubplugins(project, kotlinPluginVersion)
.addSubpluginOptions<CommonCompilerArguments>(project, this, compilerPluginOptions) .addSubpluginOptions(project, this, compilerPluginOptions)
compilerPluginClasspath = project.configurations.getByName(NATIVE_COMPILER_PLUGIN_CLASSPATH_CONFIGURATION_NAME) compilerPluginClasspath = project.configurations.getByName(NATIVE_COMPILER_PLUGIN_CLASSPATH_CONFIGURATION_NAME)
} }
@@ -58,7 +58,7 @@ class SubpluginEnvironment(
kotlinCompilation kotlinCompilation
) )
fun <C : CommonCompilerArguments> addSubpluginOptions( fun addSubpluginOptions(
project: Project, project: Project,
kotlinTask: AbstractCompile, kotlinTask: AbstractCompile,
pluginOptions: CompilerPluginOptions, pluginOptions: CompilerPluginOptions,
@@ -66,7 +66,7 @@ class SubpluginEnvironment(
variantData: Any? = null, variantData: Any? = null,
androidProjectHandler: AbstractAndroidProjectHandler<out Any?>? = null, androidProjectHandler: AbstractAndroidProjectHandler<out Any?>? = null,
kotlinCompilation: KotlinCompilation<*>? = null kotlinCompilation: KotlinCompilation<*>? = null
): List<KotlinGradleSubplugin<AbstractKotlinCompile<C>>> { ): List<KotlinGradleSubplugin<AbstractCompile>> {
val appliedSubplugins = subplugins.filter { it.isApplicable(project, kotlinTask) } val appliedSubplugins = subplugins.filter { it.isApplicable(project, kotlinTask) }
for (subplugin in appliedSubplugins) { for (subplugin in appliedSubplugins) {
if (!subplugin.isApplicable(project, kotlinTask)) continue if (!subplugin.isApplicable(project, kotlinTask)) continue