diff --git a/README.md b/README.md index f3420ca..0730aa3 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The Metaborg Gradle convention and development plugins, and the Metaborg depende | `org.metaborg.convention.java` | [![Release][mvn-rel-badge:convention.java]][mvn:convention.java] | [![Snapshot][mvn-snap-badge:convention.java]][mvn:convention.java] | | `org.metaborg.convention.maven-publish` | [![Release][mvn-rel-badge:convention.maven-publish]][mvn:convention.maven-publish] | [![Snapshot][mvn-snap-badge:convention.maven-publish]][mvn:convention.maven-publish] | | `org.metaborg.convention.root-project` | [![Release][mvn-rel-badge:convention.root-project]][mvn:convention.root-project] | [![Snapshot][mvn-snap-badge:convention.root-project]][mvn:convention.root-project] | +| `org.metaborg.devenv.root ` | [![Release][mvn-rel-badge:devenv.root]][mvn:devenv.root] | [![Snapshot][mvn-snap-badge:devenv.root]][mvn:devenv.root] | | Artifact | Latest Release | Latest Snapshot | |----------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------| @@ -32,6 +33,12 @@ The `org.metaborg.convention` plugins applies any conventional configuration to - `org.metaborg.convention.root-project`: Configures the root project of a Gradle multi-project build. +## Gradle Devenv +The `org.metaborg.devenv` plugins are used to configure the development environment for Spoofax projects. It has the following plugins: + +- `org.metaborg.devenv.root`: Configures the root project of a Gradle multi-project build for development. + + ## Gradle Dependency Management The `org.metaborg:catalog` artifact provides recommended versions for dependencies, and should be used in projects that are part of Spoofax. @@ -63,6 +70,7 @@ Unless required by applicable law or agreed to in writing, software distributed [mvn:convention.java]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.java~org.metaborg.convention.java.gradle.plugin~~~ [mvn:convention.maven-publish]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.maven-publish~org.metaborg.convention.maven-publish.gradle.plugin~~~ [mvn:convention.root-project]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.root-project~org.metaborg.convention.root-project.gradle.plugin~~~ +[mvn:devenv.root]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.devenv.root~org.metaborg.devenv.root.gradle.plugin~~~ [mvn:catalog]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~catalog~~~ [mvn:platform]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~platform~~~ [mvn:platform-latest]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~platform-latest~~~ @@ -72,6 +80,7 @@ Unless required by applicable law or agreed to in writing, software distributed [mvn-rel-badge:convention.java]: https://img.shields.io/nexus/r/org.metaborg.convention.java/org.metaborg.convention.java.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-rel-badge:convention.maven-publish]: https://img.shields.io/nexus/r/org.metaborg.convention.maven-publish/org.metaborg.convention.maven-publish.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-rel-badge:convention.root-project]: https://img.shields.io/nexus/r/org.metaborg.convention.root-project/org.metaborg.convention.root-project.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-rel-badge:devenv.root]: https://img.shields.io/nexus/r/org.metaborg.devenv.root/org.metaborg.devenv.root.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-rel-badge:catalog]: https://img.shields.io/nexus/r/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-rel-badge:platform]: https://img.shields.io/nexus/r/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-rel-badge:platform-latest]: https://img.shields.io/nexus/r/org.metaborg/platform-latest?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @@ -81,6 +90,7 @@ Unless required by applicable law or agreed to in writing, software distributed [mvn-snap-badge:convention.java]: https://img.shields.io/nexus/s/org.metaborg.convention.java/org.metaborg.convention.java.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:convention.maven-publish]: https://img.shields.io/nexus/s/org.metaborg.convention.maven-publish/org.metaborg.convention.maven-publish.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:convention.root-project]: https://img.shields.io/nexus/s/org.metaborg.convention.root-project/org.metaborg.convention.root-project.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:devenv.root]: https://img.shields.io/nexus/s/org.metaborg.devenv.root/org.metaborg.devenv.root.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:platform-latest]: https://img.shields.io/nexus/s/org.metaborg/platform-latest?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 diff --git a/devenv-plugin/build.gradle.kts b/devenv-plugin/build.gradle.kts new file mode 100644 index 0000000..77fed78 --- /dev/null +++ b/devenv-plugin/build.gradle.kts @@ -0,0 +1,53 @@ +import org.metaborg.convention.Developer + +plugins { + `java-library` + id("org.metaborg.convention.java") + id("org.metaborg.convention.junit") + id("org.metaborg.convention.maven-publish") + `kotlin-dsl` + `java-gradle-plugin` + // We don't use the version catalog here, to avoid a bootstrapping problem. + id("org.metaborg.gitonium") version "1.7.1" +} + +version = gitonium.version +group = "org.metaborg" +description = "The Metaborg Gradle Devenv plugin." + +repositories { + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation(gradleApi()) + implementation(gradleKotlinDsl()) + + testImplementation("io.kotest:kotest-runner-junit5:5.8.1") + testImplementation("io.kotest:kotest-assertions-core:5.8.1") + testImplementation(gradleTestKit()) +} + +gradlePlugin { + plugins { + create("devenv.root") { + id = "org.metaborg.devenv.root" + implementationClass = "org.metaborg.devenv.DevenvRootPlugin" + } + } +} + +// Required, either here or on the root project +mavenPublishConvention { + repoOwner.set("metaborg") + repoName.set("metaborg-gradle") + + metadata { + inceptionYear.set("2018") + developers.set(listOf( + Developer("gohla", "Gabriel Konat", "g.d.p.konat@tudelft.nl"), + Developer("virtlink", "Daniel A. A. Pelsmaeker", "d.a.a.pelsmaeker@tudelft.nl"), + )) + } +} diff --git a/devenv-plugin/settings.gradle.kts b/devenv-plugin/settings.gradle.kts new file mode 100644 index 0000000..ffd71e8 --- /dev/null +++ b/devenv-plugin/settings.gradle.kts @@ -0,0 +1,22 @@ +rootProject.name = "devenv-plugin" + +dependencyResolutionManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + mavenCentral() + } +} + +pluginManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + gradlePluginPortal() + } + + includeBuild("../convention-plugin") + includeBuild("../depman") +} + +plugins { + id("org.metaborg.convention.settings") +} \ No newline at end of file diff --git a/devenv-plugin/src/main/kotlin/org/metaborg/devenv/DevenvRootPlugin.kt b/devenv-plugin/src/main/kotlin/org/metaborg/devenv/DevenvRootPlugin.kt new file mode 100644 index 0000000..d4bb602 --- /dev/null +++ b/devenv-plugin/src/main/kotlin/org/metaborg/devenv/DevenvRootPlugin.kt @@ -0,0 +1,15 @@ +package org.metaborg.devenv + +import org.gradle.api.Plugin +import org.gradle.api.Project + +/** + * Special plugin for managing the development environment, such as checking out the correct repositories + * on their correct branches. + */ +@Suppress("unused") +class DevenvRootPlugin: Plugin { + override fun apply(target: Project) { + TODO("Not yet implemented") + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 94e472e..483f202 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,5 +19,6 @@ plugins { } includeBuild("convention-plugin/") +includeBuild("devenv-plugin/") includeBuild("depman/") includeBuild("example/")