com.javiersc.hubdle.project.extensions._internal.kotlinSrcSets.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hubdle-gradle-plugin Show documentation
Show all versions of hubdle-gradle-plugin Show documentation
Single entry point to configurate any kind of project
package com.javiersc.hubdle.project.extensions._internal
import org.gradle.api.NamedDomainObjectSet
import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType
import org.gradle.kotlin.dsl.the
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
internal val Project.kotlinSourceSetMainOrCommonMain: NamedDomainObjectSet
get() =
the().sourceSets.named { name ->
name == "main" || name == "commonMain"
}
internal val Project.kotlinSourceSetMainOrCommonMainOrNull: NamedDomainObjectSet?
get() =
extensions.findByType()?.sourceSets?.named { name ->
name == "main" || name == "commonMain"
}
internal val Project.kotlinSourceSetTestOrCommonTest: NamedDomainObjectSet
get() =
the().sourceSets.named { name ->
name == "test" || name == "commonTest"
}
internal val Project.kotlinSourceSetTestOrCommonTestOrNull: NamedDomainObjectSet?
get() =
extensions.findByType()?.sourceSets?.named { name ->
name == "test" || name == "commonTest"
}