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

com.javiersc.hubdle.project.extensions.kotlin.shared.HubdleKotlinSourceSetConfigurableExtension.kt Maven / Gradle / Ivy

There is a newer version: 0.7.18
Show newest version
package com.javiersc.hubdle.project.extensions.kotlin.shared

import com.javiersc.hubdle.project.extensions._internal.MAIN
import com.javiersc.hubdle.project.extensions._internal.TEST
import com.javiersc.hubdle.project.extensions._internal.TEST_FIXTURES
import com.javiersc.hubdle.project.extensions._internal.TEST_FUNCTIONAL
import com.javiersc.hubdle.project.extensions._internal.TEST_INTEGRATION
import com.javiersc.hubdle.project.extensions.apis.HubdleSourceSetConfigurableExtension
import com.javiersc.hubdle.project.extensions.kotlin.shared.asString as originalAsString
import com.javiersc.hubdle.project.extensions.kotlin.shared.moduleAsString as originalModuleAsString
import com.javiersc.hubdle.project.extensions.kotlin.shared.versionAsString as originalVersionAsString
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.Project
import org.gradle.api.artifacts.MinimalExternalModuleDependency
import org.gradle.api.provider.Provider
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet

public abstract class HubdleKotlinSourceSetConfigurableExtension(project: Project) :
    HubdleSourceSetConfigurableExtension(project) {

    override val main: NamedDomainObjectProvider
        get() {
            the().sourceSets.maybeCreate(calculateName(MAIN))
            return the().sourceSets.named(calculateName(MAIN))
        }

    override val test: NamedDomainObjectProvider
        get() {
            the().sourceSets.maybeCreate(calculateName(TEST))
            return the().sourceSets.named(calculateName(TEST))
        }

    override val testFunctional: NamedDomainObjectProvider
        get() {
            the().sourceSets.maybeCreate(calculateName(TEST_FUNCTIONAL))
            return the().sourceSets.named(calculateName(TEST_FUNCTIONAL))
        }

    override val testIntegration: NamedDomainObjectProvider
        get() {
            the().sourceSets.maybeCreate(calculateName(TEST_INTEGRATION))
            return the().sourceSets.named(calculateName(TEST_INTEGRATION))
        }

    override val testFixtures: NamedDomainObjectProvider
        get() {
            the().sourceSets.maybeCreate(calculateName(TEST_FIXTURES))
            return the().sourceSets.named(calculateName(TEST_FIXTURES))
        }

    public fun Provider.asString(): String = originalAsString()

    public fun Provider.moduleAsString(): String =
        originalModuleAsString()

    public fun Provider.versionAsString(): String? =
        originalVersionAsString()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy