Don't use addIfNotNull core util in the JS Gradle plugin
The function was placed in a package whose another top-level function used coroutines. This led to a NCDFE kotlin.coroutines.Continuation with Gradle versions that bundle Kotlin pre-1.3 stdlib. Instead, use the existing util function `lowerCamelCaseName` which also filters nulls.
This commit is contained in:
+3
-15
@@ -19,7 +19,7 @@ import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
||||
import org.jetbrains.kotlin.gradle.tasks.createOrRegisterTask
|
||||
import org.jetbrains.kotlin.gradle.testing.internal.configureConventions
|
||||
import org.jetbrains.kotlin.gradle.testing.internal.kotlinTestRegistry
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||
|
||||
abstract class KotlinJsSubTarget(
|
||||
val target: KotlinJsTarget,
|
||||
@@ -43,20 +43,8 @@ abstract class KotlinJsSubTarget(
|
||||
}
|
||||
}
|
||||
|
||||
private fun disambiguate(name: String): MutableList<String> {
|
||||
val components = mutableListOf<String>()
|
||||
|
||||
components.addIfNotNull(target.disambiguationClassifier)
|
||||
components.add(disambiguationClassifier)
|
||||
components.add(name)
|
||||
return components
|
||||
}
|
||||
|
||||
protected fun disambiguateCamelCased(name: String): String {
|
||||
val components = disambiguate(name)
|
||||
|
||||
return components.first() + components.drop(1).joinToString("") { it.capitalize() }
|
||||
}
|
||||
protected fun disambiguateCamelCased(name: String): String =
|
||||
lowerCamelCaseName(target.disambiguationClassifier, disambiguationClassifier, name)
|
||||
|
||||
private fun configureTests() {
|
||||
target.compilations.all { compilation ->
|
||||
|
||||
Reference in New Issue
Block a user