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()