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

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

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

import com.codingfeline.buildkonfig.gradle.BuildKonfigExtension
import com.javiersc.hubdle.project.extensions.HubdleDslMarker
import com.javiersc.hubdle.project.extensions._internal.ApplicablePlugin.Scope
import com.javiersc.hubdle.project.extensions._internal.fallbackAction
import com.javiersc.hubdle.project.extensions._internal.getHubdleExtension
import com.javiersc.hubdle.project.extensions.apis.BaseHubdleExtension
import com.javiersc.hubdle.project.extensions.apis.HubdleConfigurableExtension
import com.javiersc.hubdle.project.extensions.apis.HubdleEnableableExtension
import com.javiersc.hubdle.project.extensions.apis.enableAndExecute
import com.javiersc.hubdle.project.extensions.kotlin.hubdleKotlinAny
import com.javiersc.hubdle.project.extensions.shared.PluginId
import javax.inject.Inject
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.provider.Property

public open class HubdleKotlinBuildKonfigFeatureExtension @Inject constructor(project: Project) :
    HubdleConfigurableExtension(project) {

    override val isEnabled: Property = property { false }

    override val oneOfExtensions: Set
        get() = hubdleKotlinAny

    @HubdleDslMarker
    public fun buildkonfig(action: Action = Action {}): Unit =
        fallbackAction(action)

    override fun Project.defaultConfiguration() {
        applicablePlugin(scope = Scope.CurrentProject, pluginId = PluginId.CodingfelineBuildkonfig)
    }
}

public interface HubdleKotlinBuildKonfigDelegateFeatureExtension : BaseHubdleExtension {

    public val buildkonfig: HubdleKotlinBuildKonfigFeatureExtension
        get() = project.getHubdleExtension()

    @HubdleDslMarker
    public fun buildkonfig(action: Action = Action {}) {
        buildkonfig.enableAndExecute(action)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy