Import kotlin.coroutines property from gradle to facet

This commit is contained in:
Mikhail Zarechenskiy
2016-12-15 12:31:26 +03:00
committed by Stanislav Erokhin
parent f19581dc4d
commit 2ff04f2bc5
4 changed files with 27 additions and 9 deletions
@@ -65,9 +65,9 @@ enum class CoroutineSupport(
override val description: String,
val compilerArgument: String
) : DescriptionAware {
ENABLED("Enabled", "enabled"),
ENABLED_WITH_WARNING("Enabled with warning", "warning"),
DISABLED("Disabled", "disabled");
ENABLED("Enabled", "enable"),
ENABLED_WITH_WARNING("Enabled with warning", "warn"),
DISABLED("Disabled", "error");
companion object {
val DEFAULT = ENABLED_WITH_WARNING
@@ -79,6 +79,10 @@ enum class CoroutineSupport(
arguments.coroutinesError -> DISABLED
else -> DEFAULT
}
fun byCompilerArgument(argument: String): CoroutineSupport {
return CoroutineSupport.values().find { it.compilerArgument == argument } ?: DEFAULT
}
}
}