Fix reflection-based operations on compiler arguments after conversion

This commit is contained in:
Alexey Sedunov
2017-07-27 15:20:57 +03:00
parent 50599c933f
commit 2984a5a19f
10 changed files with 162 additions and 95 deletions
@@ -24,6 +24,7 @@ import java.io.PrintStream
import kotlin.reflect.KAnnotatedElement
import kotlin.reflect.KProperty1
import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.full.withNullability
// Additional properties that should be included in interface
@Suppress("unused")
@@ -271,7 +272,8 @@ private val KProperty1<*, *>.gradleDefaultValue: String
private val KProperty1<*, *>.gradleReturnType: String
get() {
var type = returnType.toString().substringBeforeLast("!")
// Set nullability based on Gradle default value
var type = returnType.withNullability(false).toString().substringBeforeLast("!")
if (gradleDefaultValue == "null") {
type += "?"
}