layers version-catalogs-builder
version-catalogs-builder-gradle-settings-plugin • v1.0.0

Version Catalog Builder Orchestration

A Gradle convention settings plugin for multi-project, composite, and multi-repo architectures. Automates workspace root discovery, catalog resolution, and tool build inclusion.

explore

Root Auto-Discovery

Discovers the true project/monorepo root through environment variables (GRADLE_DOCS_ROOT, WORKSPACE_ROOT) or upwards filesystem traversal for Gradle wrapper configurations.

dataset

Catalog Registration

Conveniently loads and registers Version Catalogs (e.g. libs, local, tools) into dependencyResolutionManagement with concise syntax.

hub

Tool Build Inclusion

Automatically includes convention plugins and tool builds into pluginManagement without brittle hardcoded relative paths.

terminal Setup & Application

Apply the plugin directly in your root or subproject settings.gradle.kts:

// settings.gradle.kts
plugins {
    id("dev.fnc314.gradle.plugins.settings.version-catalogs-builder-gradle-settings-plugin") version "1.0.0"
}

Or declare it within your gradle/libs.versions.toml:

[plugins]
version-catalogs-builder = { id = "dev.fnc314.gradle.plugins.settings.version-catalogs-builder-gradle-settings-plugin", version = "1.0.0" }

code DSL Configuration

// settings.gradle.kts
versionCatalogBuilder {
    // Optional override. Defaults to auto-discovery:
    // projectRoot.set(file("/path/to/root"))

    catalogs {
        // Abbreviated syntax: automatically maps to gradle/name.versions.toml
        register("libs")
        register("tools")

        // Long-form syntax: custom relative path from projectRoot
        register("local", "gradle/local.versions.toml")
        register("customCatalog", "config/catalogs/custom.versions.toml")
    }

    toolBuilds {
        // Includes composite builds relative to projectRoot
        include("gradle/tools/plugins-projects")
        include("gradle/tools/plugins-docs")
    }
}