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

gradle-plugins.projects-version-catalog.0.1.0-rc.31.source-code.ProjectsVersionCatalogExtension.kt Maven / Gradle / Ivy

There is a newer version: 0.1.0-rc.45
Show newest version
package com.javiersc.gradle.plugins.projects.version.catalog

import com.javiersc.gradle.plugins.projects.version.catalog.internal.PropertyDefaultValue
import org.gradle.api.Project
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.getByType

interface ProjectsVersionCatalogExtension {
    val librariesPrefix: Property
    val projects: ListProperty
    val tomlPath: Property
    val removeVersionAliasPrefix: Property
}

internal fun Project.createProjectsVersionCatalogExtension(): ProjectsVersionCatalogExtension =
    extensions.create("projectsVersionCatalog")

internal val Project.projectsVersionCatalogExtension: ProjectsVersionCatalogExtension
    get() = extensions.getByType()

internal fun Project.configureProjectsVersionCatalogExtension() {
    projectsVersionCatalogExtension.apply {
        tomlPath.convention(PropertyDefaultValue.tomlPath(project))
        rootProject.gradle.projectsEvaluated {
            projects.convention(PropertyDefaultValue.projects(project))
        }
        librariesPrefix.convention(PropertyDefaultValue.librariesPrefix)
        removeVersionAliasPrefix.convention(PropertyDefaultValue.removeVersionAliasPrefix)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy