All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javiersc.hubdle.project.extensions._internal.kotlinSrcSets.kt Maven / Gradle / Ivy

There is a newer version: 0.7.18
Show newest version
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"
        }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy