Remove project extension and replace library loading by extensions helpers.

This commit is contained in:
Alexander Nozik 2019-12-17 16:51:32 +03:00
parent 8145386650
commit c700515d3f

View File

@ -46,12 +46,15 @@ internal fun Project.useDependency(vararg pairs: Pair<String, String>) {
} }
fun Project.useSerialization(version: String = Scientifik.serializationVersion) = useDependency( fun Project.useSerialization(version: String = Scientifik.serializationVersion) {
"commonMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$version", plugins.apply("org.jetbrains.kotlin.plugin.serialization")
"jvmMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$version", useDependency(
"jsMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$version", "commonMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$version",
"nativeMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$version" "jvmMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$version",
) "jsMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$version",
"nativeMain" to "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$version"
)
}
fun Project.useCoroutines(version: String = Scientifik.coroutinesVersion) = useDependency( fun Project.useCoroutines(version: String = Scientifik.coroutinesVersion) = useDependency(
"commonMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$version", "commonMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$version",
@ -59,3 +62,13 @@ fun Project.useCoroutines(version: String = Scientifik.coroutinesVersion) = useD
"jsMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$version", "jsMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$version",
"nativeMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version" "nativeMain" to "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version"
) )
//fun Project.useAtomic(version: String = Scientifik.atomicfuVersion) {
// plugins.apply("kotlinx-atomicfu")
// useDependency(
// "commonMain" to "org.jetbrains.kotlinx:atomicfu-common:$version",
// "jvmMain" to "org.jetbrains.kotlinx:atomicfu:$version",
// "jsMain" to "org.jetbrains.kotlinx:atomicfu-js:$version",
// "nativeMain" to "org.jetbrains.kotlinx:atomicfu-native:$version"
// )
//}