[Minor] Add defaults to buildProject functions
This commit is contained in:
committed by
Space
parent
03dab74d47
commit
e1e0b76376
+4
-5
@@ -15,8 +15,8 @@ import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.KotlinPm20ProjectExtension
|
||||
|
||||
fun buildProject(
|
||||
configBuilder: ProjectBuilder.() -> Unit = { Unit },
|
||||
configProject: Project.() -> Unit
|
||||
configBuilder: ProjectBuilder.() -> Unit = { },
|
||||
configProject: Project.() -> Unit = {},
|
||||
): ProjectInternal = ProjectBuilder
|
||||
.builder()
|
||||
.apply(configBuilder)
|
||||
@@ -26,17 +26,16 @@ fun buildProject(
|
||||
.apply(configProject)
|
||||
.let { it as ProjectInternal }
|
||||
|
||||
fun buildProjectWithMPP(code: Project.() -> Unit) = buildProject {
|
||||
fun buildProjectWithMPP(code: Project.() -> Unit = {}) = buildProject {
|
||||
project.plugins.apply("kotlin-multiplatform")
|
||||
code()
|
||||
}
|
||||
|
||||
fun buildProjectWithKPM(code: Project.() -> Unit) = buildProject {
|
||||
fun buildProjectWithKPM(code: Project.() -> Unit= {}) = buildProject {
|
||||
project.plugins.apply("org.jetbrains.kotlin.multiplatform.pm20")
|
||||
code()
|
||||
}
|
||||
|
||||
|
||||
fun Project.kotlin(code: KotlinMultiplatformExtension.() -> Unit) {
|
||||
val kotlin = project.kotlinExtension as KotlinMultiplatformExtension
|
||||
kotlin.code()
|
||||
|
||||
Reference in New Issue
Block a user