From 331891b0d73e8aaca4c216ff0747afa82abe4153 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 25 Apr 2019 21:53:58 +0300 Subject: [PATCH] Pill: Fix getSerializedCompilerArguments() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is an other method that starts with 'getSerializedCompilerArguments' – serializedCompilerArgumentsIgnoreClasspathIssues(). Fix the clash by exact matching: the getSerializedCompilerArguments() is not internal anyway. --- buildSrc/src/main/kotlin/pill/parser.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/pill/parser.kt b/buildSrc/src/main/kotlin/pill/parser.kt index 20afdfaa63e..104cea79733 100644 --- a/buildSrc/src/main/kotlin/pill/parser.kt +++ b/buildSrc/src/main/kotlin/pill/parser.kt @@ -317,7 +317,12 @@ private val SourceSet.isTestSourceSet: Boolean || name.endsWith("Tests") private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions? { - val compileArguments = kotlinCompileTask.invokeInternal("getSerializedCompilerArguments") as List + val compileArguments = run { + val method = kotlinCompileTask::class.java.getMethod("getSerializedCompilerArguments") + method.isAccessible = true + method.invoke(kotlinCompileTask) as List + } + fun parseBoolean(name: String) = compileArguments.contains("-$name") fun parseString(name: String) = compileArguments.dropWhile { it != "-$name" }.drop(1).firstOrNull()