com.javiersc.hubdle.project.extensions.kotlin.shared.HubdleKotlinSourceSetConfigurableExtension.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.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()
}