Skip to content

Commit

Permalink
Create initial Devenv plugin project
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 23, 2024
1 parent 80d078c commit d21ac0b
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|----------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------|
Expand All @@ -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.

Expand Down Expand Up @@ -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~~~
Expand All @@ -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
Expand All @@ -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
Expand Down
53 changes: 53 additions & 0 deletions devenv-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"),
))
}
}
22 changes: 22 additions & 0 deletions devenv-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Original file line number Diff line number Diff line change
@@ -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<Project> {
override fun apply(target: Project) {
TODO("Not yet implemented")
}
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ plugins {
}

includeBuild("convention-plugin/")
includeBuild("devenv-plugin/")
includeBuild("depman/")
includeBuild("example/")

0 comments on commit d21ac0b

Please sign in to comment.