From 6b68b7ffefdc318c79947bcdb88f3c5374785715 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 16:01:26 +0200 Subject: [PATCH 01/54] Support run. and test. properties --- .../convention/JavaConventionPlugin.kt | 36 +++++++++++++++++-- docs/content/conventions/java.md | 10 ++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/JavaConventionPlugin.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/JavaConventionPlugin.kt index 3a2729e..ba59ace 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/JavaConventionPlugin.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/JavaConventionPlugin.kt @@ -2,13 +2,16 @@ package org.metaborg.convention import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.plugins.ApplicationPlugin import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.javadoc.Javadoc import org.gradle.api.tasks.testing.Test import org.gradle.external.javadoc.CoreJavadocOptions import org.gradle.kotlin.dsl.* +import org.gradle.process.JavaForkOptions /** * Configures a Gradle project that builds a Java library or application. @@ -34,7 +37,7 @@ class JavaConventionPlugin: Plugin { withJavadocJar() } - tasks.withType { + tasks.withType().configureEach { // Use UTF-8 encoding by default options.encoding = "UTF-8" // Warn for unchecked casts @@ -47,7 +50,7 @@ class JavaConventionPlugin: Plugin { options.compilerArgs.add("-Xdoclint:none") } - tasks.withType { + tasks.withType().configureEach { options { this as CoreJavadocOptions // Use UTF-8 encoding by default @@ -61,6 +64,35 @@ class JavaConventionPlugin: Plugin { quiet() } } + + tasks.named(JavaPlugin.TEST_TASK_NAME) { + addPropertiesWithPrefix("test.", project) + } + } + + plugins.withType { + tasks.named(ApplicationPlugin.TASK_RUN_NAME) { + addPropertiesWithPrefix("run.", project) + } + } + } + + /** + * Adds all system properties and project properties that have the given [prefix] (case-insensitive) + * to the properties of the Java process (without the prefix). + * + * @param prefix The property prefix to look for. + * @param project The Gradle project. + */ + private fun JavaForkOptions.addPropertiesWithPrefix(prefix: String, project: Project) { + @Suppress("UNCHECKED_CAST") + for ((k, v) in System.getProperties() as Map) { + if (!k.startsWith(prefix, ignoreCase = true)) continue + systemProperty(k.substring(prefix.length), v.toString()) + } + for ((k, v) in project.properties) { + if (!k.startsWith(prefix, ignoreCase = true)) continue + systemProperty(k.substring(prefix.length), v.toString()) } } } diff --git a/docs/content/conventions/java.md b/docs/content/conventions/java.md index ee7eea0..e5e0185 100644 --- a/docs/content/conventions/java.md +++ b/docs/content/conventions/java.md @@ -2,9 +2,15 @@ title: "Java Convention" --- # Java Convention Plugin -The Java convention plugin configures a project to be built using Java 11 by default, but this can be overridden. +The Java convention plugin configures a project to: -To use the plugin, you need to apply both the Java convention plugin and one of the Java plugins (`java-library`, `java`): +- build using a Java 11 toolchain by default; +- silence JavaDoc warnings and errors as much as possible; +- use UTF-8 encoding; +- transfer properties prefixed with `app.` to the `run` task if the Java `application` plugin is applied; +- transfer properties prefixed with `test.` to the `test` task. + +To use the plugin, you need to apply both the Java convention plugin and one of the Java plugins (e.g., `java-library`, `java`): ```kotlin title="build.gradle.kts" plugins { From 34dcf17ca2ca98c8872d0a26c1c3f1ef5f08e606 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 17:00:19 +0200 Subject: [PATCH 02/54] Update Gitonium --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index e540df7..2f7aa62 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # Plugins kotlin = "1.8.20" # https://kotlinlang.org/ -gitonium = "1.7.2" # https://github.com/metaborg/gitonium +gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.0" # https://github.com/metaborg/gradle.config devenv-spoofax-gradle = "0.5.9" # https://github.com/metaborg/spoofax.gradle From 65bfcae9ff7a84c483fa71fe4f7ff847ca890f90 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 17:00:30 +0200 Subject: [PATCH 03/54] Update license info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3420ca..6970097 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For special use cases, the `org.metaborg:platform-latest` and `org.metaborg:plat ## License -Copyright 2024 Delft University of Technology +Copyright 2024 [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From 264c8cf1bf7be264fc559a2fd001783418bc2d35 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 17:04:52 +0200 Subject: [PATCH 04/54] Update dependencies and Guice --- depman/gradle/libs.versions.toml | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 2f7aa62..0c4aa55 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -3,30 +3,30 @@ kotlin = "1.8.20" # https://kotlinlang.org/ gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains -metaborg-gradle-config = "0.7.0" # https://github.com/metaborg/gradle.config +metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config devenv-spoofax-gradle = "0.5.9" # https://github.com/metaborg/spoofax.gradle -metaborg-gradle = "0.10.0" # https://github.com/metaborg/metaborg-gradle +metaborg-gradle = "0.11.1" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) # Spoofax -metaborg-common = "0.11.0" # https://github.com/metaborg/common/ +metaborg-common = "0.12.0" # https://github.com/metaborg/common/ metaborg-log = "0.5.5" # https://github.com/metaborg/log/ metaborg-pie = "0.21.0" # https://github.com/metaborg/pie/ metaborg-resource = "0.14.1" # https://github.com/metaborg/resource/ -spoofax3 = "0.22.1" # https://github.com/metaborg/spoofax-pie/ - -spoofax2 = "2.6.0-SNAPSHOT" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) -esv = "0.1.36" # https://github.com/metaborg/esv/ -jsglr = "0.1.36" # https://github.com/metaborg/jsglr/ -mb-exec = "0.1.36" # https://github.com/metaborg/mb-exec/ -mb-rep = "0.1.36" # https://github.com/metaborg/mb-rep/ -nabl = "0.1.36" # https://github.com/metaborg/nabl/ -sdf = "0.1.36" # https://github.com/metaborg/sdf/ -spoofax-core = "0.1.36" # https://github.com/metaborg/spoofax/ -spoofax-gradle = "0.1.36" # https://github.com/metaborg/spoofax.gradle/ -spt = "0.1.36" # https://github.com/metaborg/spt/ -stratego = "0.1.36" # https://github.com/metaborg/stratego/ -strategoxt = "0.1.36" # https://github.com/metaborg/strategoxt/ +spoofax3 = "0.23.1" # https://github.com/metaborg/spoofax-pie/ + +spoofax2 = "2.5.21" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) +esv = "0.1.37" # https://github.com/metaborg/esv/ +jsglr = "0.1.37" # https://github.com/metaborg/jsglr/ +mb-exec = "0.1.37" # https://github.com/metaborg/mb-exec/ +mb-rep = "0.1.37" # https://github.com/metaborg/mb-rep/ +nabl = "0.1.37" # https://github.com/metaborg/nabl/ +sdf = "0.1.37" # https://github.com/metaborg/sdf/ +spoofax-core = "0.1.37" # https://github.com/metaborg/spoofax/ +spoofax-gradle = "0.1.37" # https://github.com/metaborg/spoofax.gradle/ +spt = "0.1.37" # https://github.com/metaborg/spt/ +stratego = "0.1.37" # https://github.com/metaborg/stratego/ +strategoxt = "0.1.37" # https://github.com/metaborg/strategoxt/ # Kotlin @@ -34,7 +34,7 @@ kotlinx-coroutines = "1.8.1" # https://github.com # Collections capsule = "0.6.3" # https://usethesource.io/projects/capsule/ (https://github.com/usethesource/capsule) # Dependency Injection -guice = "5.1.0" # https://github.com/google/guice +guice = "7.0.0" # https://github.com/google/guice dagger = "2.36" # https://github.com/google/dagger # Annotations & Annotation Processors immutables = "2.10.1" # https://immutables.github.io/ (https://github.com/immutables/immutables) From 1923d22eb4c4b5c7cac18eacd471421517490da8 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 18:26:16 +0200 Subject: [PATCH 05/54] Update to releng 0.1.38 --- depman/gradle/libs.versions.toml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 0c4aa55..4602b15 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -16,17 +16,17 @@ metaborg-resource = "0.14.1" # https://github.com spoofax3 = "0.23.1" # https://github.com/metaborg/spoofax-pie/ spoofax2 = "2.5.21" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) -esv = "0.1.37" # https://github.com/metaborg/esv/ -jsglr = "0.1.37" # https://github.com/metaborg/jsglr/ -mb-exec = "0.1.37" # https://github.com/metaborg/mb-exec/ -mb-rep = "0.1.37" # https://github.com/metaborg/mb-rep/ -nabl = "0.1.37" # https://github.com/metaborg/nabl/ -sdf = "0.1.37" # https://github.com/metaborg/sdf/ -spoofax-core = "0.1.37" # https://github.com/metaborg/spoofax/ -spoofax-gradle = "0.1.37" # https://github.com/metaborg/spoofax.gradle/ -spt = "0.1.37" # https://github.com/metaborg/spt/ -stratego = "0.1.37" # https://github.com/metaborg/stratego/ -strategoxt = "0.1.37" # https://github.com/metaborg/strategoxt/ +esv = "0.1.38" # https://github.com/metaborg/esv/ +jsglr = "0.1.38" # https://github.com/metaborg/jsglr/ +mb-exec = "0.1.38" # https://github.com/metaborg/mb-exec/ +mb-rep = "0.1.38" # https://github.com/metaborg/mb-rep/ +nabl = "0.1.38" # https://github.com/metaborg/nabl/ +sdf = "0.1.38" # https://github.com/metaborg/sdf/ +spoofax-core = "0.1.38" # https://github.com/metaborg/spoofax/ +spoofax-gradle = "0.1.38" # https://github.com/metaborg/spoofax.gradle/ +spt = "0.1.38" # https://github.com/metaborg/spt/ +stratego = "0.1.38" # https://github.com/metaborg/stratego/ +strategoxt = "0.1.38" # https://github.com/metaborg/strategoxt/ # Kotlin From 86bb1ea2bdc47750a2866d3d30dcc7b91215acb8 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 21:04:44 +0200 Subject: [PATCH 06/54] Update spoofax.gradle --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 4602b15..8024dc5 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,7 +4,7 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -devenv-spoofax-gradle = "0.5.9" # https://github.com/metaborg/spoofax.gradle +devenv-spoofax-gradle = "0.6.1" # https://github.com/metaborg/spoofax.gradle metaborg-gradle = "0.11.1" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) From 7322f43da26789c95de991878179a9d10efeacbb Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 22:07:17 +0200 Subject: [PATCH 07/54] Define Spoofax dep versions only in platform --- depman/gradle.properties | 36 +++ depman/gradle/libs.versions.toml | 445 +++++++++++++++---------------- depman/platform/build.gradle.kts | 442 +++++++++++++++--------------- docs/content/index.md | 15 ++ 4 files changed, 495 insertions(+), 443 deletions(-) create mode 100644 depman/gradle.properties diff --git a/depman/gradle.properties b/depman/gradle.properties new file mode 100644 index 0000000..9bdc4bc --- /dev/null +++ b/depman/gradle.properties @@ -0,0 +1,36 @@ +# Versions of the Metaborg/Spoofax libraries/languages that are known to work together + +# https://github.com/metaborg/common/ +metaborg-common.version=0.12.0 +# https://github.com/metaborg/log/ +metaborg-log.version=0.5.5 +# https://github.com/metaborg/pie/ +metaborg-pie.version=0.21.0 +# https://github.com/metaborg/resource/ +metaborg-resource.version=0.14.1 +# https://github.com/metaborg/spoofax-pie/ +spoofax3.version=0.23.1 +# https://github.com/metaborg/spoofax-releng +spoofax2.version=2.5.21 +# https://github.com/metaborg/esv/ +esv.version=0.1.38 +# https://github.com/metaborg/jsglr/ +jsglr.version=0.1.38 +# https://github.com/metaborg/mb-exec/ +mb-exec.version=0.1.38 +# https://github.com/metaborg/mb-rep/ +mb-rep.version=0.1.38 +# https://github.com/metaborg/nabl/ +nabl.version=0.1.38 +# https://github.com/metaborg/sdf/ +sdf.version=0.1.38 +# https://github.com/metaborg/spoofax/ +spoofax-core.version=0.1.38 +# https://github.com/metaborg/spoofax.gradle/ +spoofax-gradle.version=0.1.38 +# https://github.com/metaborg/spt/ +spt.version=0.1.38 +# https://github.com/metaborg/stratego/ +stratego.version=0.1.38 +# https://github.com/metaborg/strategoxt/ +strategoxt.version=0.1.38 diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 8024dc5..8f8ccb5 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,30 +4,10 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -devenv-spoofax-gradle = "0.6.1" # https://github.com/metaborg/spoofax.gradle +spoofax-gradle = "0.1.38" # https://github.com/metaborg/spoofax.gradle metaborg-gradle = "0.11.1" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) -# Spoofax -metaborg-common = "0.12.0" # https://github.com/metaborg/common/ -metaborg-log = "0.5.5" # https://github.com/metaborg/log/ -metaborg-pie = "0.21.0" # https://github.com/metaborg/pie/ -metaborg-resource = "0.14.1" # https://github.com/metaborg/resource/ -spoofax3 = "0.23.1" # https://github.com/metaborg/spoofax-pie/ - -spoofax2 = "2.5.21" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) -esv = "0.1.38" # https://github.com/metaborg/esv/ -jsglr = "0.1.38" # https://github.com/metaborg/jsglr/ -mb-exec = "0.1.38" # https://github.com/metaborg/mb-exec/ -mb-rep = "0.1.38" # https://github.com/metaborg/mb-rep/ -nabl = "0.1.38" # https://github.com/metaborg/nabl/ -sdf = "0.1.38" # https://github.com/metaborg/sdf/ -spoofax-core = "0.1.38" # https://github.com/metaborg/spoofax/ -spoofax-gradle = "0.1.38" # https://github.com/metaborg/spoofax.gradle/ -spt = "0.1.38" # https://github.com/metaborg/spt/ -stratego = "0.1.38" # https://github.com/metaborg/stratego/ -strategoxt = "0.1.38" # https://github.com/metaborg/strategoxt/ - # Kotlin kotlinx-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines @@ -128,263 +108,264 @@ intellij = { id = "org.jetbrains.intellij", [libraries] # The below libraries ARE part of the Spoofax platform definition. +# We don't specify versions here, instead we specify versions in the platform definition. # NOTE: Also update: platform/build.gradle.kts # Metaborg Common (https://github.com/metaborg/common) -metaborg-common = { module = "org.metaborg:common", version.ref = "metaborg-common" } +metaborg-common = { module = "org.metaborg:common" } # Metaborg Log (https://github.com/metaborg/log) -metaborg-log-api = { module = "org.metaborg:log.api", version.ref = "metaborg-log" } -metaborg-log-backend-logback = { module = "org.metaborg:log.backend.logback", version.ref = "metaborg-log" } -metaborg-log-backend-slf4j = { module = "org.metaborg:log.backend.slf4j", version.ref = "metaborg-log" } -metaborg-log-dagger = { module = "org.metaborg:log.dagger", version.ref = "metaborg-log" } +metaborg-log-api = { module = "org.metaborg:log.api" } +metaborg-log-backend-logback = { module = "org.metaborg:log.backend.logback" } +metaborg-log-backend-slf4j = { module = "org.metaborg:log.backend.slf4j" } +metaborg-log-dagger = { module = "org.metaborg:log.dagger" } # Metaborg PIE (https://github.com/metaborg/pie) -metaborg-pie-api = { module = "org.metaborg:pie.api", version.ref = "metaborg-pie" } -metaborg-pie-api-test = { module = "org.metaborg:pie.api.test", version.ref = "metaborg-pie" } -metaborg-pie-dagger = { module = "org.metaborg:pie.dagger", version.ref = "metaborg-pie" } -metaborg-pie-graph = { module = "org.metaborg:pie.graph", version.ref = "metaborg-pie" } -metaborg-pie-lang = { module = "org.metaborg:pie.lang", version.ref = "metaborg-pie" } -metaborg-pie-lang-runtime-java = { module = "org.metaborg:pie.lang.runtime.java", version.ref = "metaborg-pie" } -metaborg-pie-lang-runtime-kotlin = { module = "org.metaborg:pie.lang.runtime.kotlin", version.ref = "metaborg-pie" } -metaborg-pie-lang-test = { module = "org.metaborg:pie.lang.test", version.ref = "metaborg-pie" } -metaborg-pie-runtime = { module = "org.metaborg:pie.runtime", version.ref = "metaborg-pie" } -metaborg-pie-runtime-test = { module = "org.metaborg:pie.runtime.test", version.ref = "metaborg-pie" } -metaborg-pie-serde-fst = { module = "org.metaborg:pie.serde.fst", version.ref = "metaborg-pie" } -metaborg-pie-serde-kryo = { module = "org.metaborg:pie.serde.kryo", version.ref = "metaborg-pie" } -metaborg-pie-share-coroutine = { module = "org.metaborg:pie.share.coroutine", version.ref = "metaborg-pie" } -metaborg-pie-store-lmdb = { module = "org.metaborg:pie.store.lmdb", version.ref = "metaborg-pie" } -metaborg-pie-task-archive = { module = "org.metaborg:pie.task.archive", version.ref = "metaborg-pie" } -metaborg-pie-task-java = { module = "org.metaborg:pie.task.java", version.ref = "metaborg-pie" } -metaborg-pie-task-java-ecj = { module = "org.metaborg:pie.task.java.ecj", version.ref = "metaborg-pie" } -metaborg-pie-taskdefs-guice = { module = "org.metaborg:pie.taskdefs.guice", version.ref = "metaborg-pie" } +metaborg-pie-api = { module = "org.metaborg:pie.api" } +metaborg-pie-api-test = { module = "org.metaborg:pie.api.test" } +metaborg-pie-dagger = { module = "org.metaborg:pie.dagger" } +metaborg-pie-graph = { module = "org.metaborg:pie.graph" } +metaborg-pie-lang = { module = "org.metaborg:pie.lang" } +metaborg-pie-lang-runtime-java = { module = "org.metaborg:pie.lang.runtime.java" } +metaborg-pie-lang-runtime-kotlin = { module = "org.metaborg:pie.lang.runtime.kotlin" } +metaborg-pie-lang-test = { module = "org.metaborg:pie.lang.test" } +metaborg-pie-runtime = { module = "org.metaborg:pie.runtime" } +metaborg-pie-runtime-test = { module = "org.metaborg:pie.runtime.test" } +metaborg-pie-serde-fst = { module = "org.metaborg:pie.serde.fst" } +metaborg-pie-serde-kryo = { module = "org.metaborg:pie.serde.kryo" } +metaborg-pie-share-coroutine = { module = "org.metaborg:pie.share.coroutine" } +metaborg-pie-store-lmdb = { module = "org.metaborg:pie.store.lmdb" } +metaborg-pie-task-archive = { module = "org.metaborg:pie.task.archive" } +metaborg-pie-task-java = { module = "org.metaborg:pie.task.java" } +metaborg-pie-task-java-ecj = { module = "org.metaborg:pie.task.java.ecj" } +metaborg-pie-taskdefs-guice = { module = "org.metaborg:pie.taskdefs.guice" } # Metaborg Resource (https://github.com/metaborg/resource) -metaborg-resource-api = { module = "org.metaborg:resource", version.ref = "metaborg-resource" } -metaborg-resource-dagger = { module = "org.metaborg:resource.dagger", version.ref = "metaborg-resource" } +metaborg-resource-api = { module = "org.metaborg:resource" } +metaborg-resource-dagger = { module = "org.metaborg:resource.dagger" } # Spoofax 3/PIE (https://github.com/metaborg/spoofax-pie) -spoofax3-aterm-common = { module = "org.metaborg:aterm.common", version.ref = "spoofax3" } -spoofax3-cfg = { module = "org.metaborg:cfg", version.ref = "spoofax3" } -spoofax3-cfg-cli = { module = "org.metaborg:cfg.cli", version.ref = "spoofax3" } # Not published -spoofax3-cfg-eclipse = { module = "org.metaborg:cfg.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-cfg-intellij = { module = "org.metaborg:cfg.intellij", version.ref = "spoofax3" } # Not published -spoofax3-cfg-spoofax2 = { module = "org.metaborg:cfg.spoofax2", version.ref = "spoofax3" } -spoofax3-cli = { module = "org.metaborg:spoofax.cli", version.ref = "spoofax3" } -spoofax3-compiler = { module = "org.metaborg:spoofax.compiler", version.ref = "spoofax3" } -spoofax3-compiler-eclipsebundle = { module = "org.metaborg:spoofax.compiler.eclipsebundle", version.ref = "spoofax3" } -spoofax3-compiler-gradle = { module = "org.metaborg:spoofax.compiler.gradle", version.ref = "spoofax3" } -spoofax3-compiler-gradle-spoofax2 = { module = "org.metaborg:spoofax.compiler.gradle.spoofax2", version.ref = "spoofax3" } -spoofax3-compiler-interfaces = { module = "org.metaborg:spoofax.compiler.interfaces", version.ref = "spoofax3" } -spoofax3-compiler-spoofax2 = { module = "org.metaborg:spoofax.compiler.spoofax2", version.ref = "spoofax3" } -spoofax3-compiler-spoofax2-dagger = { module = "org.metaborg:spoofax.compiler.spoofax2.dagger", version.ref = "spoofax3" } -spoofax3-constraint-common = { module = "org.metaborg:constraint.common", version.ref = "spoofax3" } -spoofax3-constraint-pie = { module = "org.metaborg:constraint.pie", version.ref = "spoofax3" } -spoofax3-core = { module = "org.metaborg:spoofax.core", version.ref = "spoofax3" } -spoofax3-dynamix = { module = "org.metaborg:dynamix", version.ref = "spoofax3" } -spoofax3-dynamix-cli = { module = "org.metaborg:dynamix.cli", version.ref = "spoofax3" } # Not published -spoofax3-dynamix-eclipse = { module = "org.metaborg:dynamix.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-dynamix-intellij = { module = "org.metaborg:dynamix.intellij", version.ref = "spoofax3" } # Not published -spoofax3-dynamix-spoofax2 = { module = "org.metaborg:dynamix.spoofax2", version.ref = "spoofax3" } -spoofax3-eclipse = { module = "org.metaborg:spoofax.eclipse", version.ref = "spoofax3" } -spoofax3-esv = { module = "org.metaborg:esv", version.ref = "spoofax3" } -spoofax3-esv-cli = { module = "org.metaborg:esv.cli", version.ref = "spoofax3" } # Not published -spoofax3-esv-common = { module = "org.metaborg:esv.common", version.ref = "spoofax3" } -spoofax3-esv-eclipse = { module = "org.metaborg:esv.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-esv-intellij = { module = "org.metaborg:esv.intellij", version.ref = "spoofax3" } # Not published -spoofax3-gpp = { module = "org.metaborg:gpp", version.ref = "spoofax3" } -spoofax3-gpp-eclipse = { module = "org.metaborg:gpp.eclipse", version.ref = "spoofax3" } -spoofax3-intellij = { module = "org.metaborg:spoofax.intellij", version.ref = "spoofax3" } -spoofax3-jsglr-common = { module = "org.metaborg:jsglr.common", version.ref = "spoofax3" } -spoofax3-jsglr-pie = { module = "org.metaborg:jsglr.pie", version.ref = "spoofax3" } -spoofax3-jsglr1-common = { module = "org.metaborg:jsglr1.common", version.ref = "spoofax3" } -spoofax3-jsglr2-common = { module = "org.metaborg:jsglr2.common", version.ref = "spoofax3" } -spoofax3-libspoofax2 = { module = "org.metaborg:libspoofax2", version.ref = "spoofax3" } -spoofax3-libspoofax2-eclipse = { module = "org.metaborg:libspoofax2.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-libstatix = { module = "org.metaborg:libstatix", version.ref = "spoofax3" } -spoofax3-libstatix-eclipse = { module = "org.metaborg:libstatix.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-lwb-compiler = { module = "org.metaborg:spoofax.lwb.compiler", version.ref = "spoofax3" } -spoofax3-lwb-compiler-gradle = { module = "org.metaborg:spoofax.lwb.compiler.gradle", version.ref = "spoofax3" } -spoofax3-lwb-dynamicloading = { module = "org.metaborg:spoofax.lwb.dynamicloading", version.ref = "spoofax3" } -spoofax3-nabl2-common = { module = "org.metaborg:nabl2.common", version.ref = "spoofax3" } -spoofax3-resource = { module = "org.metaborg:spoofax.resource", version.ref = "spoofax3" } -spoofax3-sdf3 = { module = "org.metaborg:sdf3", version.ref = "spoofax3" } -spoofax3-sdf3-cli = { module = "org.metaborg:sdf3.cli", version.ref = "spoofax3" } # Not published -spoofax3-sdf3-eclipse = { module = "org.metaborg:sdf3.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-sdf3-extdynamix = { module = "org.metaborg:sdf3_ext_dynamix", version.ref = "spoofax3" } -spoofax3-sdf3-extdynamix-eclipse = { module = "org.metaborg:sdf3_ext_dynamix.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-sdf3-extdynamix-spoofax2 = { module = "org.metaborg:sdf3_ext_dynamix.spoofax2", version.ref = "spoofax3" } -spoofax3-sdf3-extstatix = { module = "org.metaborg:sdf3_ext_statix", version.ref = "spoofax3" } -spoofax3-sdf3-extstatix-eclipse = { module = "org.metaborg:sdf3_ext_statix.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-sdf3-intellij = { module = "org.metaborg:sdf3.intellij", version.ref = "spoofax3" } # Not published -spoofax3-spoofax-common = { module = "org.metaborg:spoofax.common", version.ref = "spoofax3" } -spoofax3-spoofax2-common = { module = "org.metaborg:spoofax2.common", version.ref = "spoofax3" } -spoofax3-spt = { module = "org.metaborg:spt", version.ref = "spoofax3" } -spoofax3-spt-api = { module = "org.metaborg:spt.api", version.ref = "spoofax3" } -spoofax3-spt-cli = { module = "org.metaborg:spt.cli", version.ref = "spoofax3" } # Not published -spoofax3-spt-dynamicloading = { module = "org.metaborg:spt.dynamicloading", version.ref = "spoofax3" } -spoofax3-spt-eclipse = { module = "org.metaborg:spt.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-spt-intellij = { module = "org.metaborg:spt.intellij", version.ref = "spoofax3" } # Not published -spoofax3-statix = { module = "org.metaborg:statix", version.ref = "spoofax3" } -spoofax3-statix-cli = { module = "org.metaborg:statix.cli", version.ref = "spoofax3" } # Not published -spoofax3-statix-codecompletion = { module = "org.metaborg:statix.codecompletion", version.ref = "spoofax3" } -spoofax3-statix-codecompletion-pie = { module = "org.metaborg:statix.codecompletion.pie", version.ref = "spoofax3" } -spoofax3-statix-common = { module = "org.metaborg:statix.common", version.ref = "spoofax3" } -spoofax3-statix-eclipse = { module = "org.metaborg:statix.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-statix-intellij = { module = "org.metaborg:statix.intellij", version.ref = "spoofax3" } # Not published -spoofax3-statix-multilang = { module = "org.metaborg:statix.multilang", version.ref = "spoofax3" } -spoofax3-statix-multilang-eclipse = { module = "org.metaborg:statix.multilang.eclipse", version.ref = "spoofax3" } -spoofax3-statix-pie = { module = "org.metaborg:statix.pie", version.ref = "spoofax3" } -spoofax3-stratego = { module = "org.metaborg:stratego", version.ref = "spoofax3" } -spoofax3-stratego-cli = { module = "org.metaborg:stratego.cli", version.ref = "spoofax3" } # Not published -spoofax3-stratego-common = { module = "org.metaborg:stratego.common", version.ref = "spoofax3" } -spoofax3-stratego-eclipse = { module = "org.metaborg:stratego.eclipse", version.ref = "spoofax3" } # Not published -spoofax3-stratego-intellij = { module = "org.metaborg:stratego.intellij", version.ref = "spoofax3" } # Not published -spoofax3-stratego-pie = { module = "org.metaborg:stratego.pie", version.ref = "spoofax3" } -spoofax3-strategolib = { module = "org.metaborg:strategolib", version.ref = "spoofax3" } -spoofax3-strategolib-eclipse = { module = "org.metaborg:strategolib.eclipse", version.ref = "spoofax3" } -spoofax3-tego-runtime = { module = "org.metaborg:tego.runtime", version.ref = "spoofax3" } -spoofax3-test = { module = "org.metaborg:spoofax.test", version.ref = "spoofax3" } -spoofax3-tooling-eclipsebundle = { module = "org.metaborg:tooling.eclipsebundle", version.ref = "spoofax3" } -spoofax3-transform-pie = { module = "org.metaborg:transform.pie", version.ref = "spoofax3" } +spoofax3-aterm-common = { module = "org.metaborg:aterm.common" } +spoofax3-cfg = { module = "org.metaborg:cfg" } +spoofax3-cfg-cli = { module = "org.metaborg:cfg.cli" } # Not published +spoofax3-cfg-eclipse = { module = "org.metaborg:cfg.eclipse" } # Not published +spoofax3-cfg-intellij = { module = "org.metaborg:cfg.intellij" } # Not published +spoofax3-cfg-spoofax2 = { module = "org.metaborg:cfg.spoofax2" } +spoofax3-cli = { module = "org.metaborg:spoofax.cli" } +spoofax3-compiler = { module = "org.metaborg:spoofax.compiler" } +spoofax3-compiler-eclipsebundle = { module = "org.metaborg:spoofax.compiler.eclipsebundle" } +spoofax3-compiler-gradle = { module = "org.metaborg:spoofax.compiler.gradle" } +spoofax3-compiler-gradle-spoofax2 = { module = "org.metaborg:spoofax.compiler.gradle.spoofax2" } +spoofax3-compiler-interfaces = { module = "org.metaborg:spoofax.compiler.interfaces" } +spoofax3-compiler-spoofax2 = { module = "org.metaborg:spoofax.compiler.spoofax2" } +spoofax3-compiler-spoofax2-dagger = { module = "org.metaborg:spoofax.compiler.spoofax2.dagger" } +spoofax3-constraint-common = { module = "org.metaborg:constraint.common" } +spoofax3-constraint-pie = { module = "org.metaborg:constraint.pie" } +spoofax3-core = { module = "org.metaborg:spoofax.core" } +spoofax3-dynamix = { module = "org.metaborg:dynamix" } +spoofax3-dynamix-cli = { module = "org.metaborg:dynamix.cli" } # Not published +spoofax3-dynamix-eclipse = { module = "org.metaborg:dynamix.eclipse" } # Not published +spoofax3-dynamix-intellij = { module = "org.metaborg:dynamix.intellij" } # Not published +spoofax3-dynamix-spoofax2 = { module = "org.metaborg:dynamix.spoofax2" } +spoofax3-eclipse = { module = "org.metaborg:spoofax.eclipse" } +spoofax3-esv = { module = "org.metaborg:esv" } +spoofax3-esv-cli = { module = "org.metaborg:esv.cli" } # Not published +spoofax3-esv-common = { module = "org.metaborg:esv.common" } +spoofax3-esv-eclipse = { module = "org.metaborg:esv.eclipse" } # Not published +spoofax3-esv-intellij = { module = "org.metaborg:esv.intellij" } # Not published +spoofax3-gpp = { module = "org.metaborg:gpp" } +spoofax3-gpp-eclipse = { module = "org.metaborg:gpp.eclipse" } +spoofax3-intellij = { module = "org.metaborg:spoofax.intellij" } +spoofax3-jsglr-common = { module = "org.metaborg:jsglr.common" } +spoofax3-jsglr-pie = { module = "org.metaborg:jsglr.pie" } +spoofax3-jsglr1-common = { module = "org.metaborg:jsglr1.common" } +spoofax3-jsglr2-common = { module = "org.metaborg:jsglr2.common" } +spoofax3-libspoofax2 = { module = "org.metaborg:libspoofax2" } +spoofax3-libspoofax2-eclipse = { module = "org.metaborg:libspoofax2.eclipse" } # Not published +spoofax3-libstatix = { module = "org.metaborg:libstatix" } +spoofax3-libstatix-eclipse = { module = "org.metaborg:libstatix.eclipse" } # Not published +spoofax3-lwb-compiler = { module = "org.metaborg:spoofax.lwb.compiler" } +spoofax3-lwb-compiler-gradle = { module = "org.metaborg:spoofax.lwb.compiler.gradle" } +spoofax3-lwb-dynamicloading = { module = "org.metaborg:spoofax.lwb.dynamicloading" } +spoofax3-nabl2-common = { module = "org.metaborg:nabl2.common" } +spoofax3-resource = { module = "org.metaborg:spoofax.resource" } +spoofax3-sdf3 = { module = "org.metaborg:sdf3" } +spoofax3-sdf3-cli = { module = "org.metaborg:sdf3.cli" } # Not published +spoofax3-sdf3-eclipse = { module = "org.metaborg:sdf3.eclipse" } # Not published +spoofax3-sdf3-extdynamix = { module = "org.metaborg:sdf3_ext_dynamix" } +spoofax3-sdf3-extdynamix-eclipse = { module = "org.metaborg:sdf3_ext_dynamix.eclipse" } # Not published +spoofax3-sdf3-extdynamix-spoofax2 = { module = "org.metaborg:sdf3_ext_dynamix.spoofax2" } +spoofax3-sdf3-extstatix = { module = "org.metaborg:sdf3_ext_statix" } +spoofax3-sdf3-extstatix-eclipse = { module = "org.metaborg:sdf3_ext_statix.eclipse" } # Not published +spoofax3-sdf3-intellij = { module = "org.metaborg:sdf3.intellij" } # Not published +spoofax3-spoofax-common = { module = "org.metaborg:spoofax.common" } +spoofax3-spoofax2-common = { module = "org.metaborg:spoofax2.common" } +spoofax3-spt = { module = "org.metaborg:spt" } +spoofax3-spt-api = { module = "org.metaborg:spt.api" } +spoofax3-spt-cli = { module = "org.metaborg:spt.cli" } # Not published +spoofax3-spt-dynamicloading = { module = "org.metaborg:spt.dynamicloading" } +spoofax3-spt-eclipse = { module = "org.metaborg:spt.eclipse" } # Not published +spoofax3-spt-intellij = { module = "org.metaborg:spt.intellij" } # Not published +spoofax3-statix = { module = "org.metaborg:statix" } +spoofax3-statix-cli = { module = "org.metaborg:statix.cli" } # Not published +spoofax3-statix-codecompletion = { module = "org.metaborg:statix.codecompletion" } +spoofax3-statix-codecompletion-pie = { module = "org.metaborg:statix.codecompletion.pie" } +spoofax3-statix-common = { module = "org.metaborg:statix.common" } +spoofax3-statix-eclipse = { module = "org.metaborg:statix.eclipse" } # Not published +spoofax3-statix-intellij = { module = "org.metaborg:statix.intellij" } # Not published +spoofax3-statix-multilang = { module = "org.metaborg:statix.multilang" } +spoofax3-statix-multilang-eclipse = { module = "org.metaborg:statix.multilang.eclipse" } +spoofax3-statix-pie = { module = "org.metaborg:statix.pie" } +spoofax3-stratego = { module = "org.metaborg:stratego" } +spoofax3-stratego-cli = { module = "org.metaborg:stratego.cli" } # Not published +spoofax3-stratego-common = { module = "org.metaborg:stratego.common" } +spoofax3-stratego-eclipse = { module = "org.metaborg:stratego.eclipse" } # Not published +spoofax3-stratego-intellij = { module = "org.metaborg:stratego.intellij" } # Not published +spoofax3-stratego-pie = { module = "org.metaborg:stratego.pie" } +spoofax3-strategolib = { module = "org.metaborg:strategolib" } +spoofax3-strategolib-eclipse = { module = "org.metaborg:strategolib.eclipse" } +spoofax3-tego-runtime = { module = "org.metaborg:tego.runtime" } +spoofax3-test = { module = "org.metaborg:spoofax.test" } +spoofax3-tooling-eclipsebundle = { module = "org.metaborg:tooling.eclipsebundle" } +spoofax3-transform-pie = { module = "org.metaborg:transform.pie" } # Dynsem (https://github.com/metaborg/dynsem) -spoofax2-dynsem-lang = { module = "org.metaborg:dynsem", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-dynsem-lang = { module = "org.metaborg:dynsem" } # No Spoofax 3 build exists # ESV (https://github.com/metaborg/esv) -esv-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.esv", version.ref = "esv" } +esv-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.esv" } -spoofax2-esv-lang = { module = "org.metaborg:org.metaborg.meta.lang.esv", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-esv-lang = { module = "org.metaborg:org.metaborg.meta.lang.esv" } # Use Spoofax 2 language for bootstrapping # Flowspec (https://github.com/metaborg/flowspec) -spoofax2-flowspec-runtime = { module = "org.metaborg:flowspec.runtime", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-flowspec-runtime = { module = "org.metaborg:flowspec.runtime" } # No Spoofax 3 build exists # JSGLR (https://github.com/metaborg/jsglr) -interpreter-library-jsglr = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.jsglr", version.ref = "jsglr" } -jsglr = { module = "org.metaborg.devenv:org.spoofax.jsglr", version.ref = "jsglr" } -jsglr-shared = { module = "org.metaborg.devenv:jsglr.shared", version.ref = "jsglr" } -jsglr2 = { module = "org.metaborg.devenv:org.spoofax.jsglr2", version.ref = "jsglr" } +interpreter-library-jsglr = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.jsglr" } +jsglr = { module = "org.metaborg.devenv:org.spoofax.jsglr" } +jsglr-shared = { module = "org.metaborg.devenv:jsglr.shared" } +jsglr2 = { module = "org.metaborg.devenv:org.spoofax.jsglr2" } -spoofax2-interpreter-library-jsglr = { module = "org.metaborg:org.spoofax.interpreter.library.jsglr", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr = { module = "org.metaborg:org.spoofax.jsglr", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr-shared = { module = "org.metaborg:jsglr.shared", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr2 = { module = "org.metaborg:org.spoofax.jsglr2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-makepermissive = { module = "org.metaborg:make-permissive", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-interpreter-library-jsglr = { module = "org.metaborg:org.spoofax.interpreter.library.jsglr" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr = { module = "org.metaborg:org.spoofax.jsglr" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr-shared = { module = "org.metaborg:jsglr.shared" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr2 = { module = "org.metaborg:org.spoofax.jsglr2" } # Use Spoofax 2 language for bootstrapping +spoofax2-makepermissive = { module = "org.metaborg:make-permissive" } # No Spoofax 3 build exists # MB Exec (https://github.com/metaborg/mb-exec) -interpreter-core = { module = "org.metaborg.devenv:org.spoofax.interpreter.core", version.ref = "mb-exec" } -interpreter-library-java = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.java", version.ref = "mb-exec" } -interpreter-library-xml = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.xml", version.ref = "mb-exec" } -metaborg-util = { module = "org.metaborg.devenv:org.metaborg.util", version.ref = "mb-exec" } -util-vfs2 = { module = "org.metaborg.devenv:util-vfs2", version.ref = "mb-exec" } - -spoofax2-interpreter-core = { module = "org.metaborg:org.spoofax.interpreter.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-interpreter-library-java = { module = "org.metaborg:org.spoofax.interpreter.library.java", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-interpreter-library-xml = { module = "org.metaborg:org.spoofax.interpreter.library.xml", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-util = { module = "org.metaborg:org.metaborg.util", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-util-vfs2 = { module = "org.metaborg:util-vfs2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +interpreter-core = { module = "org.metaborg.devenv:org.spoofax.interpreter.core" } +interpreter-library-java = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.java" } +interpreter-library-xml = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.xml" } +metaborg-util = { module = "org.metaborg.devenv:org.metaborg.util" } +util-vfs2 = { module = "org.metaborg.devenv:util-vfs2" } + +spoofax2-interpreter-core = { module = "org.metaborg:org.spoofax.interpreter.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-java = { module = "org.metaborg:org.spoofax.interpreter.library.java" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-xml = { module = "org.metaborg:org.spoofax.interpreter.library.xml" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-util = { module = "org.metaborg:org.metaborg.util" } # Use Spoofax 2 language for bootstrapping +spoofax2-util-vfs2 = { module = "org.metaborg:util-vfs2" } # Use Spoofax 2 language for bootstrapping # MB Rep (https://github.com/metaborg/mb-rep) -interpreter-library-index = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.index", version.ref = "mb-rep" } -spoofax-terms = { module = "org.metaborg.devenv:org.spoofax.terms", version.ref = "mb-rep" } +interpreter-library-index = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.index" } +spoofax-terms = { module = "org.metaborg.devenv:org.spoofax.terms" } -spoofax2-interpreter-library-index = { module = "org.metaborg:org.spoofax.interpreter.library.index", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-terms = { module = "org.metaborg:org.spoofax.terms", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-index = { module = "org.metaborg:org.spoofax.interpreter.library.index" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-terms = { module = "org.metaborg:org.spoofax.terms" } # Use Spoofax 2 language for bootstrapping # NaBL (https://github.com/metaborg/nabl) -nabl-praffrayi = { module = "org.metaborg.devenv:p_raffrayi", version.ref = "nabl" } -nabl-renaming-java = { module = "org.metaborg.devenv:renaming.java", version.ref = "nabl" } -nabl-scopegraph = { module = "org.metaborg.devenv:scopegraph", version.ref = "nabl" } -nabl2-lang = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.lang", version.ref = "nabl" } -nabl2-runtime = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.runtime", version.ref = "nabl" } -nabl2-shared = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.shared", version.ref = "nabl" } -nabl2-solver = { module = "org.metaborg.devenv:nabl2.solver", version.ref = "nabl" } -nabl2-terms = { module = "org.metaborg.devenv:nabl2.terms", version.ref = "nabl" } -statix-generator = { module = "org.metaborg.devenv:statix.generator", version.ref = "nabl" } -statix-lang = { module = "org.metaborg.devenv:statix.lang", version.ref = "nabl" } -statix-runtime = { module = "org.metaborg.devenv:statix.runtime", version.ref = "nabl" } -statix-solver = { module = "org.metaborg.devenv:statix.solver", version.ref = "nabl" } - -spoofax2-nabl-lang = { module = "org.metaborg:org.metaborg.meta.lang.nabl", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) -spoofax2-nabl-praffrayi = { module = "org.metaborg:p_raffrayi", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl-renaming-java = { module = "org.metaborg:renaming.java", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl-scopegraph = { module = "org.metaborg:scopegraph", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-extdynsem = { module = "org.metaborg:org.metaborg.meta.nabl2.ext.dynsem", version.ref = "spoofax2" } # No Spoofax 3 build exists -spoofax2-nabl2-lang = { module = "org.metaborg:org.metaborg.meta.nabl2.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-runtime = { module = "org.metaborg:org.metaborg.meta.nabl2.runtime", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-shared = { module = "org.metaborg:org.metaborg.meta.nabl2.shared", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-solver = { module = "org.metaborg:nabl2.solver", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-terms = { module = "org.metaborg:nabl2.terms", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-generator = { module = "org.metaborg:statix.generator", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-lang = { module = "org.metaborg:statix.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-runtime = { module = "org.metaborg:statix.runtime", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-solver = { module = "org.metaborg:statix.solver", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-ts-lang = { module = "org.metaborg:org.metaborg.meta.lang.ts", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) +nabl-praffrayi = { module = "org.metaborg.devenv:p_raffrayi" } +nabl-renaming-java = { module = "org.metaborg.devenv:renaming.java" } +nabl-scopegraph = { module = "org.metaborg.devenv:scopegraph" } +nabl2-lang = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.lang" } +nabl2-runtime = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.runtime" } +nabl2-shared = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.shared" } +nabl2-solver = { module = "org.metaborg.devenv:nabl2.solver" } +nabl2-terms = { module = "org.metaborg.devenv:nabl2.terms" } +statix-generator = { module = "org.metaborg.devenv:statix.generator" } +statix-lang = { module = "org.metaborg.devenv:statix.lang" } +statix-runtime = { module = "org.metaborg.devenv:statix.runtime" } +statix-solver = { module = "org.metaborg.devenv:statix.solver" } + +spoofax2-nabl-lang = { module = "org.metaborg:org.metaborg.meta.lang.nabl" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) +spoofax2-nabl-praffrayi = { module = "org.metaborg:p_raffrayi" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl-renaming-java = { module = "org.metaborg:renaming.java" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl-scopegraph = { module = "org.metaborg:scopegraph" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-extdynsem = { module = "org.metaborg:org.metaborg.meta.nabl2.ext.dynsem" } # No Spoofax 3 build exists +spoofax2-nabl2-lang = { module = "org.metaborg:org.metaborg.meta.nabl2.lang" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-runtime = { module = "org.metaborg:org.metaborg.meta.nabl2.runtime" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-shared = { module = "org.metaborg:org.metaborg.meta.nabl2.shared" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-solver = { module = "org.metaborg:nabl2.solver" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-terms = { module = "org.metaborg:nabl2.terms" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-generator = { module = "org.metaborg:statix.generator" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-lang = { module = "org.metaborg:statix.lang" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-runtime = { module = "org.metaborg:statix.runtime" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-solver = { module = "org.metaborg:statix.solver" } # Use Spoofax 2 language for bootstrapping +spoofax2-ts-lang = { module = "org.metaborg:org.metaborg.meta.lang.ts" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) # Runtime Libraries (https://github.com/metaborg/runtime-libraries) -spoofax2-meta-lib-analysis = { module = "org.metaborg:org.metaborg.meta.lib.analysis", version.ref = "spoofax2" } # No Spoofax 3 build exists -spoofax2-metaborg-runtime-task = { module = "org.metaborg:org.metaborg.runtime.task", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-meta-lib-analysis = { module = "org.metaborg:org.metaborg.meta.lib.analysis" } # No Spoofax 3 build exists +spoofax2-metaborg-runtime-task = { module = "org.metaborg:org.metaborg.runtime.task" } # No Spoofax 3 build exists # SDF (https://github.com/metaborg/sdf) -parsetable = { module = "org.metaborg.devenv:org.metaborg.parsetable", version.ref = "sdf" } -sdf2parenthesize = { module = "org.metaborg.devenv:sdf2parenthesize", version.ref = "sdf" } -sdf2table = { module = "org.metaborg.devenv:sdf2table", version.ref = "sdf" } -sdf3-extstatix = { module = "org.metaborg.devenv:sdf3.ext.statix", version.ref = "sdf" } -sdf3-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.template", version.ref = "sdf" } - -spoofax2-parsetable = { module = "org.metaborg:org.metaborg.parsetable", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf2parenthesize = { module = "org.metaborg:sdf2parenthesize", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf2table = { module = "org.metaborg:sdf2table", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf3-extstatix = { module = "org.metaborg:sdf3.ext.statix", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf3-lang = { module = "org.metaborg:org.metaborg.meta.lang.template", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +parsetable = { module = "org.metaborg.devenv:org.metaborg.parsetable" } +sdf2parenthesize = { module = "org.metaborg.devenv:sdf2parenthesize" } +sdf2table = { module = "org.metaborg.devenv:sdf2table" } +sdf3-extstatix = { module = "org.metaborg.devenv:sdf3.ext.statix" } +sdf3-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.template" } + +spoofax2-parsetable = { module = "org.metaborg:org.metaborg.parsetable" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf2parenthesize = { module = "org.metaborg:sdf2parenthesize" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf2table = { module = "org.metaborg:sdf2table" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf3-extstatix = { module = "org.metaborg:sdf3.ext.statix" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf3-lang = { module = "org.metaborg:org.metaborg.meta.lang.template" } # Use Spoofax 2 language for bootstrapping # Spoofax Core (https://github.com/metaborg/spoofax) -meta-lib-spoofax = { module = "org.metaborg.devenv:meta.lib.spoofax", version.ref = "spoofax-core" } -metaborg-core = { module = "org.metaborg.devenv:org.metaborg.core", version.ref = "spoofax-core" } -metaborg-core-test = { module = "org.metaborg.devenv:org.metaborg.core.test", version.ref = "spoofax-core" } -metaborg-meta-core = { module = "org.metaborg.devenv:org.metaborg.meta.core", version.ref = "spoofax-core" } -spoofax-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.core", version.ref = "spoofax-core" } -spoofax-meta-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.meta.core", version.ref = "spoofax-core" } -spoofax-nativebundle = { module = "org.metaborg.devenv:org.metaborg.spoofax.nativebundle", version.ref = "spoofax-core" } - -spoofax2-meta-lib-spoofax = { module = "org.metaborg:meta.lib.spoofax", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-core = { module = "org.metaborg:org.metaborg.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-core-test = { module = "org.metaborg:org.metaborg.core.test", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-meta-core = { module = "org.metaborg:org.metaborg.meta.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-core = { module = "org.metaborg:org.metaborg.spoofax.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-meta-core = { module = "org.metaborg:org.metaborg.spoofax.meta.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-nativebundle = { module = "org.metaborg:org.metaborg.spoofax.nativebundle", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +meta-lib-spoofax = { module = "org.metaborg.devenv:meta.lib.spoofax" } +metaborg-core = { module = "org.metaborg.devenv:org.metaborg.core" } +metaborg-core-test = { module = "org.metaborg.devenv:org.metaborg.core.test" } +metaborg-meta-core = { module = "org.metaborg.devenv:org.metaborg.meta.core" } +spoofax-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.core" } +spoofax-meta-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.meta.core" } +spoofax-nativebundle = { module = "org.metaborg.devenv:org.metaborg.spoofax.nativebundle" } + +spoofax2-meta-lib-spoofax = { module = "org.metaborg:meta.lib.spoofax" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-core = { module = "org.metaborg:org.metaborg.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-core-test = { module = "org.metaborg:org.metaborg.core.test" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-meta-core = { module = "org.metaborg:org.metaborg.meta.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-core = { module = "org.metaborg:org.metaborg.spoofax.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-meta-core = { module = "org.metaborg:org.metaborg.spoofax.meta.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-nativebundle = { module = "org.metaborg:org.metaborg.spoofax.nativebundle" } # Use Spoofax 2 language for bootstrapping # Spoofax Gradle (https://github.com/metaborg/spoofax.gradle) -spoofax3-gradle = { module = "org.metaborg.devenv:spoofax.gradle", version.ref = "spoofax-gradle" } +spoofax3-gradle = { module = "org.metaborg.devenv:spoofax.gradle" } # SPT (https://github.com/metaborg/spt) -mbt-core = { module = "org.metaborg.devenv:org.metaborg.mbt.core", version.ref = "spt" } -spt-core = { module = "org.metaborg.devenv:org.metaborg.spt.core", version.ref = "spt" } -spt-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.spt", version.ref = "spt" } +mbt-core = { module = "org.metaborg.devenv:org.metaborg.mbt.core" } +spt-core = { module = "org.metaborg.devenv:org.metaborg.spt.core" } +spt-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.spt" } -spoofax2-mbt-core = { module = "org.metaborg:org.metaborg.mbt.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spt-core = { module = "org.metaborg:org.metaborg.spt.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-spt-lang = { module = "org.metaborg:org.metaborg.meta.lang.spt", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-mbt-core = { module = "org.metaborg:org.metaborg.mbt.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-spt-core = { module = "org.metaborg:org.metaborg.spt.core" } # Use Spoofax 2 language for bootstrapping +spoofax2-spt-lang = { module = "org.metaborg:org.metaborg.meta.lang.spt" } # Use Spoofax 2 language for bootstrapping # Stratego (https://github.com/metaborg/stratego) -stratego-build = { module = "org.metaborg.devenv:stratego.build", version.ref = "stratego" } -stratego-build-spoofax2 = { module = "org.metaborg.devenv:stratego.build.spoofax2", version.ref = "stratego" } -stratego-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.stratego", version.ref = "stratego" } -stratego2-lang = { module = "org.metaborg.devenv:stratego.lang", version.ref = "stratego" } +stratego-build = { module = "org.metaborg.devenv:stratego.build" } +stratego-build-spoofax2 = { module = "org.metaborg.devenv:stratego.build.spoofax2" } +stratego-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.stratego" } +stratego2-lang = { module = "org.metaborg.devenv:stratego.lang" } -spoofax2-stratego-build = { module = "org.metaborg:stratego.build", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego-build-spoofax2 = { module = "org.metaborg:stratego.build.spoofax2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego-lang = { module = "org.metaborg:org.metaborg.meta.lang.stratego", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego2-lang = { module = "org.metaborg:stratego.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-build = { module = "org.metaborg:stratego.build" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-build-spoofax2 = { module = "org.metaborg:stratego.build.spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-lang = { module = "org.metaborg:org.metaborg.meta.lang.stratego" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego2-lang = { module = "org.metaborg:stratego.lang" } # Use Spoofax 2 language for bootstrapping # Stratego XT (https://github.com/metaborg/strategoxt) -strategoxt-strj = { module = "org.metaborg.devenv:org.strategoxt.strj", version.ref = "strategoxt" } +strategoxt-strj = { module = "org.metaborg.devenv:org.strategoxt.strj" } -spoofax2-strategoxt-jar = { module = "org.metaborg:strategoxt-jar", version.ref = "spoofax2" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? -spoofax2-strategoxt-minjar = { module = "org.metaborg:strategoxt-min-jar", version.ref = "spoofax2" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? -spoofax2-strategoxt-strj = { module = "org.metaborg:org.strategoxt.strj", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-strategoxt-jar = { module = "org.metaborg:strategoxt-jar" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? +spoofax2-strategoxt-minjar = { module = "org.metaborg:strategoxt-min-jar" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? +spoofax2-strategoxt-strj = { module = "org.metaborg:org.strategoxt.strj" } # Use Spoofax 2 language for bootstrapping diff --git a/depman/platform/build.gradle.kts b/depman/platform/build.gradle.kts index 6dd183c..e244599 100644 --- a/depman/platform/build.gradle.kts +++ b/depman/platform/build.gradle.kts @@ -8,265 +8,285 @@ plugins { group = "org.metaborg" description = "A Spoofax 3 platform." +// Here we use the versions defined in gradle.properties (or using -P on the command line) +// to set the versions of the dependencies that should work together. +val metaborgCommonVersion: String = property("metaborg-common.version") as String +val metaborgLogVersion: String = property("metaborg-log.version") as String +val metaborgPieVersion: String = property("metaborg-pie.version") as String +val metaborgResourceVersion: String = property("metaborg-resource.version") as String +val spoofax3Version: String = property("spoofax3.version") as String +val spoofax2Version: String = property("spoofax2.version") as String +val esvVersion: String = property("esv.version") as String +val jsglrVersion: String = property("jsglr.version") as String +val mbExecVersion: String = property("mb-exec.version") as String +val mbRepVersion: String = property("mb-rep.version") as String +val nablVersion: String = property("nabl.version") as String +val sdfVersion: String = property("sdf.version") as String +val spoofaxCoreVersion: String = property("spoofax-core.version") as String +val spoofaxGradleVersion: String = property("spoofax-gradle.version") as String +val sptVersion: String = property("spt.version") as String +val strategoVersion: String = property("stratego.version") as String +val strategoxtVersion: String = property("strategoxt.version") as String + dependencies { constraints { // NOTE: Also update part of libs.versions.toml // Metaborg Common (https://github.com/metaborg/common) - api(libs.metaborg.common) + api(libs.metaborg.common) { version { require(metaborgCommonVersion) } } // Metaborg Log (https://github.com/metaborg/log) - api(libs.metaborg.log.api) - api(libs.metaborg.log.backend.logback) - api(libs.metaborg.log.backend.slf4j) - api(libs.metaborg.log.dagger) + api(libs.metaborg.log.api) { version { require(metaborgLogVersion) } } + api(libs.metaborg.log.backend.logback) { version { require(metaborgLogVersion) } } + api(libs.metaborg.log.backend.slf4j) { version { require(metaborgLogVersion) } } + api(libs.metaborg.log.dagger) { version { require(metaborgLogVersion) } } // Metaborg PIE (https://github.com/metaborg/pie) - api(libs.metaborg.pie.api) - api(libs.metaborg.pie.api.test) - api(libs.metaborg.pie.dagger) - api(libs.metaborg.pie.graph) - api(libs.metaborg.pie.lang) - api(libs.metaborg.pie.lang.runtime.java) - api(libs.metaborg.pie.lang.runtime.kotlin) - api(libs.metaborg.pie.lang.test) - api(libs.metaborg.pie.runtime) - api(libs.metaborg.pie.runtime.test) - api(libs.metaborg.pie.serde.fst) - api(libs.metaborg.pie.serde.kryo) - api(libs.metaborg.pie.share.coroutine) - api(libs.metaborg.pie.store.lmdb) - api(libs.metaborg.pie.task.archive) - api(libs.metaborg.pie.task.java) - api(libs.metaborg.pie.task.java.ecj) - api(libs.metaborg.pie.taskdefs.guice) + api(libs.metaborg.pie.api) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.api.test) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.dagger) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.graph) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.lang) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.lang.runtime.java) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.lang.runtime.kotlin) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.lang.test) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.runtime) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.runtime.test) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.serde.fst) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.serde.kryo) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.share.coroutine) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.store.lmdb) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.task.archive) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.task.java) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.task.java.ecj) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.taskdefs.guice) { version { require(metaborgPieVersion) } } // Metaborg Resource (https://github.com/metaborg/resource) - api(libs.metaborg.resource.api) - api(libs.metaborg.resource.dagger) + api(libs.metaborg.resource.api) { version { require(metaborgResourceVersion) } } + api(libs.metaborg.resource.dagger) { version { require(metaborgResourceVersion) } } // Spoofax 3/PIE (https://github.com/metaborg/spoofax-pie) - api(libs.spoofax3.aterm.common) - api(libs.spoofax3.cfg) - api(libs.spoofax3.cfg.cli) - api(libs.spoofax3.cfg.eclipse) - api(libs.spoofax3.cfg.intellij) - api(libs.spoofax3.cfg.spoofax2) - api(libs.spoofax3.cli) - api(libs.spoofax3.compiler) - api(libs.spoofax3.compiler.eclipsebundle) - api(libs.spoofax3.compiler.gradle) - api(libs.spoofax3.compiler.gradle.spoofax2) - api(libs.spoofax3.compiler.interfaces) - api(libs.spoofax3.compiler.spoofax2) - api(libs.spoofax3.compiler.spoofax2.dagger) - api(libs.spoofax3.constraint.common) - api(libs.spoofax3.constraint.pie) - api(libs.spoofax3.core) - api(libs.spoofax3.dynamix) - api(libs.spoofax3.dynamix.cli) - api(libs.spoofax3.dynamix.eclipse) - api(libs.spoofax3.dynamix.intellij) - api(libs.spoofax3.dynamix.spoofax2) - api(libs.spoofax3.eclipse) - api(libs.spoofax3.esv) - api(libs.spoofax3.esv.cli) - api(libs.spoofax3.esv.common) - api(libs.spoofax3.esv.eclipse) - api(libs.spoofax3.esv.intellij) - api(libs.spoofax3.gpp) - api(libs.spoofax3.gpp.eclipse) - api(libs.spoofax3.intellij) - api(libs.spoofax3.jsglr.common) - api(libs.spoofax3.jsglr.pie) - api(libs.spoofax3.jsglr1.common) - api(libs.spoofax3.jsglr2.common) - api(libs.spoofax3.libspoofax2) - api(libs.spoofax3.libspoofax2.eclipse) - api(libs.spoofax3.libstatix) - api(libs.spoofax3.libstatix.eclipse) - api(libs.spoofax3.lwb.compiler) - api(libs.spoofax3.lwb.compiler.gradle) - api(libs.spoofax3.lwb.dynamicloading) - api(libs.spoofax3.nabl2.common) - api(libs.spoofax3.resource) - api(libs.spoofax3.sdf3) - api(libs.spoofax3.sdf3.cli) - api(libs.spoofax3.sdf3.eclipse) - api(libs.spoofax3.sdf3.extdynamix) - api(libs.spoofax3.sdf3.extdynamix.eclipse) - api(libs.spoofax3.sdf3.extdynamix.spoofax2) - api(libs.spoofax3.sdf3.extstatix) - api(libs.spoofax3.sdf3.extstatix.eclipse) - api(libs.spoofax3.sdf3.intellij) - api(libs.spoofax3.spoofax.common) - api(libs.spoofax3.spoofax2.common) - api(libs.spoofax3.spt) - api(libs.spoofax3.spt.api) - api(libs.spoofax3.spt.cli) - api(libs.spoofax3.spt.dynamicloading) - api(libs.spoofax3.spt.eclipse) - api(libs.spoofax3.spt.intellij) - api(libs.spoofax3.statix) - api(libs.spoofax3.statix.cli) - api(libs.spoofax3.statix.codecompletion) - api(libs.spoofax3.statix.codecompletion.pie) - api(libs.spoofax3.statix.common) - api(libs.spoofax3.statix.eclipse) - api(libs.spoofax3.statix.intellij) - api(libs.spoofax3.statix.multilang) - api(libs.spoofax3.statix.multilang.eclipse) - api(libs.spoofax3.statix.pie) - api(libs.spoofax3.stratego) - api(libs.spoofax3.stratego.cli) - api(libs.spoofax3.stratego.common) - api(libs.spoofax3.stratego.eclipse) - api(libs.spoofax3.stratego.intellij) - api(libs.spoofax3.stratego.pie) - api(libs.spoofax3.strategolib) - api(libs.spoofax3.strategolib.eclipse) - api(libs.spoofax3.tego.runtime) - api(libs.spoofax3.test) - api(libs.spoofax3.tooling.eclipsebundle) - api(libs.spoofax3.transform.pie) + api(libs.spoofax3.aterm.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.cfg) { version { require(spoofax3Version) } } + api(libs.spoofax3.cfg.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.cfg.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.cfg.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.cfg.spoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.eclipsebundle) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.gradle) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.gradle.spoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.interfaces) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.spoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.compiler.spoofax2.dagger) { version { require(spoofax3Version) } } + api(libs.spoofax3.constraint.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.constraint.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.core) { version { require(spoofax3Version) } } + api(libs.spoofax3.dynamix) { version { require(spoofax3Version) } } + api(libs.spoofax3.dynamix.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.dynamix.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.dynamix.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.dynamix.spoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.esv) { version { require(spoofax3Version) } } + api(libs.spoofax3.esv.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.esv.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.esv.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.esv.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.gpp) { version { require(spoofax3Version) } } + api(libs.spoofax3.gpp.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.jsglr.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.jsglr.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.jsglr1.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.jsglr2.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.libspoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.libspoofax2.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.libstatix) { version { require(spoofax3Version) } } + api(libs.spoofax3.libstatix.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.lwb.compiler) { version { require(spoofax3Version) } } + api(libs.spoofax3.lwb.compiler.gradle) { version { require(spoofax3Version) } } + api(libs.spoofax3.lwb.dynamicloading) { version { require(spoofax3Version) } } + api(libs.spoofax3.nabl2.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.resource) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.extdynamix) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.extdynamix.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.extdynamix.spoofax2) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.extstatix) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.extstatix.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.sdf3.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.spoofax.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.spoofax2.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt.api) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt.dynamicloading) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.spt.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.codecompletion) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.codecompletion.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.multilang) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.multilang.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.statix.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego.cli) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego.common) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego.intellij) { version { require(spoofax3Version) } } + api(libs.spoofax3.stratego.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.strategolib) { version { require(spoofax3Version) } } + api(libs.spoofax3.strategolib.eclipse) { version { require(spoofax3Version) } } + api(libs.spoofax3.tego.runtime) { version { require(spoofax3Version) } } + api(libs.spoofax3.test) { version { require(spoofax3Version) } } + api(libs.spoofax3.tooling.eclipsebundle) { version { require(spoofax3Version) } } + api(libs.spoofax3.transform.pie) { version { require(spoofax3Version) } } // Dynsem (https://github.com/metaborg/dynsem) - api(libs.spoofax2.dynsem.lang) + api(libs.spoofax2.dynsem.lang) { version { require(spoofax2Version) } } // ESV (https://github.com/metaborg/esv) - api(libs.esv.lang) + api(libs.esv.lang) { version { require(esvVersion) } } - api(libs.spoofax2.esv.lang) + api(libs.spoofax2.esv.lang) { version { require(spoofax2Version) } } // Flowspec (https://github.com/metaborg/flowspec) - api(libs.spoofax2.flowspec.runtime) + api(libs.spoofax2.flowspec.runtime) { version { require(spoofax2Version) } } // JSGLR (https://github.com/metaborg/jsglr) - api(libs.interpreter.library.jsglr) - api(libs.jsglr) - api(libs.jsglr.shared) - api(libs.jsglr2) + api(libs.interpreter.library.jsglr) { version { require(jsglrVersion) } } + api(libs.jsglr) { version { require(jsglrVersion) } } + api(libs.jsglr.shared) { version { require(jsglrVersion) } } + api(libs.jsglr2) { version { require(jsglrVersion) } } - api(libs.spoofax2.interpreter.library.jsglr) - api(libs.spoofax2.jsglr) - api(libs.spoofax2.jsglr.shared) - api(libs.spoofax2.jsglr2) - api(libs.spoofax2.makepermissive) + api(libs.spoofax2.interpreter.library.jsglr) { version { require(spoofax2Version) } } + api(libs.spoofax2.jsglr) { version { require(spoofax2Version) } } + api(libs.spoofax2.jsglr.shared) { version { require(spoofax2Version) } } + api(libs.spoofax2.jsglr2) { version { require(spoofax2Version) } } + api(libs.spoofax2.makepermissive) { version { require(spoofax2Version) } } // MB Exec (https://github.com/metaborg/mb-exec) - api(libs.interpreter.core) - api(libs.interpreter.library.java) - api(libs.interpreter.library.xml) - api(libs.metaborg.util) - api(libs.util.vfs2) - - api(libs.spoofax2.interpreter.core) - api(libs.spoofax2.interpreter.library.java) - api(libs.spoofax2.interpreter.library.xml) - api(libs.spoofax2.metaborg.util) - api(libs.spoofax2.util.vfs2) + api(libs.interpreter.core) { version { require(mbExecVersion) } } + api(libs.interpreter.library.java) { version { require(mbExecVersion) } } + api(libs.interpreter.library.xml) { version { require(mbExecVersion) } } + api(libs.metaborg.util) { version { require(mbExecVersion) } } + api(libs.util.vfs2) { version { require(mbExecVersion) } } + + api(libs.spoofax2.interpreter.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.interpreter.library.java) { version { require(spoofax2Version) } } + api(libs.spoofax2.interpreter.library.xml) { version { require(spoofax2Version) } } + api(libs.spoofax2.metaborg.util) { version { require(spoofax2Version) } } + api(libs.spoofax2.util.vfs2) { version { require(spoofax2Version) } } // MB Rep (https://github.com/metaborg/mb-rep) - api(libs.interpreter.library.index) - api(libs.spoofax.terms) + api(libs.interpreter.library.index) { version { require(mbRepVersion) } } + api(libs.spoofax.terms) { version { require(mbRepVersion) } } - api(libs.spoofax2.interpreter.library.index) - api(libs.spoofax2.spoofax.terms) + api(libs.spoofax2.interpreter.library.index) { version { require(spoofax2Version) } } + api(libs.spoofax2.spoofax.terms) { version { require(spoofax2Version) } } // NaBL (https://github.com/metaborg/nabl) - api(libs.nabl.praffrayi) - api(libs.nabl.renaming.java) - api(libs.nabl.scopegraph) - api(libs.nabl2.lang) - api(libs.nabl2.runtime) - api(libs.nabl2.shared) - api(libs.nabl2.solver) - api(libs.nabl2.terms) - api(libs.statix.generator) - api(libs.statix.lang) - api(libs.statix.runtime) - api(libs.statix.solver) - - api(libs.spoofax2.nabl.lang) - api(libs.spoofax2.nabl.praffrayi) - api(libs.spoofax2.nabl.renaming.java) - api(libs.spoofax2.nabl.scopegraph) - api(libs.spoofax2.nabl2.extdynsem) - api(libs.spoofax2.nabl2.lang) - api(libs.spoofax2.nabl2.runtime) - api(libs.spoofax2.nabl2.shared) - api(libs.spoofax2.nabl2.solver) - api(libs.spoofax2.nabl2.terms) - api(libs.spoofax2.statix.generator) - api(libs.spoofax2.statix.lang) - api(libs.spoofax2.statix.runtime) - api(libs.spoofax2.statix.solver) - api(libs.spoofax2.ts.lang) + api(libs.nabl.praffrayi) { version { require(nablVersion) } } + api(libs.nabl.renaming.java) { version { require(nablVersion) } } + api(libs.nabl.scopegraph) { version { require(nablVersion) } } + api(libs.nabl2.lang) { version { require(nablVersion) } } + api(libs.nabl2.runtime) { version { require(nablVersion) } } + api(libs.nabl2.shared) { version { require(nablVersion) } } + api(libs.nabl2.solver) { version { require(nablVersion) } } + api(libs.nabl2.terms) { version { require(nablVersion) } } + api(libs.statix.generator) { version { require(nablVersion) } } + api(libs.statix.lang) { version { require(nablVersion) } } + api(libs.statix.runtime) { version { require(nablVersion) } } + api(libs.statix.solver) { version { require(nablVersion) } } + + api(libs.spoofax2.nabl.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl.praffrayi) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl.renaming.java) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl.scopegraph) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.extdynsem) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.runtime) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.shared) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.solver) { version { require(spoofax2Version) } } + api(libs.spoofax2.nabl2.terms) { version { require(spoofax2Version) } } + api(libs.spoofax2.statix.generator) { version { require(spoofax2Version) } } + api(libs.spoofax2.statix.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.statix.runtime) { version { require(spoofax2Version) } } + api(libs.spoofax2.statix.solver) { version { require(spoofax2Version) } } + api(libs.spoofax2.ts.lang) { version { require(spoofax2Version) } } // Runtime Libraries (https://github.com/metaborg/runtime-libraries) - api(libs.spoofax2.meta.lib.analysis) - api(libs.spoofax2.metaborg.runtime.task) + api(libs.spoofax2.meta.lib.analysis) { version { require(spoofax2Version) } } + api(libs.spoofax2.metaborg.runtime.task) { version { require(spoofax2Version) } } // SDF (https://github.com/metaborg/sdf) - api(libs.parsetable) - api(libs.sdf2parenthesize) - api(libs.sdf2table) - api(libs.sdf3.extstatix) - api(libs.sdf3.lang) - - api(libs.spoofax2.parsetable) - api(libs.spoofax2.sdf2parenthesize) - api(libs.spoofax2.sdf2table) - api(libs.spoofax2.sdf3.extstatix) - api(libs.spoofax2.sdf3.lang) + api(libs.parsetable) { version { require(sdfVersion) } } + api(libs.sdf2parenthesize) { version { require(sdfVersion) } } + api(libs.sdf2table) { version { require(sdfVersion) } } + api(libs.sdf3.extstatix) { version { require(sdfVersion) } } + api(libs.sdf3.lang) { version { require(sdfVersion) } } + + api(libs.spoofax2.parsetable) { version { require(spoofax2Version) } } + api(libs.spoofax2.sdf2parenthesize) { version { require(spoofax2Version) } } + api(libs.spoofax2.sdf2table) { version { require(spoofax2Version) } } + api(libs.spoofax2.sdf3.extstatix) { version { require(spoofax2Version) } } + api(libs.spoofax2.sdf3.lang) { version { require(spoofax2Version) } } // Spoofax Core (https://github.com/metaborg/spoofax) - api(libs.meta.lib.spoofax) - api(libs.metaborg.core) - api(libs.metaborg.core.test) - api(libs.metaborg.meta.core) - api(libs.spoofax.core) - api(libs.spoofax.meta.core) - api(libs.spoofax.nativebundle) - - api(libs.spoofax2.meta.lib.spoofax) - api(libs.spoofax2.metaborg.core) - api(libs.spoofax2.metaborg.core.test) - api(libs.spoofax2.metaborg.meta.core) - api(libs.spoofax2.spoofax.core) - api(libs.spoofax2.spoofax.meta.core) - api(libs.spoofax2.spoofax.nativebundle) + api(libs.meta.lib.spoofax) { version { require(spoofaxCoreVersion) } } + api(libs.metaborg.core) { version { require(spoofaxCoreVersion) } } + api(libs.metaborg.core.test) { version { require(spoofaxCoreVersion) } } + api(libs.metaborg.meta.core) { version { require(spoofaxCoreVersion) } } + api(libs.spoofax.core) { version { require(spoofaxCoreVersion) } } + api(libs.spoofax.meta.core) { version { require(spoofaxCoreVersion) } } + api(libs.spoofax.nativebundle) { version { require(spoofaxCoreVersion) } } + + api(libs.spoofax2.meta.lib.spoofax) { version { require(spoofax2Version) } } + api(libs.spoofax2.metaborg.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.metaborg.core.test) { version { require(spoofax2Version) } } + api(libs.spoofax2.metaborg.meta.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.spoofax.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.spoofax.meta.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.spoofax.nativebundle) { version { require(spoofax2Version) } } // Spoofax Gradle (https://github.com/metaborg/spoofax.gradle) - api(libs.spoofax3.gradle) + api(libs.spoofax3.gradle) { version { require(spoofaxGradleVersion) } } // SPT (https://github.com/metaborg/spt) - api(libs.mbt.core) - api(libs.spt.core) - api(libs.spt.lang) + api(libs.mbt.core) { version { require(sptVersion) } } + api(libs.spt.core) { version { require(sptVersion) } } + api(libs.spt.lang) { version { require(sptVersion) } } - api(libs.spoofax2.mbt.core) - api(libs.spoofax2.spt.core) - api(libs.spoofax2.spt.lang) + api(libs.spoofax2.mbt.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.spt.core) { version { require(spoofax2Version) } } + api(libs.spoofax2.spt.lang) { version { require(spoofax2Version) } } // Stratego (https://github.com/metaborg/stratego) - api(libs.stratego.build) - api(libs.stratego.build.spoofax2) - api(libs.stratego.lang) - api(libs.stratego2.lang) + api(libs.stratego.build) { version { require(strategoVersion) } } + api(libs.stratego.build.spoofax2) { version { require(strategoVersion) } } + api(libs.stratego.lang) { version { require(strategoVersion) } } + api(libs.stratego2.lang) { version { require(strategoVersion) } } - api(libs.spoofax2.stratego.build) - api(libs.spoofax2.stratego.build.spoofax2) - api(libs.spoofax2.stratego.lang) - api(libs.spoofax2.stratego2.lang) + api(libs.spoofax2.stratego.build) { version { require(spoofax2Version) } } + api(libs.spoofax2.stratego.build.spoofax2) { version { require(spoofax2Version) } } + api(libs.spoofax2.stratego.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.stratego2.lang) { version { require(spoofax2Version) } } // Stratego XT (https://github.com/metaborg/strategoxt) - api(libs.strategoxt.strj) + api(libs.strategoxt.strj) { version { require(strategoxtVersion) } } - api(libs.spoofax2.strategoxt.jar) - api(libs.spoofax2.strategoxt.minjar) - api(libs.spoofax2.strategoxt.strj) + api(libs.spoofax2.strategoxt.jar) { version { require(spoofax2Version) } } + api(libs.spoofax2.strategoxt.minjar) { version { require(spoofax2Version) } } + api(libs.spoofax2.strategoxt.strj) { version { require(spoofax2Version) } } } } diff --git a/docs/content/index.md b/docs/content/index.md index a8c187d..f1037a8 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -5,3 +5,18 @@ title: "Home" The Metaborg Gradle convention and development plugins. - [Gradle convention plugins](./conventions/index.md) + + + +## Catalog +The `org.metaborg:catalog` artifact provides recommended versions for dependencies, and should be used in projects that are part of Spoofax. It is automatically added to the buildscript classpath by the `org.metaborg.convention.settings` plugin. + +Spoofax dependencies don't have a version specified in the catalog. Therefore, when using Spoofax dependencies, the `org.metaborg:platform` must be applied as follows: + +```kotlin +dependencies { + implementation(platform(libs.metaborg.platform)) + + // ... Spoofax dependencies ... +} +``` \ No newline at end of file From d4bc505977acc9eafad8bfa88f05d92df92e3640 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 22:32:30 +0200 Subject: [PATCH 08/54] Update spoofax.gradle --- depman/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle.properties b/depman/gradle.properties index 9bdc4bc..59f37e3 100644 --- a/depman/gradle.properties +++ b/depman/gradle.properties @@ -27,7 +27,7 @@ sdf.version=0.1.38 # https://github.com/metaborg/spoofax/ spoofax-core.version=0.1.38 # https://github.com/metaborg/spoofax.gradle/ -spoofax-gradle.version=0.1.38 +spoofax-gradle.version=0.1.40 # https://github.com/metaborg/spt/ spt.version=0.1.38 # https://github.com/metaborg/stratego/ From 8487a8b3a9c7878673228f665cbf56f6f5d51318 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 22:40:06 +0200 Subject: [PATCH 09/54] Also update spoofax.gradle in catalog --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 8f8ccb5..75b7135 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,7 +4,7 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -spoofax-gradle = "0.1.38" # https://github.com/metaborg/spoofax.gradle +spoofax-gradle = "0.1.40" # https://github.com/metaborg/spoofax.gradle metaborg-gradle = "0.11.1" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) From 1c2fb8b745f8b2c0275268e0199011db95931454 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 23:41:38 +0200 Subject: [PATCH 10/54] Add Metaborg Git --- depman/gradle.properties | 2 ++ depman/gradle/libs.versions.toml | 3 +++ depman/platform/build.gradle.kts | 4 ++++ example/java-example/build.gradle.kts | 3 +++ 4 files changed, 12 insertions(+) diff --git a/depman/gradle.properties b/depman/gradle.properties index 59f37e3..78e88a1 100644 --- a/depman/gradle.properties +++ b/depman/gradle.properties @@ -1,5 +1,7 @@ # Versions of the Metaborg/Spoofax libraries/languages that are known to work together +# https://github.com/metaborg/metaborg-git/ +metaborg-git.version=0.1.0 # https://github.com/metaborg/common/ metaborg-common.version=0.12.0 # https://github.com/metaborg/log/ diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 75b7135..502635f 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -111,6 +111,9 @@ intellij = { id = "org.jetbrains.intellij", # We don't specify versions here, instead we specify versions in the platform definition. # NOTE: Also update: platform/build.gradle.kts +# Metaborg Git (https://github.com/metaborg/metaborg-git/) +metaborg-git = { module = "org.metaborg:git" } + # Metaborg Common (https://github.com/metaborg/common) metaborg-common = { module = "org.metaborg:common" } diff --git a/depman/platform/build.gradle.kts b/depman/platform/build.gradle.kts index e244599..a635834 100644 --- a/depman/platform/build.gradle.kts +++ b/depman/platform/build.gradle.kts @@ -10,6 +10,7 @@ description = "A Spoofax 3 platform." // Here we use the versions defined in gradle.properties (or using -P on the command line) // to set the versions of the dependencies that should work together. +val metaborgGitVersion: String = property("metaborg-git.version") as String val metaborgCommonVersion: String = property("metaborg-common.version") as String val metaborgLogVersion: String = property("metaborg-log.version") as String val metaborgPieVersion: String = property("metaborg-pie.version") as String @@ -32,6 +33,9 @@ dependencies { constraints { // NOTE: Also update part of libs.versions.toml + // Metaborg Git (https://github.com/metaborg/metaborg-git/) + api(libs.metaborg.git) { version { require(metaborgGitVersion) } } + // Metaborg Common (https://github.com/metaborg/common) api(libs.metaborg.common) { version { require(metaborgCommonVersion) } } diff --git a/example/java-example/build.gradle.kts b/example/java-example/build.gradle.kts index 26a9322..6061c5c 100644 --- a/example/java-example/build.gradle.kts +++ b/example/java-example/build.gradle.kts @@ -35,6 +35,9 @@ repositories { dependencies { implementation(platform(libs.metaborg.platform)) + // Metaborg Git (https://github.com/metaborg/metaborg-git) + api(libs.metaborg.git) + // Metaborg Common (https://github.com/metaborg/common) api(libs.metaborg.common) From 5fd707e60cd03129501b2dfc58959a4d8a9a9554 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 24 Jul 2024 23:58:38 +0200 Subject: [PATCH 11/54] Update org.metaborg:platform --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 502635f..631d2d2 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -5,7 +5,7 @@ gitonium = "1.7.5" # https://github.com foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config spoofax-gradle = "0.1.40" # https://github.com/metaborg/spoofax.gradle -metaborg-gradle = "0.11.1" # https://github.com/metaborg/metaborg-gradle +metaborg-gradle = "0.13.0" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) From e66dd1a7045a2f949df2c4fa351ff6322da55b3a Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 01:05:07 +0200 Subject: [PATCH 12/54] Undo define Spoofax dep versions only in platform We can't put platform constraints on compileLanguage() and sourceLanguage(), so the dependencies must include a version. This reverts commit 7322f43da26789c95de991878179a9d10efeacbb. # Conflicts: # depman/gradle.properties # depman/gradle/libs.versions.toml # depman/platform/build.gradle.kts --- depman/gradle.properties | 38 --- depman/gradle/libs.versions.toml | 447 ++++++++++++++++--------------- depman/platform/build.gradle.kts | 445 +++++++++++++++--------------- docs/content/index.md | 15 -- 4 files changed, 445 insertions(+), 500 deletions(-) delete mode 100644 depman/gradle.properties diff --git a/depman/gradle.properties b/depman/gradle.properties deleted file mode 100644 index 78e88a1..0000000 --- a/depman/gradle.properties +++ /dev/null @@ -1,38 +0,0 @@ -# Versions of the Metaborg/Spoofax libraries/languages that are known to work together - -# https://github.com/metaborg/metaborg-git/ -metaborg-git.version=0.1.0 -# https://github.com/metaborg/common/ -metaborg-common.version=0.12.0 -# https://github.com/metaborg/log/ -metaborg-log.version=0.5.5 -# https://github.com/metaborg/pie/ -metaborg-pie.version=0.21.0 -# https://github.com/metaborg/resource/ -metaborg-resource.version=0.14.1 -# https://github.com/metaborg/spoofax-pie/ -spoofax3.version=0.23.1 -# https://github.com/metaborg/spoofax-releng -spoofax2.version=2.5.21 -# https://github.com/metaborg/esv/ -esv.version=0.1.38 -# https://github.com/metaborg/jsglr/ -jsglr.version=0.1.38 -# https://github.com/metaborg/mb-exec/ -mb-exec.version=0.1.38 -# https://github.com/metaborg/mb-rep/ -mb-rep.version=0.1.38 -# https://github.com/metaborg/nabl/ -nabl.version=0.1.38 -# https://github.com/metaborg/sdf/ -sdf.version=0.1.38 -# https://github.com/metaborg/spoofax/ -spoofax-core.version=0.1.38 -# https://github.com/metaborg/spoofax.gradle/ -spoofax-gradle.version=0.1.40 -# https://github.com/metaborg/spt/ -spt.version=0.1.38 -# https://github.com/metaborg/stratego/ -stratego.version=0.1.38 -# https://github.com/metaborg/strategoxt/ -strategoxt.version=0.1.38 diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 631d2d2..95fc5cd 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,10 +4,30 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -spoofax-gradle = "0.1.40" # https://github.com/metaborg/spoofax.gradle metaborg-gradle = "0.13.0" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) +# Spoofax +metaborg-git = "0.1.0" # https://github.com/metaborg/metaborg-git/ +metaborg-common = "0.12.0" # https://github.com/metaborg/common/ +metaborg-log = "0.5.5" # https://github.com/metaborg/log/ +metaborg-pie = "0.21.0" # https://github.com/metaborg/pie/ +metaborg-resource = "0.14.1" # https://github.com/metaborg/resource/ +spoofax3 = "0.23.1" # https://github.com/metaborg/spoofax-pie/ + +spoofax2 = "2.5.21" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) +esv = "0.1.38" # https://github.com/metaborg/esv/ +jsglr = "0.1.38" # https://github.com/metaborg/jsglr/ +mb-exec = "0.1.38" # https://github.com/metaborg/mb-exec/ +mb-rep = "0.1.38" # https://github.com/metaborg/mb-rep/ +nabl = "0.1.38" # https://github.com/metaborg/nabl/ +sdf = "0.1.38" # https://github.com/metaborg/sdf/ +spoofax-core = "0.1.38" # https://github.com/metaborg/spoofax/ +spoofax-gradle = "0.1.40" # https://github.com/metaborg/spoofax.gradle/ +spt = "0.1.38" # https://github.com/metaborg/spt/ +stratego = "0.1.38" # https://github.com/metaborg/stratego/ +strategoxt = "0.1.38" # https://github.com/metaborg/strategoxt/ + # Kotlin kotlinx-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines @@ -108,267 +128,266 @@ intellij = { id = "org.jetbrains.intellij", [libraries] # The below libraries ARE part of the Spoofax platform definition. -# We don't specify versions here, instead we specify versions in the platform definition. # NOTE: Also update: platform/build.gradle.kts # Metaborg Git (https://github.com/metaborg/metaborg-git/) -metaborg-git = { module = "org.metaborg:git" } +metaborg-git = { module = "org.metaborg:git", version.ref = "metaborg-git" } # Metaborg Common (https://github.com/metaborg/common) -metaborg-common = { module = "org.metaborg:common" } +metaborg-common = { module = "org.metaborg:common", version.ref = "metaborg-common" } # Metaborg Log (https://github.com/metaborg/log) -metaborg-log-api = { module = "org.metaborg:log.api" } -metaborg-log-backend-logback = { module = "org.metaborg:log.backend.logback" } -metaborg-log-backend-slf4j = { module = "org.metaborg:log.backend.slf4j" } -metaborg-log-dagger = { module = "org.metaborg:log.dagger" } +metaborg-log-api = { module = "org.metaborg:log.api", version.ref = "metaborg-log" } +metaborg-log-backend-logback = { module = "org.metaborg:log.backend.logback", version.ref = "metaborg-log" } +metaborg-log-backend-slf4j = { module = "org.metaborg:log.backend.slf4j", version.ref = "metaborg-log" } +metaborg-log-dagger = { module = "org.metaborg:log.dagger", version.ref = "metaborg-log" } # Metaborg PIE (https://github.com/metaborg/pie) -metaborg-pie-api = { module = "org.metaborg:pie.api" } -metaborg-pie-api-test = { module = "org.metaborg:pie.api.test" } -metaborg-pie-dagger = { module = "org.metaborg:pie.dagger" } -metaborg-pie-graph = { module = "org.metaborg:pie.graph" } -metaborg-pie-lang = { module = "org.metaborg:pie.lang" } -metaborg-pie-lang-runtime-java = { module = "org.metaborg:pie.lang.runtime.java" } -metaborg-pie-lang-runtime-kotlin = { module = "org.metaborg:pie.lang.runtime.kotlin" } -metaborg-pie-lang-test = { module = "org.metaborg:pie.lang.test" } -metaborg-pie-runtime = { module = "org.metaborg:pie.runtime" } -metaborg-pie-runtime-test = { module = "org.metaborg:pie.runtime.test" } -metaborg-pie-serde-fst = { module = "org.metaborg:pie.serde.fst" } -metaborg-pie-serde-kryo = { module = "org.metaborg:pie.serde.kryo" } -metaborg-pie-share-coroutine = { module = "org.metaborg:pie.share.coroutine" } -metaborg-pie-store-lmdb = { module = "org.metaborg:pie.store.lmdb" } -metaborg-pie-task-archive = { module = "org.metaborg:pie.task.archive" } -metaborg-pie-task-java = { module = "org.metaborg:pie.task.java" } -metaborg-pie-task-java-ecj = { module = "org.metaborg:pie.task.java.ecj" } -metaborg-pie-taskdefs-guice = { module = "org.metaborg:pie.taskdefs.guice" } +metaborg-pie-api = { module = "org.metaborg:pie.api", version.ref = "metaborg-pie" } +metaborg-pie-api-test = { module = "org.metaborg:pie.api.test", version.ref = "metaborg-pie" } +metaborg-pie-dagger = { module = "org.metaborg:pie.dagger", version.ref = "metaborg-pie" } +metaborg-pie-graph = { module = "org.metaborg:pie.graph", version.ref = "metaborg-pie" } +metaborg-pie-lang = { module = "org.metaborg:pie.lang", version.ref = "metaborg-pie" } +metaborg-pie-lang-runtime-java = { module = "org.metaborg:pie.lang.runtime.java", version.ref = "metaborg-pie" } +metaborg-pie-lang-runtime-kotlin = { module = "org.metaborg:pie.lang.runtime.kotlin", version.ref = "metaborg-pie" } +metaborg-pie-lang-test = { module = "org.metaborg:pie.lang.test", version.ref = "metaborg-pie" } +metaborg-pie-runtime = { module = "org.metaborg:pie.runtime", version.ref = "metaborg-pie" } +metaborg-pie-runtime-test = { module = "org.metaborg:pie.runtime.test", version.ref = "metaborg-pie" } +metaborg-pie-serde-fst = { module = "org.metaborg:pie.serde.fst", version.ref = "metaborg-pie" } +metaborg-pie-serde-kryo = { module = "org.metaborg:pie.serde.kryo", version.ref = "metaborg-pie" } +metaborg-pie-share-coroutine = { module = "org.metaborg:pie.share.coroutine", version.ref = "metaborg-pie" } +metaborg-pie-store-lmdb = { module = "org.metaborg:pie.store.lmdb", version.ref = "metaborg-pie" } +metaborg-pie-task-archive = { module = "org.metaborg:pie.task.archive", version.ref = "metaborg-pie" } +metaborg-pie-task-java = { module = "org.metaborg:pie.task.java", version.ref = "metaborg-pie" } +metaborg-pie-task-java-ecj = { module = "org.metaborg:pie.task.java.ecj", version.ref = "metaborg-pie" } +metaborg-pie-taskdefs-guice = { module = "org.metaborg:pie.taskdefs.guice", version.ref = "metaborg-pie" } # Metaborg Resource (https://github.com/metaborg/resource) -metaborg-resource-api = { module = "org.metaborg:resource" } -metaborg-resource-dagger = { module = "org.metaborg:resource.dagger" } +metaborg-resource-api = { module = "org.metaborg:resource", version.ref = "metaborg-resource" } +metaborg-resource-dagger = { module = "org.metaborg:resource.dagger", version.ref = "metaborg-resource" } # Spoofax 3/PIE (https://github.com/metaborg/spoofax-pie) -spoofax3-aterm-common = { module = "org.metaborg:aterm.common" } -spoofax3-cfg = { module = "org.metaborg:cfg" } -spoofax3-cfg-cli = { module = "org.metaborg:cfg.cli" } # Not published -spoofax3-cfg-eclipse = { module = "org.metaborg:cfg.eclipse" } # Not published -spoofax3-cfg-intellij = { module = "org.metaborg:cfg.intellij" } # Not published -spoofax3-cfg-spoofax2 = { module = "org.metaborg:cfg.spoofax2" } -spoofax3-cli = { module = "org.metaborg:spoofax.cli" } -spoofax3-compiler = { module = "org.metaborg:spoofax.compiler" } -spoofax3-compiler-eclipsebundle = { module = "org.metaborg:spoofax.compiler.eclipsebundle" } -spoofax3-compiler-gradle = { module = "org.metaborg:spoofax.compiler.gradle" } -spoofax3-compiler-gradle-spoofax2 = { module = "org.metaborg:spoofax.compiler.gradle.spoofax2" } -spoofax3-compiler-interfaces = { module = "org.metaborg:spoofax.compiler.interfaces" } -spoofax3-compiler-spoofax2 = { module = "org.metaborg:spoofax.compiler.spoofax2" } -spoofax3-compiler-spoofax2-dagger = { module = "org.metaborg:spoofax.compiler.spoofax2.dagger" } -spoofax3-constraint-common = { module = "org.metaborg:constraint.common" } -spoofax3-constraint-pie = { module = "org.metaborg:constraint.pie" } -spoofax3-core = { module = "org.metaborg:spoofax.core" } -spoofax3-dynamix = { module = "org.metaborg:dynamix" } -spoofax3-dynamix-cli = { module = "org.metaborg:dynamix.cli" } # Not published -spoofax3-dynamix-eclipse = { module = "org.metaborg:dynamix.eclipse" } # Not published -spoofax3-dynamix-intellij = { module = "org.metaborg:dynamix.intellij" } # Not published -spoofax3-dynamix-spoofax2 = { module = "org.metaborg:dynamix.spoofax2" } -spoofax3-eclipse = { module = "org.metaborg:spoofax.eclipse" } -spoofax3-esv = { module = "org.metaborg:esv" } -spoofax3-esv-cli = { module = "org.metaborg:esv.cli" } # Not published -spoofax3-esv-common = { module = "org.metaborg:esv.common" } -spoofax3-esv-eclipse = { module = "org.metaborg:esv.eclipse" } # Not published -spoofax3-esv-intellij = { module = "org.metaborg:esv.intellij" } # Not published -spoofax3-gpp = { module = "org.metaborg:gpp" } -spoofax3-gpp-eclipse = { module = "org.metaborg:gpp.eclipse" } -spoofax3-intellij = { module = "org.metaborg:spoofax.intellij" } -spoofax3-jsglr-common = { module = "org.metaborg:jsglr.common" } -spoofax3-jsglr-pie = { module = "org.metaborg:jsglr.pie" } -spoofax3-jsglr1-common = { module = "org.metaborg:jsglr1.common" } -spoofax3-jsglr2-common = { module = "org.metaborg:jsglr2.common" } -spoofax3-libspoofax2 = { module = "org.metaborg:libspoofax2" } -spoofax3-libspoofax2-eclipse = { module = "org.metaborg:libspoofax2.eclipse" } # Not published -spoofax3-libstatix = { module = "org.metaborg:libstatix" } -spoofax3-libstatix-eclipse = { module = "org.metaborg:libstatix.eclipse" } # Not published -spoofax3-lwb-compiler = { module = "org.metaborg:spoofax.lwb.compiler" } -spoofax3-lwb-compiler-gradle = { module = "org.metaborg:spoofax.lwb.compiler.gradle" } -spoofax3-lwb-dynamicloading = { module = "org.metaborg:spoofax.lwb.dynamicloading" } -spoofax3-nabl2-common = { module = "org.metaborg:nabl2.common" } -spoofax3-resource = { module = "org.metaborg:spoofax.resource" } -spoofax3-sdf3 = { module = "org.metaborg:sdf3" } -spoofax3-sdf3-cli = { module = "org.metaborg:sdf3.cli" } # Not published -spoofax3-sdf3-eclipse = { module = "org.metaborg:sdf3.eclipse" } # Not published -spoofax3-sdf3-extdynamix = { module = "org.metaborg:sdf3_ext_dynamix" } -spoofax3-sdf3-extdynamix-eclipse = { module = "org.metaborg:sdf3_ext_dynamix.eclipse" } # Not published -spoofax3-sdf3-extdynamix-spoofax2 = { module = "org.metaborg:sdf3_ext_dynamix.spoofax2" } -spoofax3-sdf3-extstatix = { module = "org.metaborg:sdf3_ext_statix" } -spoofax3-sdf3-extstatix-eclipse = { module = "org.metaborg:sdf3_ext_statix.eclipse" } # Not published -spoofax3-sdf3-intellij = { module = "org.metaborg:sdf3.intellij" } # Not published -spoofax3-spoofax-common = { module = "org.metaborg:spoofax.common" } -spoofax3-spoofax2-common = { module = "org.metaborg:spoofax2.common" } -spoofax3-spt = { module = "org.metaborg:spt" } -spoofax3-spt-api = { module = "org.metaborg:spt.api" } -spoofax3-spt-cli = { module = "org.metaborg:spt.cli" } # Not published -spoofax3-spt-dynamicloading = { module = "org.metaborg:spt.dynamicloading" } -spoofax3-spt-eclipse = { module = "org.metaborg:spt.eclipse" } # Not published -spoofax3-spt-intellij = { module = "org.metaborg:spt.intellij" } # Not published -spoofax3-statix = { module = "org.metaborg:statix" } -spoofax3-statix-cli = { module = "org.metaborg:statix.cli" } # Not published -spoofax3-statix-codecompletion = { module = "org.metaborg:statix.codecompletion" } -spoofax3-statix-codecompletion-pie = { module = "org.metaborg:statix.codecompletion.pie" } -spoofax3-statix-common = { module = "org.metaborg:statix.common" } -spoofax3-statix-eclipse = { module = "org.metaborg:statix.eclipse" } # Not published -spoofax3-statix-intellij = { module = "org.metaborg:statix.intellij" } # Not published -spoofax3-statix-multilang = { module = "org.metaborg:statix.multilang" } -spoofax3-statix-multilang-eclipse = { module = "org.metaborg:statix.multilang.eclipse" } -spoofax3-statix-pie = { module = "org.metaborg:statix.pie" } -spoofax3-stratego = { module = "org.metaborg:stratego" } -spoofax3-stratego-cli = { module = "org.metaborg:stratego.cli" } # Not published -spoofax3-stratego-common = { module = "org.metaborg:stratego.common" } -spoofax3-stratego-eclipse = { module = "org.metaborg:stratego.eclipse" } # Not published -spoofax3-stratego-intellij = { module = "org.metaborg:stratego.intellij" } # Not published -spoofax3-stratego-pie = { module = "org.metaborg:stratego.pie" } -spoofax3-strategolib = { module = "org.metaborg:strategolib" } -spoofax3-strategolib-eclipse = { module = "org.metaborg:strategolib.eclipse" } -spoofax3-tego-runtime = { module = "org.metaborg:tego.runtime" } -spoofax3-test = { module = "org.metaborg:spoofax.test" } -spoofax3-tooling-eclipsebundle = { module = "org.metaborg:tooling.eclipsebundle" } -spoofax3-transform-pie = { module = "org.metaborg:transform.pie" } +spoofax3-aterm-common = { module = "org.metaborg:aterm.common", version.ref = "spoofax3" } +spoofax3-cfg = { module = "org.metaborg:cfg", version.ref = "spoofax3" } +spoofax3-cfg-cli = { module = "org.metaborg:cfg.cli", version.ref = "spoofax3" } # Not published +spoofax3-cfg-eclipse = { module = "org.metaborg:cfg.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-cfg-intellij = { module = "org.metaborg:cfg.intellij", version.ref = "spoofax3" } # Not published +spoofax3-cfg-spoofax2 = { module = "org.metaborg:cfg.spoofax2", version.ref = "spoofax3" } +spoofax3-cli = { module = "org.metaborg:spoofax.cli", version.ref = "spoofax3" } +spoofax3-compiler = { module = "org.metaborg:spoofax.compiler", version.ref = "spoofax3" } +spoofax3-compiler-eclipsebundle = { module = "org.metaborg:spoofax.compiler.eclipsebundle", version.ref = "spoofax3" } +spoofax3-compiler-gradle = { module = "org.metaborg:spoofax.compiler.gradle", version.ref = "spoofax3" } +spoofax3-compiler-gradle-spoofax2 = { module = "org.metaborg:spoofax.compiler.gradle.spoofax2", version.ref = "spoofax3" } +spoofax3-compiler-interfaces = { module = "org.metaborg:spoofax.compiler.interfaces", version.ref = "spoofax3" } +spoofax3-compiler-spoofax2 = { module = "org.metaborg:spoofax.compiler.spoofax2", version.ref = "spoofax3" } +spoofax3-compiler-spoofax2-dagger = { module = "org.metaborg:spoofax.compiler.spoofax2.dagger", version.ref = "spoofax3" } +spoofax3-constraint-common = { module = "org.metaborg:constraint.common", version.ref = "spoofax3" } +spoofax3-constraint-pie = { module = "org.metaborg:constraint.pie", version.ref = "spoofax3" } +spoofax3-core = { module = "org.metaborg:spoofax.core", version.ref = "spoofax3" } +spoofax3-dynamix = { module = "org.metaborg:dynamix", version.ref = "spoofax3" } +spoofax3-dynamix-cli = { module = "org.metaborg:dynamix.cli", version.ref = "spoofax3" } # Not published +spoofax3-dynamix-eclipse = { module = "org.metaborg:dynamix.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-dynamix-intellij = { module = "org.metaborg:dynamix.intellij", version.ref = "spoofax3" } # Not published +spoofax3-dynamix-spoofax2 = { module = "org.metaborg:dynamix.spoofax2", version.ref = "spoofax3" } +spoofax3-eclipse = { module = "org.metaborg:spoofax.eclipse", version.ref = "spoofax3" } +spoofax3-esv = { module = "org.metaborg:esv", version.ref = "spoofax3" } +spoofax3-esv-cli = { module = "org.metaborg:esv.cli", version.ref = "spoofax3" } # Not published +spoofax3-esv-common = { module = "org.metaborg:esv.common", version.ref = "spoofax3" } +spoofax3-esv-eclipse = { module = "org.metaborg:esv.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-esv-intellij = { module = "org.metaborg:esv.intellij", version.ref = "spoofax3" } # Not published +spoofax3-gpp = { module = "org.metaborg:gpp", version.ref = "spoofax3" } +spoofax3-gpp-eclipse = { module = "org.metaborg:gpp.eclipse", version.ref = "spoofax3" } +spoofax3-intellij = { module = "org.metaborg:spoofax.intellij", version.ref = "spoofax3" } +spoofax3-jsglr-common = { module = "org.metaborg:jsglr.common", version.ref = "spoofax3" } +spoofax3-jsglr-pie = { module = "org.metaborg:jsglr.pie", version.ref = "spoofax3" } +spoofax3-jsglr1-common = { module = "org.metaborg:jsglr1.common", version.ref = "spoofax3" } +spoofax3-jsglr2-common = { module = "org.metaborg:jsglr2.common", version.ref = "spoofax3" } +spoofax3-libspoofax2 = { module = "org.metaborg:libspoofax2", version.ref = "spoofax3" } +spoofax3-libspoofax2-eclipse = { module = "org.metaborg:libspoofax2.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-libstatix = { module = "org.metaborg:libstatix", version.ref = "spoofax3" } +spoofax3-libstatix-eclipse = { module = "org.metaborg:libstatix.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-lwb-compiler = { module = "org.metaborg:spoofax.lwb.compiler", version.ref = "spoofax3" } +spoofax3-lwb-compiler-gradle = { module = "org.metaborg:spoofax.lwb.compiler.gradle", version.ref = "spoofax3" } +spoofax3-lwb-dynamicloading = { module = "org.metaborg:spoofax.lwb.dynamicloading", version.ref = "spoofax3" } +spoofax3-nabl2-common = { module = "org.metaborg:nabl2.common", version.ref = "spoofax3" } +spoofax3-resource = { module = "org.metaborg:spoofax.resource", version.ref = "spoofax3" } +spoofax3-sdf3 = { module = "org.metaborg:sdf3", version.ref = "spoofax3" } +spoofax3-sdf3-cli = { module = "org.metaborg:sdf3.cli", version.ref = "spoofax3" } # Not published +spoofax3-sdf3-eclipse = { module = "org.metaborg:sdf3.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-sdf3-extdynamix = { module = "org.metaborg:sdf3_ext_dynamix", version.ref = "spoofax3" } +spoofax3-sdf3-extdynamix-eclipse = { module = "org.metaborg:sdf3_ext_dynamix.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-sdf3-extdynamix-spoofax2 = { module = "org.metaborg:sdf3_ext_dynamix.spoofax2", version.ref = "spoofax3" } +spoofax3-sdf3-extstatix = { module = "org.metaborg:sdf3_ext_statix", version.ref = "spoofax3" } +spoofax3-sdf3-extstatix-eclipse = { module = "org.metaborg:sdf3_ext_statix.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-sdf3-intellij = { module = "org.metaborg:sdf3.intellij", version.ref = "spoofax3" } # Not published +spoofax3-spoofax-common = { module = "org.metaborg:spoofax.common", version.ref = "spoofax3" } +spoofax3-spoofax2-common = { module = "org.metaborg:spoofax2.common", version.ref = "spoofax3" } +spoofax3-spt = { module = "org.metaborg:spt", version.ref = "spoofax3" } +spoofax3-spt-api = { module = "org.metaborg:spt.api", version.ref = "spoofax3" } +spoofax3-spt-cli = { module = "org.metaborg:spt.cli", version.ref = "spoofax3" } # Not published +spoofax3-spt-dynamicloading = { module = "org.metaborg:spt.dynamicloading", version.ref = "spoofax3" } +spoofax3-spt-eclipse = { module = "org.metaborg:spt.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-spt-intellij = { module = "org.metaborg:spt.intellij", version.ref = "spoofax3" } # Not published +spoofax3-statix = { module = "org.metaborg:statix", version.ref = "spoofax3" } +spoofax3-statix-cli = { module = "org.metaborg:statix.cli", version.ref = "spoofax3" } # Not published +spoofax3-statix-codecompletion = { module = "org.metaborg:statix.codecompletion", version.ref = "spoofax3" } +spoofax3-statix-codecompletion-pie = { module = "org.metaborg:statix.codecompletion.pie", version.ref = "spoofax3" } +spoofax3-statix-common = { module = "org.metaborg:statix.common", version.ref = "spoofax3" } +spoofax3-statix-eclipse = { module = "org.metaborg:statix.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-statix-intellij = { module = "org.metaborg:statix.intellij", version.ref = "spoofax3" } # Not published +spoofax3-statix-multilang = { module = "org.metaborg:statix.multilang", version.ref = "spoofax3" } +spoofax3-statix-multilang-eclipse = { module = "org.metaborg:statix.multilang.eclipse", version.ref = "spoofax3" } +spoofax3-statix-pie = { module = "org.metaborg:statix.pie", version.ref = "spoofax3" } +spoofax3-stratego = { module = "org.metaborg:stratego", version.ref = "spoofax3" } +spoofax3-stratego-cli = { module = "org.metaborg:stratego.cli", version.ref = "spoofax3" } # Not published +spoofax3-stratego-common = { module = "org.metaborg:stratego.common", version.ref = "spoofax3" } +spoofax3-stratego-eclipse = { module = "org.metaborg:stratego.eclipse", version.ref = "spoofax3" } # Not published +spoofax3-stratego-intellij = { module = "org.metaborg:stratego.intellij", version.ref = "spoofax3" } # Not published +spoofax3-stratego-pie = { module = "org.metaborg:stratego.pie", version.ref = "spoofax3" } +spoofax3-strategolib = { module = "org.metaborg:strategolib", version.ref = "spoofax3" } +spoofax3-strategolib-eclipse = { module = "org.metaborg:strategolib.eclipse", version.ref = "spoofax3" } +spoofax3-tego-runtime = { module = "org.metaborg:tego.runtime", version.ref = "spoofax3" } +spoofax3-test = { module = "org.metaborg:spoofax.test", version.ref = "spoofax3" } +spoofax3-tooling-eclipsebundle = { module = "org.metaborg:tooling.eclipsebundle", version.ref = "spoofax3" } +spoofax3-transform-pie = { module = "org.metaborg:transform.pie", version.ref = "spoofax3" } # Dynsem (https://github.com/metaborg/dynsem) -spoofax2-dynsem-lang = { module = "org.metaborg:dynsem" } # No Spoofax 3 build exists +spoofax2-dynsem-lang = { module = "org.metaborg:dynsem", version.ref = "spoofax2" } # No Spoofax 3 build exists # ESV (https://github.com/metaborg/esv) -esv-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.esv" } +esv-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.esv", version.ref = "esv" } -spoofax2-esv-lang = { module = "org.metaborg:org.metaborg.meta.lang.esv" } # Use Spoofax 2 language for bootstrapping +spoofax2-esv-lang = { module = "org.metaborg:org.metaborg.meta.lang.esv", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Flowspec (https://github.com/metaborg/flowspec) -spoofax2-flowspec-runtime = { module = "org.metaborg:flowspec.runtime" } # No Spoofax 3 build exists +spoofax2-flowspec-runtime = { module = "org.metaborg:flowspec.runtime", version.ref = "spoofax2" } # No Spoofax 3 build exists # JSGLR (https://github.com/metaborg/jsglr) -interpreter-library-jsglr = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.jsglr" } -jsglr = { module = "org.metaborg.devenv:org.spoofax.jsglr" } -jsglr-shared = { module = "org.metaborg.devenv:jsglr.shared" } -jsglr2 = { module = "org.metaborg.devenv:org.spoofax.jsglr2" } +interpreter-library-jsglr = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.jsglr", version.ref = "jsglr" } +jsglr = { module = "org.metaborg.devenv:org.spoofax.jsglr", version.ref = "jsglr" } +jsglr-shared = { module = "org.metaborg.devenv:jsglr.shared", version.ref = "jsglr" } +jsglr2 = { module = "org.metaborg.devenv:org.spoofax.jsglr2", version.ref = "jsglr" } -spoofax2-interpreter-library-jsglr = { module = "org.metaborg:org.spoofax.interpreter.library.jsglr" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr = { module = "org.metaborg:org.spoofax.jsglr" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr-shared = { module = "org.metaborg:jsglr.shared" } # Use Spoofax 2 language for bootstrapping -spoofax2-jsglr2 = { module = "org.metaborg:org.spoofax.jsglr2" } # Use Spoofax 2 language for bootstrapping -spoofax2-makepermissive = { module = "org.metaborg:make-permissive" } # No Spoofax 3 build exists +spoofax2-interpreter-library-jsglr = { module = "org.metaborg:org.spoofax.interpreter.library.jsglr", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr = { module = "org.metaborg:org.spoofax.jsglr", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr-shared = { module = "org.metaborg:jsglr.shared", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-jsglr2 = { module = "org.metaborg:org.spoofax.jsglr2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-makepermissive = { module = "org.metaborg:make-permissive", version.ref = "spoofax2" } # No Spoofax 3 build exists # MB Exec (https://github.com/metaborg/mb-exec) -interpreter-core = { module = "org.metaborg.devenv:org.spoofax.interpreter.core" } -interpreter-library-java = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.java" } -interpreter-library-xml = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.xml" } -metaborg-util = { module = "org.metaborg.devenv:org.metaborg.util" } -util-vfs2 = { module = "org.metaborg.devenv:util-vfs2" } - -spoofax2-interpreter-core = { module = "org.metaborg:org.spoofax.interpreter.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-interpreter-library-java = { module = "org.metaborg:org.spoofax.interpreter.library.java" } # Use Spoofax 2 language for bootstrapping -spoofax2-interpreter-library-xml = { module = "org.metaborg:org.spoofax.interpreter.library.xml" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-util = { module = "org.metaborg:org.metaborg.util" } # Use Spoofax 2 language for bootstrapping -spoofax2-util-vfs2 = { module = "org.metaborg:util-vfs2" } # Use Spoofax 2 language for bootstrapping +interpreter-core = { module = "org.metaborg.devenv:org.spoofax.interpreter.core", version.ref = "mb-exec" } +interpreter-library-java = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.java", version.ref = "mb-exec" } +interpreter-library-xml = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.xml", version.ref = "mb-exec" } +metaborg-util = { module = "org.metaborg.devenv:org.metaborg.util", version.ref = "mb-exec" } +util-vfs2 = { module = "org.metaborg.devenv:util-vfs2", version.ref = "mb-exec" } + +spoofax2-interpreter-core = { module = "org.metaborg:org.spoofax.interpreter.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-java = { module = "org.metaborg:org.spoofax.interpreter.library.java", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-xml = { module = "org.metaborg:org.spoofax.interpreter.library.xml", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-util = { module = "org.metaborg:org.metaborg.util", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-util-vfs2 = { module = "org.metaborg:util-vfs2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # MB Rep (https://github.com/metaborg/mb-rep) -interpreter-library-index = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.index" } -spoofax-terms = { module = "org.metaborg.devenv:org.spoofax.terms" } +interpreter-library-index = { module = "org.metaborg.devenv:org.spoofax.interpreter.library.index", version.ref = "mb-rep" } +spoofax-terms = { module = "org.metaborg.devenv:org.spoofax.terms", version.ref = "mb-rep" } -spoofax2-interpreter-library-index = { module = "org.metaborg:org.spoofax.interpreter.library.index" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-terms = { module = "org.metaborg:org.spoofax.terms" } # Use Spoofax 2 language for bootstrapping +spoofax2-interpreter-library-index = { module = "org.metaborg:org.spoofax.interpreter.library.index", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-terms = { module = "org.metaborg:org.spoofax.terms", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # NaBL (https://github.com/metaborg/nabl) -nabl-praffrayi = { module = "org.metaborg.devenv:p_raffrayi" } -nabl-renaming-java = { module = "org.metaborg.devenv:renaming.java" } -nabl-scopegraph = { module = "org.metaborg.devenv:scopegraph" } -nabl2-lang = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.lang" } -nabl2-runtime = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.runtime" } -nabl2-shared = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.shared" } -nabl2-solver = { module = "org.metaborg.devenv:nabl2.solver" } -nabl2-terms = { module = "org.metaborg.devenv:nabl2.terms" } -statix-generator = { module = "org.metaborg.devenv:statix.generator" } -statix-lang = { module = "org.metaborg.devenv:statix.lang" } -statix-runtime = { module = "org.metaborg.devenv:statix.runtime" } -statix-solver = { module = "org.metaborg.devenv:statix.solver" } - -spoofax2-nabl-lang = { module = "org.metaborg:org.metaborg.meta.lang.nabl" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) -spoofax2-nabl-praffrayi = { module = "org.metaborg:p_raffrayi" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl-renaming-java = { module = "org.metaborg:renaming.java" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl-scopegraph = { module = "org.metaborg:scopegraph" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-extdynsem = { module = "org.metaborg:org.metaborg.meta.nabl2.ext.dynsem" } # No Spoofax 3 build exists -spoofax2-nabl2-lang = { module = "org.metaborg:org.metaborg.meta.nabl2.lang" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-runtime = { module = "org.metaborg:org.metaborg.meta.nabl2.runtime" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-shared = { module = "org.metaborg:org.metaborg.meta.nabl2.shared" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-solver = { module = "org.metaborg:nabl2.solver" } # Use Spoofax 2 language for bootstrapping -spoofax2-nabl2-terms = { module = "org.metaborg:nabl2.terms" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-generator = { module = "org.metaborg:statix.generator" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-lang = { module = "org.metaborg:statix.lang" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-runtime = { module = "org.metaborg:statix.runtime" } # Use Spoofax 2 language for bootstrapping -spoofax2-statix-solver = { module = "org.metaborg:statix.solver" } # Use Spoofax 2 language for bootstrapping -spoofax2-ts-lang = { module = "org.metaborg:org.metaborg.meta.lang.ts" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) +nabl-praffrayi = { module = "org.metaborg.devenv:p_raffrayi", version.ref = "nabl" } +nabl-renaming-java = { module = "org.metaborg.devenv:renaming.java", version.ref = "nabl" } +nabl-scopegraph = { module = "org.metaborg.devenv:scopegraph", version.ref = "nabl" } +nabl2-lang = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.lang", version.ref = "nabl" } +nabl2-runtime = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.runtime", version.ref = "nabl" } +nabl2-shared = { module = "org.metaborg.devenv:org.metaborg.meta.nabl2.shared", version.ref = "nabl" } +nabl2-solver = { module = "org.metaborg.devenv:nabl2.solver", version.ref = "nabl" } +nabl2-terms = { module = "org.metaborg.devenv:nabl2.terms", version.ref = "nabl" } +statix-generator = { module = "org.metaborg.devenv:statix.generator", version.ref = "nabl" } +statix-lang = { module = "org.metaborg.devenv:statix.lang", version.ref = "nabl" } +statix-runtime = { module = "org.metaborg.devenv:statix.runtime", version.ref = "nabl" } +statix-solver = { module = "org.metaborg.devenv:statix.solver", version.ref = "nabl" } + +spoofax2-nabl-lang = { module = "org.metaborg:org.metaborg.meta.lang.nabl", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) +spoofax2-nabl-praffrayi = { module = "org.metaborg:p_raffrayi", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl-renaming-java = { module = "org.metaborg:renaming.java", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl-scopegraph = { module = "org.metaborg:scopegraph", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-extdynsem = { module = "org.metaborg:org.metaborg.meta.nabl2.ext.dynsem", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-nabl2-lang = { module = "org.metaborg:org.metaborg.meta.nabl2.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-runtime = { module = "org.metaborg:org.metaborg.meta.nabl2.runtime", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-shared = { module = "org.metaborg:org.metaborg.meta.nabl2.shared", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-solver = { module = "org.metaborg:nabl2.solver", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-nabl2-terms = { module = "org.metaborg:nabl2.terms", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-generator = { module = "org.metaborg:statix.generator", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-lang = { module = "org.metaborg:statix.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-runtime = { module = "org.metaborg:statix.runtime", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-statix-solver = { module = "org.metaborg:statix.solver", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-ts-lang = { module = "org.metaborg:org.metaborg.meta.lang.ts", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping (no Spoofax 3 build exists) # Runtime Libraries (https://github.com/metaborg/runtime-libraries) -spoofax2-meta-lib-analysis = { module = "org.metaborg:org.metaborg.meta.lib.analysis" } # No Spoofax 3 build exists -spoofax2-metaborg-runtime-task = { module = "org.metaborg:org.metaborg.runtime.task" } # No Spoofax 3 build exists +spoofax2-meta-lib-analysis = { module = "org.metaborg:org.metaborg.meta.lib.analysis", version.ref = "spoofax2" } # No Spoofax 3 build exists +spoofax2-metaborg-runtime-task = { module = "org.metaborg:org.metaborg.runtime.task", version.ref = "spoofax2" } # No Spoofax 3 build exists # SDF (https://github.com/metaborg/sdf) -parsetable = { module = "org.metaborg.devenv:org.metaborg.parsetable" } -sdf2parenthesize = { module = "org.metaborg.devenv:sdf2parenthesize" } -sdf2table = { module = "org.metaborg.devenv:sdf2table" } -sdf3-extstatix = { module = "org.metaborg.devenv:sdf3.ext.statix" } -sdf3-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.template" } - -spoofax2-parsetable = { module = "org.metaborg:org.metaborg.parsetable" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf2parenthesize = { module = "org.metaborg:sdf2parenthesize" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf2table = { module = "org.metaborg:sdf2table" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf3-extstatix = { module = "org.metaborg:sdf3.ext.statix" } # Use Spoofax 2 language for bootstrapping -spoofax2-sdf3-lang = { module = "org.metaborg:org.metaborg.meta.lang.template" } # Use Spoofax 2 language for bootstrapping +parsetable = { module = "org.metaborg.devenv:org.metaborg.parsetable", version.ref = "sdf" } +sdf2parenthesize = { module = "org.metaborg.devenv:sdf2parenthesize", version.ref = "sdf" } +sdf2table = { module = "org.metaborg.devenv:sdf2table", version.ref = "sdf" } +sdf3-extstatix = { module = "org.metaborg.devenv:sdf3.ext.statix", version.ref = "sdf" } +sdf3-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.template", version.ref = "sdf" } + +spoofax2-parsetable = { module = "org.metaborg:org.metaborg.parsetable", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf2parenthesize = { module = "org.metaborg:sdf2parenthesize", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf2table = { module = "org.metaborg:sdf2table", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf3-extstatix = { module = "org.metaborg:sdf3.ext.statix", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-sdf3-lang = { module = "org.metaborg:org.metaborg.meta.lang.template", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Spoofax Core (https://github.com/metaborg/spoofax) -meta-lib-spoofax = { module = "org.metaborg.devenv:meta.lib.spoofax" } -metaborg-core = { module = "org.metaborg.devenv:org.metaborg.core" } -metaborg-core-test = { module = "org.metaborg.devenv:org.metaborg.core.test" } -metaborg-meta-core = { module = "org.metaborg.devenv:org.metaborg.meta.core" } -spoofax-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.core" } -spoofax-meta-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.meta.core" } -spoofax-nativebundle = { module = "org.metaborg.devenv:org.metaborg.spoofax.nativebundle" } - -spoofax2-meta-lib-spoofax = { module = "org.metaborg:meta.lib.spoofax" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-core = { module = "org.metaborg:org.metaborg.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-core-test = { module = "org.metaborg:org.metaborg.core.test" } # Use Spoofax 2 language for bootstrapping -spoofax2-metaborg-meta-core = { module = "org.metaborg:org.metaborg.meta.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-core = { module = "org.metaborg:org.metaborg.spoofax.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-meta-core = { module = "org.metaborg:org.metaborg.spoofax.meta.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-spoofax-nativebundle = { module = "org.metaborg:org.metaborg.spoofax.nativebundle" } # Use Spoofax 2 language for bootstrapping +meta-lib-spoofax = { module = "org.metaborg.devenv:meta.lib.spoofax", version.ref = "spoofax-core" } +metaborg-core = { module = "org.metaborg.devenv:org.metaborg.core", version.ref = "spoofax-core" } +metaborg-core-test = { module = "org.metaborg.devenv:org.metaborg.core.test", version.ref = "spoofax-core" } +metaborg-meta-core = { module = "org.metaborg.devenv:org.metaborg.meta.core", version.ref = "spoofax-core" } +spoofax-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.core", version.ref = "spoofax-core" } +spoofax-meta-core = { module = "org.metaborg.devenv:org.metaborg.spoofax.meta.core", version.ref = "spoofax-core" } +spoofax-nativebundle = { module = "org.metaborg.devenv:org.metaborg.spoofax.nativebundle", version.ref = "spoofax-core" } + +spoofax2-meta-lib-spoofax = { module = "org.metaborg:meta.lib.spoofax", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-core = { module = "org.metaborg:org.metaborg.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-core-test = { module = "org.metaborg:org.metaborg.core.test", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-metaborg-meta-core = { module = "org.metaborg:org.metaborg.meta.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-core = { module = "org.metaborg:org.metaborg.spoofax.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-meta-core = { module = "org.metaborg:org.metaborg.spoofax.meta.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spoofax-nativebundle = { module = "org.metaborg:org.metaborg.spoofax.nativebundle", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Spoofax Gradle (https://github.com/metaborg/spoofax.gradle) -spoofax3-gradle = { module = "org.metaborg.devenv:spoofax.gradle" } +spoofax3-gradle = { module = "org.metaborg.devenv:spoofax.gradle", version.ref = "spoofax-gradle" } # SPT (https://github.com/metaborg/spt) -mbt-core = { module = "org.metaborg.devenv:org.metaborg.mbt.core" } -spt-core = { module = "org.metaborg.devenv:org.metaborg.spt.core" } -spt-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.spt" } +mbt-core = { module = "org.metaborg.devenv:org.metaborg.mbt.core", version.ref = "spt" } +spt-core = { module = "org.metaborg.devenv:org.metaborg.spt.core", version.ref = "spt" } +spt-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.spt", version.ref = "spt" } -spoofax2-mbt-core = { module = "org.metaborg:org.metaborg.mbt.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-spt-core = { module = "org.metaborg:org.metaborg.spt.core" } # Use Spoofax 2 language for bootstrapping -spoofax2-spt-lang = { module = "org.metaborg:org.metaborg.meta.lang.spt" } # Use Spoofax 2 language for bootstrapping +spoofax2-mbt-core = { module = "org.metaborg:org.metaborg.mbt.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spt-core = { module = "org.metaborg:org.metaborg.spt.core", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-spt-lang = { module = "org.metaborg:org.metaborg.meta.lang.spt", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Stratego (https://github.com/metaborg/stratego) -stratego-build = { module = "org.metaborg.devenv:stratego.build" } -stratego-build-spoofax2 = { module = "org.metaborg.devenv:stratego.build.spoofax2" } -stratego-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.stratego" } -stratego2-lang = { module = "org.metaborg.devenv:stratego.lang" } +stratego-build = { module = "org.metaborg.devenv:stratego.build", version.ref = "stratego" } +stratego-build-spoofax2 = { module = "org.metaborg.devenv:stratego.build.spoofax2", version.ref = "stratego" } +stratego-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.stratego", version.ref = "stratego" } +stratego2-lang = { module = "org.metaborg.devenv:stratego.lang", version.ref = "stratego" } -spoofax2-stratego-build = { module = "org.metaborg:stratego.build" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego-build-spoofax2 = { module = "org.metaborg:stratego.build.spoofax2" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego-lang = { module = "org.metaborg:org.metaborg.meta.lang.stratego" } # Use Spoofax 2 language for bootstrapping -spoofax2-stratego2-lang = { module = "org.metaborg:stratego.lang" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-build = { module = "org.metaborg:stratego.build", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-build-spoofax2 = { module = "org.metaborg:stratego.build.spoofax2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego-lang = { module = "org.metaborg:org.metaborg.meta.lang.stratego", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-stratego2-lang = { module = "org.metaborg:stratego.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Stratego XT (https://github.com/metaborg/strategoxt) -strategoxt-strj = { module = "org.metaborg.devenv:org.strategoxt.strj" } +strategoxt-strj = { module = "org.metaborg.devenv:org.strategoxt.strj", version.ref = "strategoxt" } -spoofax2-strategoxt-jar = { module = "org.metaborg:strategoxt-jar" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? -spoofax2-strategoxt-minjar = { module = "org.metaborg:strategoxt-min-jar" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? -spoofax2-strategoxt-strj = { module = "org.metaborg:org.strategoxt.strj" } # Use Spoofax 2 language for bootstrapping +spoofax2-strategoxt-jar = { module = "org.metaborg:strategoxt-jar", version.ref = "spoofax2" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? +spoofax2-strategoxt-minjar = { module = "org.metaborg:strategoxt-min-jar", version.ref = "spoofax2" } # TODO: Should this be prefixed with strategoxt? Should this be built by the StrategoXT repo Gradle? +spoofax2-strategoxt-strj = { module = "org.metaborg:org.strategoxt.strj", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping diff --git a/depman/platform/build.gradle.kts b/depman/platform/build.gradle.kts index a635834..881c1da 100644 --- a/depman/platform/build.gradle.kts +++ b/depman/platform/build.gradle.kts @@ -8,289 +8,268 @@ plugins { group = "org.metaborg" description = "A Spoofax 3 platform." -// Here we use the versions defined in gradle.properties (or using -P on the command line) -// to set the versions of the dependencies that should work together. -val metaborgGitVersion: String = property("metaborg-git.version") as String -val metaborgCommonVersion: String = property("metaborg-common.version") as String -val metaborgLogVersion: String = property("metaborg-log.version") as String -val metaborgPieVersion: String = property("metaborg-pie.version") as String -val metaborgResourceVersion: String = property("metaborg-resource.version") as String -val spoofax3Version: String = property("spoofax3.version") as String -val spoofax2Version: String = property("spoofax2.version") as String -val esvVersion: String = property("esv.version") as String -val jsglrVersion: String = property("jsglr.version") as String -val mbExecVersion: String = property("mb-exec.version") as String -val mbRepVersion: String = property("mb-rep.version") as String -val nablVersion: String = property("nabl.version") as String -val sdfVersion: String = property("sdf.version") as String -val spoofaxCoreVersion: String = property("spoofax-core.version") as String -val spoofaxGradleVersion: String = property("spoofax-gradle.version") as String -val sptVersion: String = property("spt.version") as String -val strategoVersion: String = property("stratego.version") as String -val strategoxtVersion: String = property("strategoxt.version") as String - dependencies { constraints { // NOTE: Also update part of libs.versions.toml // Metaborg Git (https://github.com/metaborg/metaborg-git/) - api(libs.metaborg.git) { version { require(metaborgGitVersion) } } + api(libs.metaborg.git) // Metaborg Common (https://github.com/metaborg/common) - api(libs.metaborg.common) { version { require(metaborgCommonVersion) } } + api(libs.metaborg.common) // Metaborg Log (https://github.com/metaborg/log) - api(libs.metaborg.log.api) { version { require(metaborgLogVersion) } } - api(libs.metaborg.log.backend.logback) { version { require(metaborgLogVersion) } } - api(libs.metaborg.log.backend.slf4j) { version { require(metaborgLogVersion) } } - api(libs.metaborg.log.dagger) { version { require(metaborgLogVersion) } } + api(libs.metaborg.log.api) + api(libs.metaborg.log.backend.logback) + api(libs.metaborg.log.backend.slf4j) + api(libs.metaborg.log.dagger) // Metaborg PIE (https://github.com/metaborg/pie) - api(libs.metaborg.pie.api) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.api.test) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.dagger) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.graph) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.lang) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.lang.runtime.java) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.lang.runtime.kotlin) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.lang.test) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.runtime) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.runtime.test) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.serde.fst) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.serde.kryo) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.share.coroutine) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.store.lmdb) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.task.archive) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.task.java) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.task.java.ecj) { version { require(metaborgPieVersion) } } - api(libs.metaborg.pie.taskdefs.guice) { version { require(metaborgPieVersion) } } + api(libs.metaborg.pie.api) + api(libs.metaborg.pie.api.test) + api(libs.metaborg.pie.dagger) + api(libs.metaborg.pie.graph) + api(libs.metaborg.pie.lang) + api(libs.metaborg.pie.lang.runtime.java) + api(libs.metaborg.pie.lang.runtime.kotlin) + api(libs.metaborg.pie.lang.test) + api(libs.metaborg.pie.runtime) + api(libs.metaborg.pie.runtime.test) + api(libs.metaborg.pie.serde.fst) + api(libs.metaborg.pie.serde.kryo) + api(libs.metaborg.pie.share.coroutine) + api(libs.metaborg.pie.store.lmdb) + api(libs.metaborg.pie.task.archive) + api(libs.metaborg.pie.task.java) + api(libs.metaborg.pie.task.java.ecj) + api(libs.metaborg.pie.taskdefs.guice) // Metaborg Resource (https://github.com/metaborg/resource) - api(libs.metaborg.resource.api) { version { require(metaborgResourceVersion) } } - api(libs.metaborg.resource.dagger) { version { require(metaborgResourceVersion) } } + api(libs.metaborg.resource.api) + api(libs.metaborg.resource.dagger) // Spoofax 3/PIE (https://github.com/metaborg/spoofax-pie) - api(libs.spoofax3.aterm.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.cfg) { version { require(spoofax3Version) } } - api(libs.spoofax3.cfg.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.cfg.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.cfg.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.cfg.spoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.eclipsebundle) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.gradle) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.gradle.spoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.interfaces) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.spoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.compiler.spoofax2.dagger) { version { require(spoofax3Version) } } - api(libs.spoofax3.constraint.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.constraint.pie) { version { require(spoofax3Version) } } - api(libs.spoofax3.core) { version { require(spoofax3Version) } } - api(libs.spoofax3.dynamix) { version { require(spoofax3Version) } } - api(libs.spoofax3.dynamix.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.dynamix.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.dynamix.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.dynamix.spoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.esv) { version { require(spoofax3Version) } } - api(libs.spoofax3.esv.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.esv.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.esv.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.esv.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.gpp) { version { require(spoofax3Version) } } - api(libs.spoofax3.gpp.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.jsglr.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.jsglr.pie) { version { require(spoofax3Version) } } - api(libs.spoofax3.jsglr1.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.jsglr2.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.libspoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.libspoofax2.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.libstatix) { version { require(spoofax3Version) } } - api(libs.spoofax3.libstatix.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.lwb.compiler) { version { require(spoofax3Version) } } - api(libs.spoofax3.lwb.compiler.gradle) { version { require(spoofax3Version) } } - api(libs.spoofax3.lwb.dynamicloading) { version { require(spoofax3Version) } } - api(libs.spoofax3.nabl2.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.resource) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.extdynamix) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.extdynamix.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.extdynamix.spoofax2) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.extstatix) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.extstatix.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.sdf3.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.spoofax.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.spoofax2.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt.api) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt.dynamicloading) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.spt.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.codecompletion) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.codecompletion.pie) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.multilang) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.multilang.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.statix.pie) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego.cli) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego.common) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego.intellij) { version { require(spoofax3Version) } } - api(libs.spoofax3.stratego.pie) { version { require(spoofax3Version) } } - api(libs.spoofax3.strategolib) { version { require(spoofax3Version) } } - api(libs.spoofax3.strategolib.eclipse) { version { require(spoofax3Version) } } - api(libs.spoofax3.tego.runtime) { version { require(spoofax3Version) } } - api(libs.spoofax3.test) { version { require(spoofax3Version) } } - api(libs.spoofax3.tooling.eclipsebundle) { version { require(spoofax3Version) } } - api(libs.spoofax3.transform.pie) { version { require(spoofax3Version) } } + api(libs.spoofax3.aterm.common) + api(libs.spoofax3.cfg) + api(libs.spoofax3.cfg.cli) + api(libs.spoofax3.cfg.eclipse) + api(libs.spoofax3.cfg.intellij) + api(libs.spoofax3.cfg.spoofax2) + api(libs.spoofax3.cli) + api(libs.spoofax3.compiler) + api(libs.spoofax3.compiler.eclipsebundle) + api(libs.spoofax3.compiler.gradle) + api(libs.spoofax3.compiler.gradle.spoofax2) + api(libs.spoofax3.compiler.interfaces) + api(libs.spoofax3.compiler.spoofax2) + api(libs.spoofax3.compiler.spoofax2.dagger) + api(libs.spoofax3.constraint.common) + api(libs.spoofax3.constraint.pie) + api(libs.spoofax3.core) + api(libs.spoofax3.dynamix) + api(libs.spoofax3.dynamix.cli) + api(libs.spoofax3.dynamix.eclipse) + api(libs.spoofax3.dynamix.intellij) + api(libs.spoofax3.dynamix.spoofax2) + api(libs.spoofax3.eclipse) + api(libs.spoofax3.esv) + api(libs.spoofax3.esv.cli) + api(libs.spoofax3.esv.common) + api(libs.spoofax3.esv.eclipse) + api(libs.spoofax3.esv.intellij) + api(libs.spoofax3.gpp) + api(libs.spoofax3.gpp.eclipse) + api(libs.spoofax3.intellij) + api(libs.spoofax3.jsglr.common) + api(libs.spoofax3.jsglr.pie) + api(libs.spoofax3.jsglr1.common) + api(libs.spoofax3.jsglr2.common) + api(libs.spoofax3.libspoofax2) + api(libs.spoofax3.libspoofax2.eclipse) + api(libs.spoofax3.libstatix) + api(libs.spoofax3.libstatix.eclipse) + api(libs.spoofax3.lwb.compiler) + api(libs.spoofax3.lwb.compiler.gradle) + api(libs.spoofax3.lwb.dynamicloading) + api(libs.spoofax3.nabl2.common) + api(libs.spoofax3.resource) + api(libs.spoofax3.sdf3) + api(libs.spoofax3.sdf3.cli) + api(libs.spoofax3.sdf3.eclipse) + api(libs.spoofax3.sdf3.extdynamix) + api(libs.spoofax3.sdf3.extdynamix.eclipse) + api(libs.spoofax3.sdf3.extdynamix.spoofax2) + api(libs.spoofax3.sdf3.extstatix) + api(libs.spoofax3.sdf3.extstatix.eclipse) + api(libs.spoofax3.sdf3.intellij) + api(libs.spoofax3.spoofax.common) + api(libs.spoofax3.spoofax2.common) + api(libs.spoofax3.spt) + api(libs.spoofax3.spt.api) + api(libs.spoofax3.spt.cli) + api(libs.spoofax3.spt.dynamicloading) + api(libs.spoofax3.spt.eclipse) + api(libs.spoofax3.spt.intellij) + api(libs.spoofax3.statix) + api(libs.spoofax3.statix.cli) + api(libs.spoofax3.statix.codecompletion) + api(libs.spoofax3.statix.codecompletion.pie) + api(libs.spoofax3.statix.common) + api(libs.spoofax3.statix.eclipse) + api(libs.spoofax3.statix.intellij) + api(libs.spoofax3.statix.multilang) + api(libs.spoofax3.statix.multilang.eclipse) + api(libs.spoofax3.statix.pie) + api(libs.spoofax3.stratego) + api(libs.spoofax3.stratego.cli) + api(libs.spoofax3.stratego.common) + api(libs.spoofax3.stratego.eclipse) + api(libs.spoofax3.stratego.intellij) + api(libs.spoofax3.stratego.pie) + api(libs.spoofax3.strategolib) + api(libs.spoofax3.strategolib.eclipse) + api(libs.spoofax3.tego.runtime) + api(libs.spoofax3.test) + api(libs.spoofax3.tooling.eclipsebundle) + api(libs.spoofax3.transform.pie) // Dynsem (https://github.com/metaborg/dynsem) - api(libs.spoofax2.dynsem.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.dynsem.lang) // ESV (https://github.com/metaborg/esv) - api(libs.esv.lang) { version { require(esvVersion) } } + api(libs.esv.lang) - api(libs.spoofax2.esv.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.esv.lang) // Flowspec (https://github.com/metaborg/flowspec) - api(libs.spoofax2.flowspec.runtime) { version { require(spoofax2Version) } } + api(libs.spoofax2.flowspec.runtime) // JSGLR (https://github.com/metaborg/jsglr) - api(libs.interpreter.library.jsglr) { version { require(jsglrVersion) } } - api(libs.jsglr) { version { require(jsglrVersion) } } - api(libs.jsglr.shared) { version { require(jsglrVersion) } } - api(libs.jsglr2) { version { require(jsglrVersion) } } + api(libs.interpreter.library.jsglr) + api(libs.jsglr) + api(libs.jsglr.shared) + api(libs.jsglr2) - api(libs.spoofax2.interpreter.library.jsglr) { version { require(spoofax2Version) } } - api(libs.spoofax2.jsglr) { version { require(spoofax2Version) } } - api(libs.spoofax2.jsglr.shared) { version { require(spoofax2Version) } } - api(libs.spoofax2.jsglr2) { version { require(spoofax2Version) } } - api(libs.spoofax2.makepermissive) { version { require(spoofax2Version) } } + api(libs.spoofax2.interpreter.library.jsglr) + api(libs.spoofax2.jsglr) + api(libs.spoofax2.jsglr.shared) + api(libs.spoofax2.jsglr2) + api(libs.spoofax2.makepermissive) // MB Exec (https://github.com/metaborg/mb-exec) - api(libs.interpreter.core) { version { require(mbExecVersion) } } - api(libs.interpreter.library.java) { version { require(mbExecVersion) } } - api(libs.interpreter.library.xml) { version { require(mbExecVersion) } } - api(libs.metaborg.util) { version { require(mbExecVersion) } } - api(libs.util.vfs2) { version { require(mbExecVersion) } } - - api(libs.spoofax2.interpreter.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.interpreter.library.java) { version { require(spoofax2Version) } } - api(libs.spoofax2.interpreter.library.xml) { version { require(spoofax2Version) } } - api(libs.spoofax2.metaborg.util) { version { require(spoofax2Version) } } - api(libs.spoofax2.util.vfs2) { version { require(spoofax2Version) } } + api(libs.interpreter.core) + api(libs.interpreter.library.java) + api(libs.interpreter.library.xml) + api(libs.metaborg.util) + api(libs.util.vfs2) + + api(libs.spoofax2.interpreter.core) + api(libs.spoofax2.interpreter.library.java) + api(libs.spoofax2.interpreter.library.xml) + api(libs.spoofax2.metaborg.util) + api(libs.spoofax2.util.vfs2) // MB Rep (https://github.com/metaborg/mb-rep) - api(libs.interpreter.library.index) { version { require(mbRepVersion) } } - api(libs.spoofax.terms) { version { require(mbRepVersion) } } + api(libs.interpreter.library.index) + api(libs.spoofax.terms) - api(libs.spoofax2.interpreter.library.index) { version { require(spoofax2Version) } } - api(libs.spoofax2.spoofax.terms) { version { require(spoofax2Version) } } + api(libs.spoofax2.interpreter.library.index) + api(libs.spoofax2.spoofax.terms) // NaBL (https://github.com/metaborg/nabl) - api(libs.nabl.praffrayi) { version { require(nablVersion) } } - api(libs.nabl.renaming.java) { version { require(nablVersion) } } - api(libs.nabl.scopegraph) { version { require(nablVersion) } } - api(libs.nabl2.lang) { version { require(nablVersion) } } - api(libs.nabl2.runtime) { version { require(nablVersion) } } - api(libs.nabl2.shared) { version { require(nablVersion) } } - api(libs.nabl2.solver) { version { require(nablVersion) } } - api(libs.nabl2.terms) { version { require(nablVersion) } } - api(libs.statix.generator) { version { require(nablVersion) } } - api(libs.statix.lang) { version { require(nablVersion) } } - api(libs.statix.runtime) { version { require(nablVersion) } } - api(libs.statix.solver) { version { require(nablVersion) } } - - api(libs.spoofax2.nabl.lang) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl.praffrayi) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl.renaming.java) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl.scopegraph) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.extdynsem) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.lang) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.runtime) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.shared) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.solver) { version { require(spoofax2Version) } } - api(libs.spoofax2.nabl2.terms) { version { require(spoofax2Version) } } - api(libs.spoofax2.statix.generator) { version { require(spoofax2Version) } } - api(libs.spoofax2.statix.lang) { version { require(spoofax2Version) } } - api(libs.spoofax2.statix.runtime) { version { require(spoofax2Version) } } - api(libs.spoofax2.statix.solver) { version { require(spoofax2Version) } } - api(libs.spoofax2.ts.lang) { version { require(spoofax2Version) } } + api(libs.nabl.praffrayi) + api(libs.nabl.renaming.java) + api(libs.nabl.scopegraph) + api(libs.nabl2.lang) + api(libs.nabl2.runtime) + api(libs.nabl2.shared) + api(libs.nabl2.solver) + api(libs.nabl2.terms) + api(libs.statix.generator) + api(libs.statix.lang) + api(libs.statix.runtime) + api(libs.statix.solver) + + api(libs.spoofax2.nabl.lang) + api(libs.spoofax2.nabl.praffrayi) + api(libs.spoofax2.nabl.renaming.java) + api(libs.spoofax2.nabl.scopegraph) + api(libs.spoofax2.nabl2.extdynsem) + api(libs.spoofax2.nabl2.lang) + api(libs.spoofax2.nabl2.runtime) + api(libs.spoofax2.nabl2.shared) + api(libs.spoofax2.nabl2.solver) + api(libs.spoofax2.nabl2.terms) + api(libs.spoofax2.statix.generator) + api(libs.spoofax2.statix.lang) + api(libs.spoofax2.statix.runtime) + api(libs.spoofax2.statix.solver) + api(libs.spoofax2.ts.lang) // Runtime Libraries (https://github.com/metaborg/runtime-libraries) - api(libs.spoofax2.meta.lib.analysis) { version { require(spoofax2Version) } } - api(libs.spoofax2.metaborg.runtime.task) { version { require(spoofax2Version) } } + api(libs.spoofax2.meta.lib.analysis) + api(libs.spoofax2.metaborg.runtime.task) // SDF (https://github.com/metaborg/sdf) - api(libs.parsetable) { version { require(sdfVersion) } } - api(libs.sdf2parenthesize) { version { require(sdfVersion) } } - api(libs.sdf2table) { version { require(sdfVersion) } } - api(libs.sdf3.extstatix) { version { require(sdfVersion) } } - api(libs.sdf3.lang) { version { require(sdfVersion) } } - - api(libs.spoofax2.parsetable) { version { require(spoofax2Version) } } - api(libs.spoofax2.sdf2parenthesize) { version { require(spoofax2Version) } } - api(libs.spoofax2.sdf2table) { version { require(spoofax2Version) } } - api(libs.spoofax2.sdf3.extstatix) { version { require(spoofax2Version) } } - api(libs.spoofax2.sdf3.lang) { version { require(spoofax2Version) } } + api(libs.parsetable) + api(libs.sdf2parenthesize) + api(libs.sdf2table) + api(libs.sdf3.extstatix) + api(libs.sdf3.lang) + + api(libs.spoofax2.parsetable) + api(libs.spoofax2.sdf2parenthesize) + api(libs.spoofax2.sdf2table) + api(libs.spoofax2.sdf3.extstatix) + api(libs.spoofax2.sdf3.lang) // Spoofax Core (https://github.com/metaborg/spoofax) - api(libs.meta.lib.spoofax) { version { require(spoofaxCoreVersion) } } - api(libs.metaborg.core) { version { require(spoofaxCoreVersion) } } - api(libs.metaborg.core.test) { version { require(spoofaxCoreVersion) } } - api(libs.metaborg.meta.core) { version { require(spoofaxCoreVersion) } } - api(libs.spoofax.core) { version { require(spoofaxCoreVersion) } } - api(libs.spoofax.meta.core) { version { require(spoofaxCoreVersion) } } - api(libs.spoofax.nativebundle) { version { require(spoofaxCoreVersion) } } - - api(libs.spoofax2.meta.lib.spoofax) { version { require(spoofax2Version) } } - api(libs.spoofax2.metaborg.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.metaborg.core.test) { version { require(spoofax2Version) } } - api(libs.spoofax2.metaborg.meta.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.spoofax.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.spoofax.meta.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.spoofax.nativebundle) { version { require(spoofax2Version) } } + api(libs.meta.lib.spoofax) + api(libs.metaborg.core) + api(libs.metaborg.core.test) + api(libs.metaborg.meta.core) + api(libs.spoofax.core) + api(libs.spoofax.meta.core) + api(libs.spoofax.nativebundle) + + api(libs.spoofax2.meta.lib.spoofax) + api(libs.spoofax2.metaborg.core) + api(libs.spoofax2.metaborg.core.test) + api(libs.spoofax2.metaborg.meta.core) + api(libs.spoofax2.spoofax.core) + api(libs.spoofax2.spoofax.meta.core) + api(libs.spoofax2.spoofax.nativebundle) // Spoofax Gradle (https://github.com/metaborg/spoofax.gradle) - api(libs.spoofax3.gradle) { version { require(spoofaxGradleVersion) } } + api(libs.spoofax3.gradle) // SPT (https://github.com/metaborg/spt) - api(libs.mbt.core) { version { require(sptVersion) } } - api(libs.spt.core) { version { require(sptVersion) } } - api(libs.spt.lang) { version { require(sptVersion) } } + api(libs.mbt.core) + api(libs.spt.core) + api(libs.spt.lang) - api(libs.spoofax2.mbt.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.spt.core) { version { require(spoofax2Version) } } - api(libs.spoofax2.spt.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.mbt.core) + api(libs.spoofax2.spt.core) + api(libs.spoofax2.spt.lang) // Stratego (https://github.com/metaborg/stratego) - api(libs.stratego.build) { version { require(strategoVersion) } } - api(libs.stratego.build.spoofax2) { version { require(strategoVersion) } } - api(libs.stratego.lang) { version { require(strategoVersion) } } - api(libs.stratego2.lang) { version { require(strategoVersion) } } + api(libs.stratego.build) + api(libs.stratego.build.spoofax2) + api(libs.stratego.lang) + api(libs.stratego2.lang) - api(libs.spoofax2.stratego.build) { version { require(spoofax2Version) } } - api(libs.spoofax2.stratego.build.spoofax2) { version { require(spoofax2Version) } } - api(libs.spoofax2.stratego.lang) { version { require(spoofax2Version) } } - api(libs.spoofax2.stratego2.lang) { version { require(spoofax2Version) } } + api(libs.spoofax2.stratego.build) + api(libs.spoofax2.stratego.build.spoofax2) + api(libs.spoofax2.stratego.lang) + api(libs.spoofax2.stratego2.lang) // Stratego XT (https://github.com/metaborg/strategoxt) - api(libs.strategoxt.strj) { version { require(strategoxtVersion) } } + api(libs.strategoxt.strj) - api(libs.spoofax2.strategoxt.jar) { version { require(spoofax2Version) } } - api(libs.spoofax2.strategoxt.minjar) { version { require(spoofax2Version) } } - api(libs.spoofax2.strategoxt.strj) { version { require(spoofax2Version) } } + api(libs.spoofax2.strategoxt.jar) + api(libs.spoofax2.strategoxt.minjar) + api(libs.spoofax2.strategoxt.strj) } } diff --git a/docs/content/index.md b/docs/content/index.md index f1037a8..a8c187d 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -5,18 +5,3 @@ title: "Home" The Metaborg Gradle convention and development plugins. - [Gradle convention plugins](./conventions/index.md) - - - -## Catalog -The `org.metaborg:catalog` artifact provides recommended versions for dependencies, and should be used in projects that are part of Spoofax. It is automatically added to the buildscript classpath by the `org.metaborg.convention.settings` plugin. - -Spoofax dependencies don't have a version specified in the catalog. Therefore, when using Spoofax dependencies, the `org.metaborg:platform` must be applied as follows: - -```kotlin -dependencies { - implementation(platform(libs.metaborg.platform)) - - // ... Spoofax dependencies ... -} -``` \ No newline at end of file From ab809ca0429fdb7f25f9dee2a464453141e5d011 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 01:40:39 +0200 Subject: [PATCH 13/54] Prevent publishing invalid versions --- .../MavenPublishConventionPlugin.kt | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt index 973456e..1097d56 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt @@ -1,13 +1,15 @@ package org.metaborg.convention +import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven +import org.gradle.api.publish.maven.tasks.PublishToMavenLocal import org.gradle.api.publish.maven.tasks.PublishToMavenRepository import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.extra import org.gradle.kotlin.dsl.withType import java.util.* @@ -100,7 +102,32 @@ class MavenPublishConventionPlugin: Plugin { } } + // Ensure we don't allow publishing if the repository is dirty or unversioned + val assertValidVersion = project.tasks.register("assertValidVersion") { + group = "Verification" + description = "Asserts that there is a valid version for $project." + + doLast { + val versionString = project.version.toString() + if (versionString == Project.DEFAULT_VERSION) { + throw GradleException("Cannot publish, project has no version: ${project.version}") + } else if (versionString.endsWith("+dirty")) { + throw GradleException("Cannot publish, project has a dirty version: ${project.version}") + } + } + } + + tasks.withType().configureEach { + // Make publishing depend on having a valid version + dependsOn(assertValidVersion) + } + gradle.taskGraph.whenReady { + tasks.withType().configureEach { + doLast { + println("Published ${publication.name} to mavenLocal: ${project.group}:${project.name}:${project.version}") + } + } tasks.withType().configureEach { // Conditionally enable the tasks that publish to the respective repositories when { @@ -111,6 +138,10 @@ class MavenPublishConventionPlugin: Plugin { onlyIf { extension.publishToGitHubPackages.get() } } } + + doLast { + println("Published ${publication.name} to ${repository.name}: ${project.group}:${project.name}:${project.version}") + } } } } From c1812955155d292fe91a6de9c833e31348c9f326 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 01:41:23 +0200 Subject: [PATCH 14/54] Update metaborg-gradle --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 95fc5cd..7d7842b 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,7 +4,7 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -metaborg-gradle = "0.13.0" # https://github.com/metaborg/metaborg-gradle +metaborg-gradle = "0.15.0" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) # Spoofax From 18b99520bbfbae101a41eddc9d9a4eb06571b63a Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 11:41:56 +0200 Subject: [PATCH 15/54] Add gpp and strategolib deps --- depman/gradle/libs.versions.toml | 4 ++++ depman/platform/build.gradle.kts | 4 ++++ example/java-example/build.gradle.kts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 7d7842b..2ae8c10 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -372,15 +372,19 @@ spoofax2-spt-core = { module = "org.metaborg:org.metab spoofax2-spt-lang = { module = "org.metaborg:org.metaborg.meta.lang.spt", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Stratego (https://github.com/metaborg/stratego) +gpp-lang = { module = "org.metaborg.devenv:gpp", version.ref = "stratego" } stratego-build = { module = "org.metaborg.devenv:stratego.build", version.ref = "stratego" } stratego-build-spoofax2 = { module = "org.metaborg.devenv:stratego.build.spoofax2", version.ref = "stratego" } stratego-lang = { module = "org.metaborg.devenv:org.metaborg.meta.lang.stratego", version.ref = "stratego" } stratego2-lang = { module = "org.metaborg.devenv:stratego.lang", version.ref = "stratego" } +strategolib = { module = "org.metaborg.devenv:strategolib", version.ref = "stratego" } +spoofax2-gpp-lang = { module = "org.metaborg:gpp", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping spoofax2-stratego-build = { module = "org.metaborg:stratego.build", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping spoofax2-stratego-build-spoofax2 = { module = "org.metaborg:stratego.build.spoofax2", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping spoofax2-stratego-lang = { module = "org.metaborg:org.metaborg.meta.lang.stratego", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping spoofax2-stratego2-lang = { module = "org.metaborg:stratego.lang", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping +spoofax2-strategolib = { module = "org.metaborg:strategolib", version.ref = "spoofax2" } # Use Spoofax 2 language for bootstrapping # Stratego XT (https://github.com/metaborg/strategoxt) strategoxt-strj = { module = "org.metaborg.devenv:org.strategoxt.strj", version.ref = "strategoxt" } diff --git a/depman/platform/build.gradle.kts b/depman/platform/build.gradle.kts index 881c1da..3954ed7 100644 --- a/depman/platform/build.gradle.kts +++ b/depman/platform/build.gradle.kts @@ -254,15 +254,19 @@ dependencies { api(libs.spoofax2.spt.lang) // Stratego (https://github.com/metaborg/stratego) + api(libs.gpp.lang) api(libs.stratego.build) api(libs.stratego.build.spoofax2) api(libs.stratego.lang) api(libs.stratego2.lang) + api(libs.strategolib) + api(libs.spoofax2.gpp.lang) api(libs.spoofax2.stratego.build) api(libs.spoofax2.stratego.build.spoofax2) api(libs.spoofax2.stratego.lang) api(libs.spoofax2.stratego2.lang) + api(libs.spoofax2.strategolib) // Stratego XT (https://github.com/metaborg/strategoxt) api(libs.strategoxt.strj) diff --git a/example/java-example/build.gradle.kts b/example/java-example/build.gradle.kts index 6061c5c..4971eb2 100644 --- a/example/java-example/build.gradle.kts +++ b/example/java-example/build.gradle.kts @@ -276,15 +276,19 @@ dependencies { // api(libs.spoofax2.spt.lang) // TODO: spoofax-language component // Stratego (https://github.com/metaborg/stratego) +// api(libs.gpp.lang) // TODO: spoofax-language component api(libs.stratego.build) api(libs.stratego.build.spoofax2) // api(libs.stratego.lang) // TODO: spoofax-language component // api(libs.stratego2.lang) // TODO: spoofax-language component +// api(libs.strategolib) // TODO: spoofax-language component +// api(libs.spoofax2.gpp.lang) // TODO: spoofax-language component api(libs.spoofax2.stratego.build) api(libs.spoofax2.stratego.build.spoofax2) // api(libs.spoofax2.stratego.lang) // TODO: spoofax-language component // api(libs.spoofax2.stratego2.lang) // TODO: spoofax-language component +// api(libs.spoofax2.strategolib) // TODO: spoofax-language component // Stratego XT (https://github.com/metaborg/strategoxt) api(libs.strategoxt.strj) From 29235d036d9671df037ff9fb6e914141353cdab2 Mon Sep 17 00:00:00 2001 From: Jeff Smits Date: Thu, 25 Jul 2024 15:12:20 +0200 Subject: [PATCH 16/54] Update dagger to 2.51.1 For support of *most* of jakarta.inject (excludes support for jakarta.inject.Provider !!) --- depman/gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 2ae8c10..d35adc1 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -35,7 +35,7 @@ kotlinx-coroutines = "1.8.1" # https://github.com capsule = "0.6.3" # https://usethesource.io/projects/capsule/ (https://github.com/usethesource/capsule) # Dependency Injection guice = "7.0.0" # https://github.com/google/guice -dagger = "2.36" # https://github.com/google/dagger +dagger = "2.51.1" # https://github.com/google/dagger # Annotations & Annotation Processors immutables = "2.10.1" # https://immutables.github.io/ (https://github.com/immutables/immutables) derive4j = "1.1.1" # https://github.com/derive4j/derive4j @@ -506,4 +506,4 @@ kotest = { module = "io.kotest:kotest-runne kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } kotest-datatest = { module = "io.kotest:kotest-framework-datatest", version.ref = "kotest" } kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" } -mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockito-kotlin" } \ No newline at end of file +mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockito-kotlin" } From 845074c246d818f261487e2ff487e508ff0e40fa Mon Sep 17 00:00:00 2001 From: Jeff Smits Date: Thu, 25 Jul 2024 16:01:03 +0200 Subject: [PATCH 17/54] Downgrade dagger to use older Kotlin version --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index d35adc1..0f009a6 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -35,7 +35,7 @@ kotlinx-coroutines = "1.8.1" # https://github.com capsule = "0.6.3" # https://usethesource.io/projects/capsule/ (https://github.com/usethesource/capsule) # Dependency Injection guice = "7.0.0" # https://github.com/google/guice -dagger = "2.51.1" # https://github.com/google/dagger +dagger = "2.48.1" # https://github.com/google/dagger # Annotations & Annotation Processors immutables = "2.10.1" # https://immutables.github.io/ (https://github.com/immutables/immutables) derive4j = "1.1.1" # https://github.com/derive4j/derive4j From 21139a1e6f8e014cdbb8f55aeee05fd4ecbaa8f7 Mon Sep 17 00:00:00 2001 From: Jeff Smits Date: Thu, 25 Jul 2024 16:20:24 +0200 Subject: [PATCH 18/54] Boo, downgrade to the lowest dagger version that supports jakarta --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 0f009a6..1da0b40 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -35,7 +35,7 @@ kotlinx-coroutines = "1.8.1" # https://github.com capsule = "0.6.3" # https://usethesource.io/projects/capsule/ (https://github.com/usethesource/capsule) # Dependency Injection guice = "7.0.0" # https://github.com/google/guice -dagger = "2.48.1" # https://github.com/google/dagger +dagger = "2.41" # https://github.com/google/dagger # Annotations & Annotation Processors immutables = "2.10.1" # https://immutables.github.io/ (https://github.com/immutables/immutables) derive4j = "1.1.1" # https://github.com/derive4j/derive4j From c3839b95aff3b4efc53c355e0570711c8a28580a Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 17:05:08 +0200 Subject: [PATCH 19/54] Add kotlin serialization dependency --- depman/gradle/libs.versions.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 2ae8c10..0df26b9 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -102,6 +102,7 @@ junit4-benchmarks = "0.7.2" # https://labs.carro [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } gitonium = { id = "org.metaborg.gitonium", version.ref = "gitonium" } coronium-bundle = { id = "org.metaborg.coronium.bundle", version.ref = "coronium" } foojay-resolver-convention = { id = "org.gradle.toolchains.foojay-resolver-convention", version.ref = "foojay" } From c354fd625bded58843fd531b21c90e7d8634a5a2 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 17:05:33 +0200 Subject: [PATCH 20/54] Add repoman --- repoman/build.gradle.kts | 57 +++++ repoman/examplemeta.yaml | 2 + repoman/settings.gradle.kts | 19 ++ .../org/metaborg/repoman/GenerateCommand.kt | 116 +++++++++++ .../kotlin/org/metaborg/repoman/Program.kt | 23 ++ .../org/metaborg/repoman/meta/RepoMetadata.kt | 197 ++++++++++++++++++ .../metaborg/repoman/templates/Markdown.kt | 4 + .../repoman/templates/ReadmeTemplate.kt | 10 + .../metaborg/repoman/templates/Template.kt | 28 +++ .../main/resources/templates/.gitignore.kte | 70 +++++++ .../main/resources/templates/CHANGELOG.md.kte | 17 ++ .../templates/CODE_OF_CONDUCT.md.kte | 134 ++++++++++++ .../resources/templates/CONTRIBUTING.md.kte | 59 ++++++ .../main/resources/templates/LICENSE.md.kte | 194 +++++++++++++++++ .../main/resources/templates/README.md.kte | 80 +++++++ settings.gradle.kts | 1 + 16 files changed, 1011 insertions(+) create mode 100644 repoman/build.gradle.kts create mode 100644 repoman/examplemeta.yaml create mode 100644 repoman/settings.gradle.kts create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/Program.kt create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt create mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt create mode 100644 repoman/src/main/resources/templates/.gitignore.kte create mode 100644 repoman/src/main/resources/templates/CHANGELOG.md.kte create mode 100644 repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte create mode 100644 repoman/src/main/resources/templates/CONTRIBUTING.md.kte create mode 100644 repoman/src/main/resources/templates/LICENSE.md.kte create mode 100644 repoman/src/main/resources/templates/README.md.kte diff --git a/repoman/build.gradle.kts b/repoman/build.gradle.kts new file mode 100644 index 0000000..f7083f9 --- /dev/null +++ b/repoman/build.gradle.kts @@ -0,0 +1,57 @@ +import org.metaborg.convention.Developer + +// Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + application + id("org.metaborg.convention.java") + id("org.metaborg.convention.maven-publish") + id("org.metaborg.convention.junit") + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.gitonium) +} + +version = gitonium.version +group = "org.metaborg" +description = "Repository manager for Metaborg/Spoofax projects." + +dependencies { + implementation("com.github.ajalt.clikt:clikt:4.4.0") // CLI interface + implementation("gg.jte:jte:3.1.12") // Templating engine + implementation("gg.jte:jte-kotlin:3.1.12") // Templating engine (Kotlin support) + implementation("com.charleskorn.kaml:kaml:0.59.0") // Deserialize YAML files + + testImplementation (libs.kotest) + testImplementation (libs.kotest.assertions) + testImplementation (libs.kotest.datatest) + testImplementation (libs.kotest.property) +} + +application { + mainClass.set("org.metaborg.repoman.Program") +} + +javaConvention { + javaVersion.set(JavaLanguageVersion.of(17)) +} + +publishing { + publications { + create("mavenJava") { + from(components["java"]) + } + } +} + +mavenPublishConvention { + repoOwner.set("metaborg") + repoName.set("metaborg-git") + + metadata { + inceptionYear.set("2024") + developers.set(listOf( + Developer("Virtlink", "Daniel A. A. Pelsmaeker", "developer@pelsmaeker.net"), + )) + } +} diff --git a/repoman/examplemeta.yaml b/repoman/examplemeta.yaml new file mode 100644 index 0000000..ef7363d --- /dev/null +++ b/repoman/examplemeta.yaml @@ -0,0 +1,2 @@ +--- +name: "My name" \ No newline at end of file diff --git a/repoman/settings.gradle.kts b/repoman/settings.gradle.kts new file mode 100644 index 0000000..e6efa3b --- /dev/null +++ b/repoman/settings.gradle.kts @@ -0,0 +1,19 @@ +dependencyResolutionManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + mavenCentral() + } +} + +pluginManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + gradlePluginPortal() + } +} + +plugins { + id("org.metaborg.convention.settings") version "latest.integration" +} + +rootProject.name = "repoman" diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt new file mode 100644 index 0000000..2680e12 --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -0,0 +1,116 @@ +package org.metaborg.repoman + +import com.charleskorn.kaml.Yaml +import com.charleskorn.kaml.decodeFromStream +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.types.path +import gg.jte.ContentType +import gg.jte.TemplateEngine +import gg.jte.output.FileOutput +import gg.jte.resolve.ResourceCodeResolver +import org.metaborg.repoman.meta.RepoMetadata +import java.nio.file.Path +import kotlin.io.path.exists +import kotlin.io.path.inputStream + +/** + * Generates or updates the files in a repository, including: + * - README.md + * - LICENSE.md + * - CONTRIBUTING.md + * - CODE_OF_CONDUCT.md + * - CHANGELOG.md + * - .gitignore + * - ./gradlew (Gradle wrapper) + * - docs/ (MkDocs Material) + * - .github/workflows/ (GitHub CI/CD) + */ +object GenerateCommand: CliktCommand( + name = "generate", + help = "Generates a README.md file for a specific repository." +) { + /** The file with the repository metadata. */ + val metadataFile: Path? by option("-m", "--meta", help = "The file with the repository metadata") + .path(canBeFile = true, canBeDir = false, mustExist = true) + + /** The directory with the repository. */ + val repoDir: Path? by option("-r", "--repo", help = "The directory with the repository") + .path(canBeFile = false, canBeDir = true, mustExist = true) + + + override fun run() { + val repoDir = repoDir ?: Path.of(System.getProperty("user.dir")) + val metadata = readMetadata(repoDir) + val resolver = ResourceCodeResolver("templates", Program::class.java.classLoader) + val engine = TemplateEngine.create(resolver, ContentType.Plain) + val generator = Generator(repoDir, engine, metadata) + + generator.generateReadme() + generator.generateLicense() + generator.generateContributing() + generator.generateCodeOfConduct() + generator.generateChangelog() + generator.generateGitignore() + println("Done!") + } + + private fun readMetadata(repoDir: Path): RepoMetadata { + println("Reading metadata...") + + val metadataFile = metadataFile ?: repoDir.resolve("repo.yaml") + val metadata = Yaml.default.decodeFromStream(metadataFile.inputStream()) + + return metadata + } + + class Generator( + private val repoDir: Path, + private val engine: TemplateEngine, + private val metadata: RepoMetadata, + ) { + fun generateReadme() { + generate("README.md", metadata.files.readme.generate, metadata.files.readme.update) + } + + fun generateLicense() { + generate("LICENSE.md", metadata.files.license.generate, metadata.files.license.update) + } + + fun generateContributing() { + generate("CONTRIBUTING.md", metadata.files.contributing.generate, metadata.files.contributing.update) + } + + fun generateCodeOfConduct() { + generate("CODE_OF_CONDUCT.md", metadata.files.codeOfConduct.generate, metadata.files.codeOfConduct.update) + } + + fun generateChangelog() { + generate("CHANGELOG.md", metadata.files.changelog.generate, metadata.files.changelog.update) + } + + fun generateGitignore() { + generate(".gitignore", metadata.files.gitignore.generate, metadata.files.gitignore.update) + } + + fun generate(filename: String, generate: Boolean, update: Boolean) { + val outputFile = repoDir.resolve(filename) + val outputFileExisted = outputFile.exists() + if (!outputFileExisted && !generate) { + println("$filename: Not generated") + return + } else if (outputFileExisted && !update) { + println("$filename: Not updated") + return + } + + engine.render("$filename.kte", metadata, FileOutput(outputFile)) + + if (!outputFileExisted) { + println("$filename: Generated") + } else { + println("$filename: Updated") + } + } + } +} \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/Program.kt b/repoman/src/main/kotlin/org/metaborg/repoman/Program.kt new file mode 100644 index 0000000..999e02a --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/Program.kt @@ -0,0 +1,23 @@ +package org.metaborg.repoman + +import com.github.ajalt.clikt.core.NoOpCliktCommand +import com.github.ajalt.clikt.core.subcommands + +object Program { + @JvmStatic + fun main(args: Array) { + CLI.main(args) + } +} + +/** The command-line root base class. */ +object CLI: NoOpCliktCommand(name = "repoman") { + init { + // TODO: Set versionOption() + subcommands( + GenerateCommand, + ) + } +} + + diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt new file mode 100644 index 0000000..dbe988a --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -0,0 +1,197 @@ +package org.metaborg.repoman.meta + +import kotlinx.serialization.Serializable +import org.metaborg.repoman.templates.Markdown + +@Serializable +data class RepoMetadata( + /** The owner of the repo on GitHub. For example: `"metaborg"` */ + val repoOwner: String = "metaborg", + /** The name of the repo on GitHub (required). For example: `"resource"` */ + val repoName: String, + /** The name of the main branch. For example: `"master"` */ + val mainBranch: String = "main", + + /** The title of the repo (required). For example: `"Metaborg Resource"` */ + val title: String, + /** A short description of the repo; or `null`. For example: `"A utility library for working with resources."` */ + val description: Markdown? = null, + /** A link to the hosted documentation of the repo; or `null`. For example: `"https://spoofax.dev/gitonium/"` */ + val documentationLink: String? = null, + /** The inception year of the repository (required). */ + val inceptionYear: String, + /** The current year in which the repository is still maintained. */ + val currentYear: String = "2024", + + /** A list of Maven libraries published by the repo. */ + val libraries: List = emptyList(), + /** A list of Spoofax languages published by the repo. */ + val languages: List = emptyList(), + /** A list of Gradle plugins published by the repo. */ + val plugins: List = emptyList(), + + /** An ordered list of (main) developers that worked on the repo. */ + val developers: List = emptyList(), + + /** The configurations for the generated files. */ + val files: Files = Files(), +) + +/** Metadata for the files to generate. */ +@Serializable +data class Files( + /** The metadata for the README.md file. */ + val readme: Readme = Readme(), + /** The metadata for the LICENSE.md file. */ + val license: License = License(), + /** The metadata for the CONTRIBUTING.md file. */ + val contributing: Contributing = Contributing(), + /** The metadata for the CODE_OF_CONDUCT.md file. */ + val codeOfConduct: CodeOfConduct = CodeOfConduct(), + /** The metadata for the CHANGELOG.md file. */ + val changelog: Changelog = Changelog(), + /** The metadata for the .gitignore file. */ + val gitignore: Gitignore = Gitignore(), + /** The metadata for the Gradle wrapper files. */ + val gradleWrapper: GradleWrapper = GradleWrapper(), + /** The metadata for the Gradle root project files. */ + val gradleRootProject: GradleRootProject = GradleRootProject(), + /** The metadata for the documentation (not generated by default). */ + val docs: Docs = Docs(), + /** The metadata for the GitHub workflows. */ + val githubWorkflows: GithubWorkflows = GithubWorkflows(), +) + +/** Metadata for the README.md file. */ +@Serializable +data class Readme( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, + /** Content to include in the main body of the readme; or `null`. */ + val body: Markdown? = null, +) + +/** Metadata for the LICENSE.md file. */ +@Serializable +data class License( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, +) + +/** Metadata for the CONTRIBUTING.md file. */ +@Serializable +data class Contributing( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, +) + +/** Metadata for the CODE_OF_CONDUCT.md file. */ +@Serializable +data class CodeOfConduct( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, +) + +/** Metadata for the CHANGELOG.md file. */ +@Serializable +data class Changelog( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = false, +) + +/** Metadata for the .gitignore file. */ +@Serializable +data class Gitignore( + /** Whether to generate the file. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, +) + +/** Metadata for the .gradlew files. */ +@Serializable +data class GradleWrapper( + /** Whether to generate the files. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, + /** The version of the Gradle wrapper to generate. */ + val gradleVersion: String = "7.6.4", +) + +/** Metadata for the Gradle root project files. */ +@Serializable +data class GradleRootProject( + /** Whether to generate the files. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, + /** The version of the Metaborg Gradle convention to use. */ + val conventionVersion: String = "latest.integration", + /** Whether to create `publish` tasks that delegate to the included builds and subprojects. */ + val createPublishTasks: Boolean = false, +) + +/** Metadata for the MkDocs documentation files. */ +@Serializable +data class Docs( + /** Whether to generate the files. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = false, +) + +/** Metadata for the GitHub workflows. */ +@Serializable +data class GithubWorkflows( + /** Whether to generate the files. */ + val generate: Boolean = false, + /** Whether to update the file. */ + val update: Boolean = true, + /** Whether to publish releases using GitHub CI (instead of Jenkins or something else). */ + val releaseOnGitHub: Boolean = false, + /** Whether to publish snapshots using GitHub CI. */ + val snapshotOnGitHub: Boolean = false, + /** Whether to build and publish the documentation using GitHub CI. */ + val buildDocs: Boolean = false, +) + +/** A Maven artifact. */ +@Serializable +data class MavenArtifact( + /** The group ID of the artifact. For example: `"org.metaborg"` */ + val group: String, + /** The name of the artifact. For example: `"resource"` */ + val name: String, + /** A short description. For example: `"Resource management library."` */ + val description: Markdown? = null, +) + +/** A Gradle plugin. */ +@Serializable +data class GradlePlugin( + /** The ID of the plugin. For example: `"org.metaborg.convention.maven-publish"`. */ + val id: String, + /** A short description. For example: `"Resource management library."` */ + val description: Markdown? = null, +) + +@Serializable +data class Developer( + /** The ID of the developer, usually their GitHub nickname. */ + val id: String, + /** The (full) name of the developer. */ + val name: String, + /** The e-mail address of the developer. */ + val email: String, +) \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt b/repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt new file mode 100644 index 0000000..50be646 --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt @@ -0,0 +1,4 @@ +package org.metaborg.repoman.templates + +/** A Markdown string. */ +typealias Markdown = String \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt b/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt new file mode 100644 index 0000000..86b1d8d --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt @@ -0,0 +1,10 @@ +package org.metaborg.repoman.templates + +/** Template info for the `README.md` file. */ +data class ReadmeTemplate( + /** The human-readable name of the repository. For example: `"Metaborg Resource"` */ + val title: String, + /** A short one-line description of the repository. For example: `"A utility library for working with resources."` */ + val description: Markdown, +) : Template("README.md.kte") + diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt b/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt new file mode 100644 index 0000000..dba8d8a --- /dev/null +++ b/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt @@ -0,0 +1,28 @@ +package org.metaborg.repoman.templates + +import gg.jte.ContentType +import gg.jte.TemplateEngine +import gg.jte.TemplateOutput +import gg.jte.resolve.DirectoryCodeResolver +import gg.jte.resolve.ResourceCodeResolver +import org.metaborg.repoman.Program +import java.nio.file.Path + +/** Base class for templates. */ +abstract class Template( + /** The path in the resources templates/ directory to the template file. */ + private val templatePath: String, +) { + /** + * Renders the template to the specified output. + * + * @param output The output to render to. + * @param templatePath The path to the template file; or `null` to use the default template in the JAR's resources. + */ + fun renderTo(output: TemplateOutput, templatePath: Path? = null) { + val resolver = if (templatePath != null) DirectoryCodeResolver(templatePath) + else ResourceCodeResolver("templates/${this.templatePath}", Program::class.java.classLoader) + val engine = TemplateEngine.create(resolver, ContentType.Plain) + engine.render("", this, output) + } +} \ No newline at end of file diff --git a/repoman/src/main/resources/templates/.gitignore.kte b/repoman/src/main/resources/templates/.gitignore.kte new file mode 100644 index 0000000..569ad27 --- /dev/null +++ b/repoman/src/main/resources/templates/.gitignore.kte @@ -0,0 +1,70 @@ +# Java +*.class +*.log +*.jar +*.war +*.nar +*.ear + + +# Gradle +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + + +# IntelliJ +.idea/* +!.idea/icon.svg +!.idea/icon_dark.svg +*.iws +out/ +*.iml +*.ipr +!**/src/main/**/out/ +!**/src/test/**/out/ + + +# Eclipse +.metadata +.classpath +.project +.apt_generated +.settings +.springBeans +.sts4-cache +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders +.factorypath +.recommenders/ +.apt_generated/ +.apt_generated_test/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + + +# NetBeans +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + + +# VS Code +.vscode/ + +# Misc +.cache +.DS_Store +*.lock diff --git a/repoman/src/main/resources/templates/CHANGELOG.md.kte b/repoman/src/main/resources/templates/CHANGELOG.md.kte new file mode 100644 index 0000000..27e9776 --- /dev/null +++ b/repoman/src/main/resources/templates/CHANGELOG.md.kte @@ -0,0 +1,17 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). + +## [Unreleased] + + +## [0.0.1] - 2000-01-01 + + +[unreleased]: https://github.com/${meta.repoOwner}/${meta.repoName}/compare/release-0.0.1...HEAD +[0.0.1]: https://github.com/${meta.repoOwner}/${meta.repoName}/releases/tag/release-0.0.1 + diff --git a/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte b/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte new file mode 100644 index 0000000..cbf1ea1 --- /dev/null +++ b/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte @@ -0,0 +1,134 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, +and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall +community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of +any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, +without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + diff --git a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte new file mode 100644 index 0000000..69e2414 --- /dev/null +++ b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte @@ -0,0 +1,59 @@ +@import org.metaborg.repoman.meta.RepoMetadata + +@param meta: RepoMetadata + +# ${meta.title} + +## How to Contribute +Thank you for wanting to contribute to this project! :tada::+1: + +> **Note**: +> We may not deal with your issue or pull request in a timely manner, or at all. +> We also reserve the right to change your contribution in any way we deem fit +> for this project, or even outright reject it. + +#### **You have a question?** +Search the [Discussions][1] and [Stackoverflow][3] to see whether your question +has already been answered, or ask your question there. +Please do **not** make an issue on the Github repository. + + +#### **You found a bug** +Search the [Issues][2] to ensure the bug has not been reported before. + +If the bug is new, open a new issue with a _clear title and description_. +Please indicate: +- what you did, +- what you expected to happen, and +- what actually happened. + +Try to include as much relevant information as you have. +For example, a code sample or executable test case are very helpful. + + +#### **You wrote a patch with a cosmetic change** +Please do not submit pull requests for cosmetic changes, +such as whitespace and formatting changes. +We will reject them. + + +#### **You wrote a patch with a bug fix** +Thank you! Please open a GitHub pull request with the patch. + + +#### **You wrote a patch that adds a new feature or changes an existing one** +Please open an issue _first_, so we can discuss the change. + + +#### **You want to contribute to the documentation or test suite** +Thank you! Please open a GitHub pull request with the patch. + +--- + +Thanks! :heart: :heart: :heart: + +[Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) + +[1]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions +[2]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues +[3]: https://stackoverflow.com/ diff --git a/repoman/src/main/resources/templates/LICENSE.md.kte b/repoman/src/main/resources/templates/LICENSE.md.kte new file mode 100644 index 0000000..870644e --- /dev/null +++ b/repoman/src/main/resources/templates/LICENSE.md.kte @@ -0,0 +1,194 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte new file mode 100644 index 0000000..4e637c4 --- /dev/null +++ b/repoman/src/main/resources/templates/README.md.kte @@ -0,0 +1,80 @@ +@import org.metaborg.repoman.meta.RepoMetadata + +@param meta: RepoMetadata + +# ${meta.title} +[![Build][github-badge:build]][github:build] +[![License][license-badge]][license] +[![GitHub Release][github-badge:release]][github:release] +@if(documentationLink != null) +[![Documentation][documentation-badge]][documentation] +@endif + +${meta.description} + +@if(documentationLink != null) +[![Documentation][documentation-button]][documentation] +@endif + +@if(meta.languages.isNotEmpty()) +| Language | Latest Release | Latest Snapshot | +|----------|----------------|-----------------| +@for(entry in meta.languages) +| `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | +@endfor +@endif + +@if(meta.libraries.isNotEmpty()) +| Artifact | Latest Release | Latest Snapshot | +|----------|----------------|-----------------| +@for(entry in meta.libraries) +| `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | +@endfor +@endif + +@if(meta.plugins.isNotEmpty()) +| Gradle Plugin | Latest Release | Latest Snapshot | +|---------------|----------------|-----------------| +@for(entry in meta.plugins) +| `${entry.id}` | [![Release][mvn-rel-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | [![Snapshot][mvn-snap-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | +@endfor +@endif + +@if(meta.files.readme.body != null) +${meta.files.readme.body} +@endif + +## License +Copyright ${meta.inceptionYear}-${meta.currentYear} [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an **"as is" basis, without warranties or conditions of any kind**, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +[github-badge:build]: https://img.shields.io/github/actions/workflow/status/${meta.repoOwner}/pie/build.yaml +[github:build]: https://github.com/${meta.repoOwner}/${meta.repoName}/actions +[license-badge]: https://img.shields.io/github/license/${meta.repoOwner}/${meta.repoName} +[license]: https://github.com/${meta.repoOwner}/${meta.repoName}/blob/${meta.mainBranch}/LICENSE.md +[github-badge:release]: https://img.shields.io/github/v/release/${meta.repoOwner}/${meta.repoName} +[github:release]: https://github.com/${meta.repoOwner}/${meta.repoName}/releases +@if(documentationLink != null) +[documentation-badge]: https://img.shields.io/badge/docs-latest-brightgreen +[documentation]: ${documentationLink} +[documentation-button]: https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=googledocs&logoColor=white +@endif + +@for(entry in meta.languages) +[mvn:${entry.group}:${entry.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.group}~${entry.name}~~~ +[mvn-rel-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/r/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/s/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@endfor +@for(entry in meta.libraries) +[mvn:${entry.group}:${entry.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.group}~${entry.name}~~~ +[mvn-rel-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/r/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/s/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@endfor +@for(entry in meta.plugins) +[mvn:${entry.id}:${entry.id}.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.id}~${entry.id}.gradle.plugin~~~ +[mvn-rel-badge:${entry.id}:${entry.id}.gradle.plugin]: https://img.shields.io/nexus/r/${entry.id}/${entry.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:${entry.id}:${entry.id}.gradle.plugin]: https://img.shields.io/nexus/s/${entry.id}/${entry.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@endfor diff --git a/settings.gradle.kts b/settings.gradle.kts index 94e472e..b575dc9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,3 +21,4 @@ plugins { includeBuild("convention-plugin/") includeBuild("depman/") includeBuild("example/") +includeBuild("repoman/") From 8115547a1cbdf61db24d8111f4604fce7a4d7b2b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 17:05:41 +0200 Subject: [PATCH 21/54] Add repo description yaml --- repo.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 repo.yaml diff --git a/repo.yaml b/repo.yaml new file mode 100644 index 0000000..64b39cd --- /dev/null +++ b/repo.yaml @@ -0,0 +1,32 @@ +--- +repoOwner: "metaborg" +repoName: "metaborg-gradle" +mainBranch: "main" + +title: "Metaborg Gradle" +description: | + The Metaborg Gradle convention and development plugins, and the Metaborg dependency management and Gradle platform. +documentationLink: https://spoofax.dev/metaborg-gradle/ +inceptionYear: "2024" + +libraries: + - group: "org.metaborg" + name: "catalog" + description: "Version catalog" + - group: "org.metaborg" + name: "platform" + description: "Spoofax platform" +plugins: + - id: "org.metaborg.convention.settings" + description: "Settings convention plugin" + - id: "org.metaborg.convention.java" + description: "Java convention plugin" + - id: "org.metaborg.convention.maven-publish" + description: "Maven publish convention plugin" + - id: "org.metaborg.convention.root-project" + description: "Root project convention plugin" + +developers: + - id: "Virtlink" + name: "Daniel A. A. Pelsmaeker" + email: "developer@pelsmaeker.net" From ddcac0e18027a64d59586edb74c053bb15bf02be Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 17:21:14 +0200 Subject: [PATCH 22/54] Fix templates --- .../org/metaborg/repoman/GenerateCommand.kt | 5 +- .../repoman/{templates => }/Markdown.kt | 2 +- .../org/metaborg/repoman/meta/RepoMetadata.kt | 2 +- .../repoman/templates/ReadmeTemplate.kt | 10 ---- .../metaborg/repoman/templates/Template.kt | 28 ---------- .../main/resources/templates/.gitignore.kte | 1 + .../templates/CODE_OF_CONDUCT.md.kte | 1 - .../resources/templates/CONTRIBUTING.md.kte | 2 - .../main/resources/templates/LICENSE.md.kte | 54 +++++++++---------- .../main/resources/templates/README.md.kte | 26 +++++---- 10 files changed, 51 insertions(+), 80 deletions(-) rename repoman/src/main/kotlin/org/metaborg/repoman/{templates => }/Markdown.kt (58%) delete mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt delete mode 100644 repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index 2680e12..2a96105 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -44,6 +44,7 @@ object GenerateCommand: CliktCommand( val metadata = readMetadata(repoDir) val resolver = ResourceCodeResolver("templates", Program::class.java.classLoader) val engine = TemplateEngine.create(resolver, ContentType.Plain) + engine.setTrimControlStructures(true) val generator = Generator(repoDir, engine, metadata) generator.generateReadme() @@ -104,7 +105,9 @@ object GenerateCommand: CliktCommand( return } - engine.render("$filename.kte", metadata, FileOutput(outputFile)) + FileOutput(outputFile).use { output -> + engine.render("$filename.kte", metadata, output) + } if (!outputFileExisted) { println("$filename: Generated") diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt b/repoman/src/main/kotlin/org/metaborg/repoman/Markdown.kt similarity index 58% rename from repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt rename to repoman/src/main/kotlin/org/metaborg/repoman/Markdown.kt index 50be646..73b3b01 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Markdown.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/Markdown.kt @@ -1,4 +1,4 @@ -package org.metaborg.repoman.templates +package org.metaborg.repoman /** A Markdown string. */ typealias Markdown = String \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index dbe988a..3426502 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -1,7 +1,7 @@ package org.metaborg.repoman.meta import kotlinx.serialization.Serializable -import org.metaborg.repoman.templates.Markdown +import org.metaborg.repoman.Markdown @Serializable data class RepoMetadata( diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt b/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt deleted file mode 100644 index 86b1d8d..0000000 --- a/repoman/src/main/kotlin/org/metaborg/repoman/templates/ReadmeTemplate.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.metaborg.repoman.templates - -/** Template info for the `README.md` file. */ -data class ReadmeTemplate( - /** The human-readable name of the repository. For example: `"Metaborg Resource"` */ - val title: String, - /** A short one-line description of the repository. For example: `"A utility library for working with resources."` */ - val description: Markdown, -) : Template("README.md.kte") - diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt b/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt deleted file mode 100644 index dba8d8a..0000000 --- a/repoman/src/main/kotlin/org/metaborg/repoman/templates/Template.kt +++ /dev/null @@ -1,28 +0,0 @@ -package org.metaborg.repoman.templates - -import gg.jte.ContentType -import gg.jte.TemplateEngine -import gg.jte.TemplateOutput -import gg.jte.resolve.DirectoryCodeResolver -import gg.jte.resolve.ResourceCodeResolver -import org.metaborg.repoman.Program -import java.nio.file.Path - -/** Base class for templates. */ -abstract class Template( - /** The path in the resources templates/ directory to the template file. */ - private val templatePath: String, -) { - /** - * Renders the template to the specified output. - * - * @param output The output to render to. - * @param templatePath The path to the template file; or `null` to use the default template in the JAR's resources. - */ - fun renderTo(output: TemplateOutput, templatePath: Path? = null) { - val resolver = if (templatePath != null) DirectoryCodeResolver(templatePath) - else ResourceCodeResolver("templates/${this.templatePath}", Program::class.java.classLoader) - val engine = TemplateEngine.create(resolver, ContentType.Plain) - engine.render("", this, output) - } -} \ No newline at end of file diff --git a/repoman/src/main/resources/templates/.gitignore.kte b/repoman/src/main/resources/templates/.gitignore.kte index 569ad27..1f314c7 100644 --- a/repoman/src/main/resources/templates/.gitignore.kte +++ b/repoman/src/main/resources/templates/.gitignore.kte @@ -68,3 +68,4 @@ local.properties .cache .DS_Store *.lock +jte-classes/ \ No newline at end of file diff --git a/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte b/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte index cbf1ea1..7a152d8 100644 --- a/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte +++ b/repoman/src/main/resources/templates/CODE_OF_CONDUCT.md.kte @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge diff --git a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte index 69e2414..dacca16 100644 --- a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte +++ b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte @@ -1,7 +1,5 @@ @import org.metaborg.repoman.meta.RepoMetadata - @param meta: RepoMetadata - # ${meta.title} ## How to Contribute diff --git a/repoman/src/main/resources/templates/LICENSE.md.kte b/repoman/src/main/resources/templates/LICENSE.md.kte index 870644e..362ac12 100644 --- a/repoman/src/main/resources/templates/LICENSE.md.kte +++ b/repoman/src/main/resources/templates/LICENSE.md.kte @@ -90,26 +90,26 @@ in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: * **(a)** You must give any other recipients of the Work or Derivative Works a copy of -this License; and + this License; and * **(b)** You must cause any modified files to carry prominent notices stating that You -changed the files; and + changed the files; and * **(c)** You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and + all copyright, patent, trademark, and attribution notices from the Source form + of the Work, excluding those notices that do not pertain to any part of the + Derivative Works; and * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. + Derivative Works that You distribute must include a readable copy of the + attribution notices contained within such NOTICE file, excluding those notices + that do not pertain to any part of the Derivative Works, in at least one of the + following places: within a NOTICE text file distributed as part of the + Derivative Works; within the Source form or documentation, if provided along + with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of + the NOTICE file are for informational purposes only and do not modify the + License. You may add Your own attribution notices within Derivative Works that + You distribute, alongside or as an addendum to the NOTICE text from the Work, + provided that such additional attribution notices cannot be construed as + modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or @@ -179,16 +179,16 @@ recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives. -Copyright [yyyy] [name of copyright owner] + Copyright [yyyy] [name of copyright owner] -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte index 4e637c4..a18d063 100644 --- a/repoman/src/main/resources/templates/README.md.kte +++ b/repoman/src/main/resources/templates/README.md.kte @@ -1,19 +1,19 @@ @import org.metaborg.repoman.meta.RepoMetadata - @param meta: RepoMetadata - # ${meta.title} [![Build][github-badge:build]][github:build] [![License][license-badge]][license] [![GitHub Release][github-badge:release]][github:release] -@if(documentationLink != null) +@if(meta.documentationLink != null) [![Documentation][documentation-badge]][documentation] @endif + ${meta.description} -@if(documentationLink != null) +@if(meta.documentationLink != null) [![Documentation][documentation-button]][documentation] + @endif @if(meta.languages.isNotEmpty()) @@ -22,47 +22,55 @@ ${meta.description} @for(entry in meta.languages) | `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | @endfor + @endif + @if(meta.libraries.isNotEmpty()) | Artifact | Latest Release | Latest Snapshot | |----------|----------------|-----------------| @for(entry in meta.libraries) | `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | @endfor + @endif + @if(meta.plugins.isNotEmpty()) | Gradle Plugin | Latest Release | Latest Snapshot | |---------------|----------------|-----------------| @for(entry in meta.plugins) | `${entry.id}` | [![Release][mvn-rel-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | [![Snapshot][mvn-snap-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | @endfor + @endif + @if(meta.files.readme.body != null) ${meta.files.readme.body} + @endif ## License -Copyright ${meta.inceptionYear}-${meta.currentYear} [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) +Copyright ${if (meta.inceptionYear != meta.currentYear) meta.inceptionYear + "-" + meta.currentYear else meta.inceptionYear} [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an **"as is" basis, without warranties or conditions of any kind**, either express or implied. See the License for the specific language governing permissions and limitations under the License. -[github-badge:build]: https://img.shields.io/github/actions/workflow/status/${meta.repoOwner}/pie/build.yaml +[github-badge:build]: https://img.shields.io/github/actions/workflow/status/${meta.repoOwner}/${meta.repoName}/build.yaml [github:build]: https://github.com/${meta.repoOwner}/${meta.repoName}/actions [license-badge]: https://img.shields.io/github/license/${meta.repoOwner}/${meta.repoName} [license]: https://github.com/${meta.repoOwner}/${meta.repoName}/blob/${meta.mainBranch}/LICENSE.md -[github-badge:release]: https://img.shields.io/github/v/release/${meta.repoOwner}/${meta.repoName} +[github-badge:release]: https://img.shields.io/github/v/release/${meta.repoOwner}/${meta.repoName}?display_name=release [github:release]: https://github.com/${meta.repoOwner}/${meta.repoName}/releases -@if(documentationLink != null) +@if(meta.documentationLink != null) [documentation-badge]: https://img.shields.io/badge/docs-latest-brightgreen -[documentation]: ${documentationLink} +[documentation]: ${meta.documentationLink} [documentation-button]: https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=googledocs&logoColor=white @endif + @for(entry in meta.languages) [mvn:${entry.group}:${entry.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.group}~${entry.name}~~~ [mvn-rel-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/r/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 From b1263e13c77cbfb633861c2a70bd0fbd416a5402 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 25 Jul 2024 17:25:20 +0200 Subject: [PATCH 23/54] Update Readme and gitignore --- .gitignore | 1 + CODE_OF_CONDUCT.md | 133 +++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 55 +++++++++++++++++++ README.md | 90 +++++++++++------------------- 4 files changed, 220 insertions(+), 59 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.gitignore b/.gitignore index 569ad27..1f314c7 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ local.properties .cache .DS_Store *.lock +jte-classes/ \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7a152d8 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, +and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall +community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of +any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, +without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6ee1fa3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Metaborg Gradle + +## How to Contribute +Thank you for wanting to contribute to this project! :tada::+1: + +> **Note**: +> We may not deal with your issue or pull request in a timely manner, or at all. +> We also reserve the right to change your contribution in any way we deem fit +> for this project, or even outright reject it. + +#### **You have a question?** +Search the [Discussions][1] and [Stackoverflow][3] to see whether your question +has already been answered, or ask your question there. +Please do **not** make an issue on the Github repository. + + +#### **You found a bug** +Search the [Issues][2] to ensure the bug has not been reported before. + +If the bug is new, open a new issue with a _clear title and description_. +Please indicate: +- what you did, +- what you expected to happen, and +- what actually happened. + +Try to include as much relevant information as you have. +For example, a code sample or executable test case are very helpful. + + +#### **You wrote a patch with a cosmetic change** +Please do not submit pull requests for cosmetic changes, +such as whitespace and formatting changes. +We will reject them. + + +#### **You wrote a patch with a bug fix** +Thank you! Please open a GitHub pull request with the patch. + + +#### **You wrote a patch that adds a new feature or changes an existing one** +Please open an issue _first_, so we can discuss the change. + + +#### **You want to contribute to the documentation or test suite** +Thank you! Please open a GitHub pull request with the patch. + +--- + +Thanks! :heart: :heart: :heart: + +[Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) + +[1]: https://github.com/metaborg/metaborg-gradle/discussions +[2]: https://github.com/metaborg/metaborg-gradle/issues +[3]: https://stackoverflow.com/ diff --git a/README.md b/README.md index 6970097..2e43fae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Metaborg Gradle Plugins +# Metaborg Gradle [![Build][github-badge:build]][github:build] [![License][license-badge]][license] [![GitHub Release][github-badge:release]][github:release] @@ -6,39 +6,21 @@ The Metaborg Gradle convention and development plugins, and the Metaborg dependency management and Gradle platform. -[![Documentation][documentation-button]][documentation] - -| Gradle Plugin | Latest Release | Latest Snapshot | -|-----------------------------------------|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| `org.metaborg.convention.settings` | [![Release][mvn-rel-badge:convention.settings]][mvn:convention.settings] | [![Snapshot][mvn-snap-badge:convention.settings]][mvn:convention.settings] | -| `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] | - -| Artifact | Latest Release | Latest Snapshot | -|----------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------| -| `org.metaborg:catalog` | [![Release][mvn-rel-badge:catalog]][mvn:catalog] | [![Snapshot][mvn-snap-badge:catalog]][mvn:catalog] | -| `org.metaborg:platform` | [![Release][mvn-rel-badge:platform]][mvn:platform] | [![Snapshot][mvn-snap-badge:platform]][mvn:platform] | -| `org.metaborg:platform-latest` | [![Release][mvn-rel-badge:platform-latest]][mvn:platform-latest] | [![Snapshot][mvn-snap-badge:platform-latest]][mvn:platform-latest] | -| `org.metaborg:platform-snapshot` | [![Release][mvn-rel-badge:platform-snapshot]][mvn:platform-snapshot] | [![Snapshot][mvn-snap-badge:platform-snapshot]][mvn:platform-snapshot] | - - -## Gradle Convention -The `org.metaborg.convention` plugins applies any conventional configuration to Metaborg build and projects. It has the following plugins: - -- `org.metaborg.convention.settings`: Configures a build (in `settings.gradle.kts`) by applying a version catalog and the Develocity plugin. -- `org.metaborg.convention.java`: Configures a project as a Java project (library or application). -- `org.metaborg.convention.maven-publish`: Configures the Maven publications for a project. -- `org.metaborg.convention.root-project`: Configures the root project of a Gradle multi-project build. - -## Gradle Dependency Management -The `org.metaborg:catalog` artifact provides recommended versions for dependencies, and should be used in projects that are part of Spoofax. +[![Documentation][documentation-button]][documentation] -The `org.metaborg:platform` artifact enforces particular versions for Spoofax dependencies, and should be used by consumers of Spoofax libraries. -For special use cases, the `org.metaborg:platform-latest` and `org.metaborg:platform-snapshot` artifacts provide any latest releases and snapshots of Spoofax dependencies, respectively. These may not have been tested together. Therefore, it is recommended to use a particular release of `org.metaborg:platform` in production instead. +| Artifact | Latest Release | Latest Snapshot | +|----------|----------------|-----------------| +| `org.metaborg:catalog` | [![Release][mvn-rel-badge:org.metaborg:catalog]][mvn:org.metaborg:catalog] | [![Snapshot][mvn-snap-badge:org.metaborg:catalog]][mvn:org.metaborg:catalog] | +| `org.metaborg:platform` | [![Release][mvn-rel-badge:org.metaborg:platform]][mvn:org.metaborg:platform] | [![Snapshot][mvn-snap-badge:org.metaborg:platform]][mvn:org.metaborg:platform] | +| Gradle Plugin | Latest Release | Latest Snapshot | +|---------------|----------------|-----------------| +| `org.metaborg.convention.settings` | [![Release][mvn-rel-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]][mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]][mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin] | +| `org.metaborg.convention.java` | [![Release][mvn-rel-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]][mvn:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]][mvn:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin] | +| `org.metaborg.convention.maven-publish` | [![Release][mvn-rel-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]][mvn:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]][mvn:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin] | +| `org.metaborg.convention.root-project` | [![Release][mvn-rel-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]][mvn:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]][mvn:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin] | ## License Copyright 2024 [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) @@ -47,41 +29,31 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an **"as is" basis, without warranties or conditions of any kind**, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - [github-badge:build]: https://img.shields.io/github/actions/workflow/status/metaborg/metaborg-gradle/build.yaml [github:build]: https://github.com/metaborg/metaborg-gradle/actions [license-badge]: https://img.shields.io/github/license/metaborg/metaborg-gradle -[license]: https://github.com/metaborg/metaborg-gradle/blob/main/LICENSE +[license]: https://github.com/metaborg/metaborg-gradle/blob/main/LICENSE.md [github-badge:release]: https://img.shields.io/github/v/release/metaborg/metaborg-gradle?display_name=release [github:release]: https://github.com/metaborg/metaborg-gradle/releases [documentation-badge]: https://img.shields.io/badge/docs-latest-brightgreen [documentation]: https://spoofax.dev/metaborg-gradle/ [documentation-button]: https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=googledocs&logoColor=white -[mvn:convention.settings]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.settings~org.metaborg.convention.settings.gradle.plugin~~~ -[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: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~~~ -[mvn:platform-snapshot]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~platform-snapshot~~~ - -[mvn-rel-badge:convention.settings]: https://img.shields.io/nexus/r/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[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: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 -[mvn-rel-badge:platform-snapshot]: https://img.shields.io/nexus/r/org.metaborg/platform-snapshot?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 - -[mvn-snap-badge:convention.settings]: https://img.shields.io/nexus/s/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[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: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 -[mvn-snap-badge:platform-snapshot]: https://img.shields.io/nexus/s/org.metaborg/platform-snapshot?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn:org.metaborg:catalog]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~catalog~~~ +[mvn-rel-badge:org.metaborg:catalog]: https://img.shields.io/nexus/r/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn:org.metaborg:platform]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~platform~~~ +[mvn-rel-badge:org.metaborg:platform]: https://img.shields.io/nexus/r/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.settings~org.metaborg.convention.settings.gradle.plugin~~~ +[mvn-rel-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/r/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/s/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.java~org.metaborg.convention.java.gradle.plugin~~~ +[mvn-rel-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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-snap-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.maven-publish~org.metaborg.convention.maven-publish.gradle.plugin~~~ +[mvn-rel-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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-snap-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.root-project~org.metaborg.convention.root-project.gradle.plugin~~~ +[mvn-rel-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: 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-snap-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: 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 From 1b93705aec8b5dd164c4217c196505dd1f3b80ac Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 11:26:17 +0200 Subject: [PATCH 24/54] Generate Gradle wrapper --- .gitignore | 3 +- repo.yaml | 6 + .../org/metaborg/repoman/GenerateCommand.kt | 143 ++++++++++++++++-- .../org/metaborg/repoman/meta/RepoMetadata.kt | 69 +++++++-- .../resources/templates/build.gradle.kts.kte | 56 +++++++ .../templates/github/workflows/build.yaml.kte | 51 +++++++ .../github/workflows/documentation.yaml.kte | 14 ++ .../{.gitignore.kte => gitignore.kte} | 9 +- .../templates/settings.gradle.kts.kte | 38 +++++ 9 files changed, 356 insertions(+), 33 deletions(-) create mode 100644 repoman/src/main/resources/templates/build.gradle.kts.kte create mode 100644 repoman/src/main/resources/templates/github/workflows/build.yaml.kte create mode 100644 repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte rename repoman/src/main/resources/templates/{.gitignore.kte => gitignore.kte} (80%) create mode 100644 repoman/src/main/resources/templates/settings.gradle.kts.kte diff --git a/.gitignore b/.gitignore index 1f314c7..c3b0106 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,5 @@ local.properties .cache .DS_Store *.lock -jte-classes/ \ No newline at end of file +jte-classes/ + diff --git a/repo.yaml b/repo.yaml index 64b39cd..eadb382 100644 --- a/repo.yaml +++ b/repo.yaml @@ -16,6 +16,7 @@ libraries: - group: "org.metaborg" name: "platform" description: "Spoofax platform" + plugins: - id: "org.metaborg.convention.settings" description: "Settings convention plugin" @@ -30,3 +31,8 @@ developers: - id: "Virtlink" name: "Daniel A. A. Pelsmaeker" email: "developer@pelsmaeker.net" + +files: + githubWorkflows: + publishRelease: true + publishSnapshot: true \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index 2a96105..c6ca570 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -3,6 +3,8 @@ package org.metaborg.repoman import com.charleskorn.kaml.Yaml import com.charleskorn.kaml.decodeFromStream import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.path import gg.jte.ContentType @@ -10,9 +12,9 @@ import gg.jte.TemplateEngine import gg.jte.output.FileOutput import gg.jte.resolve.ResourceCodeResolver import org.metaborg.repoman.meta.RepoMetadata +import java.io.IOException import java.nio.file.Path -import kotlin.io.path.exists -import kotlin.io.path.inputStream +import kotlin.io.path.* /** * Generates or updates the files in a repository, including: @@ -38,6 +40,15 @@ object GenerateCommand: CliktCommand( val repoDir: Path? by option("-r", "--repo", help = "The directory with the repository") .path(canBeFile = false, canBeDir = true, mustExist = true) + /** The Gradle binary to invoke. */ + val gradleBin: String? by option("--gradle-bin", help = "The Gradle binary to invoke") + .default("gradle") + + /** Whether to force updating files even if they exist. Use this to just update all files and manually + * use version control to sort out what to actually update. */ + val forceUpdate: Boolean by option("-f", "--force-update", help = "Force updating files even if they exist") + .flag(default = false) + override fun run() { val repoDir = repoDir ?: Path.of(System.getProperty("user.dir")) @@ -53,6 +64,9 @@ object GenerateCommand: CliktCommand( generator.generateCodeOfConduct() generator.generateChangelog() generator.generateGitignore() + generator.generateGradleWrapper() + generator.generateGradleRootProject() + generator.generateGithubWorkflows() println("Done!") } @@ -71,48 +85,147 @@ object GenerateCommand: CliktCommand( private val metadata: RepoMetadata, ) { fun generateReadme() { - generate("README.md", metadata.files.readme.generate, metadata.files.readme.update) + val generate = metadata.files.readme.generate + val update = metadata.files.readme.update || forceUpdate + generate("README.md", generate, update) } fun generateLicense() { - generate("LICENSE.md", metadata.files.license.generate, metadata.files.license.update) + val generate = metadata.files.license.generate + val update = metadata.files.license.update || forceUpdate + generate("LICENSE.md", generate, update) } fun generateContributing() { - generate("CONTRIBUTING.md", metadata.files.contributing.generate, metadata.files.contributing.update) + val generate = metadata.files.contributing.generate + val update = metadata.files.contributing.update || forceUpdate + generate("CONTRIBUTING.md", generate, update) } fun generateCodeOfConduct() { - generate("CODE_OF_CONDUCT.md", metadata.files.codeOfConduct.generate, metadata.files.codeOfConduct.update) + val generate = metadata.files.codeOfConduct.generate + val update = metadata.files.codeOfConduct.update || forceUpdate + generate("CODE_OF_CONDUCT.md", generate, update) } fun generateChangelog() { - generate("CHANGELOG.md", metadata.files.changelog.generate, metadata.files.changelog.update) + val generate = metadata.files.changelog.generate + val update = metadata.files.changelog.update || forceUpdate + generate("CHANGELOG.md", generate, update) } fun generateGitignore() { - generate(".gitignore", metadata.files.gitignore.generate, metadata.files.gitignore.update) + val generate = metadata.files.gitignore.generate + val update = metadata.files.gitignore.update || forceUpdate + generate("gitignore", generate, update, path = ".gitignore") + } + + fun generateGradleWrapper() { + val generate = metadata.files.gradleWrapper.generate + val update = metadata.files.gradleWrapper.update || forceUpdate + generateGradleWrapper(generate, update) } - fun generate(filename: String, generate: Boolean, update: Boolean) { - val outputFile = repoDir.resolve(filename) + fun generateGradleRootProject() { + val generate = metadata.files.gradleRootProject.generate + val update = metadata.files.gradleRootProject.update || forceUpdate + generate("settings.gradle.kts", generate, update) + generate("build.gradle.kts", generate, update) + } + + fun generateGithubWorkflows() { + val generate = metadata.files.githubWorkflows.generate + val update = metadata.files.githubWorkflows.update || forceUpdate + generate("github/workflows/build.yaml", generate, update, path = ".github/workflows/build.yaml") + if (metadata.files.githubWorkflows.buildDocs) { + generate("github/workflows/documentation.yaml", generate, update, path = ".github/workflows/documentation.yaml") + } + } + + private fun generate(templateName: String, generate: Boolean, update: Boolean, path: String = templateName) { + val outputFile = repoDir.resolve(path) val outputFileExisted = outputFile.exists() if (!outputFileExisted && !generate) { - println("$filename: Not generated") + println("$path: Not generated") return } else if (outputFileExisted && !update) { - println("$filename: Not updated") + println("$path: Not updated") return } FileOutput(outputFile).use { output -> - engine.render("$filename.kte", metadata, output) + engine.render("$templateName.kte", metadata, output) } if (!outputFileExisted) { - println("$filename: Generated") + println("$path: Generated") + } else { + println("$path: Updated") + } + } + + @OptIn(ExperimentalPathApi::class) + private fun generateGradleWrapper(generate: Boolean, update: Boolean) { + // We use the gradle/wrapper/gradle-wrapper.properties file to determine whether a Gradle wrapper + // is present and configured, as this is the file that might be customized by the user. The other + // files can safely be regenerated. + val gradleWrapperProperties = repoDir.resolve("gradle/wrapper/gradle-wrapper.properties") + val gradleWrapperPropertiesExisted = gradleWrapperProperties.exists() + if (!gradleWrapperPropertiesExisted && !generate) { + println("Gradle wrapper: Not generated") + return + } else if (gradleWrapperPropertiesExisted && !update) { + println("Gradle wrapper: Not updated") + return + } + + // Generate the wrapper in a temporary directory and copy it to the repository + val tmpDir = createTempDirectory() + val settingsFile = tmpDir.resolve("settings.gradle.kts") + settingsFile.createFile() + val processBuilder = ProcessBuilder().apply { + command( + gradleBin, + "wrapper", + "--gradle-version=${metadata.files.gradleWrapper.gradleVersion}", + "--distribution-type=${metadata.files.gradleWrapper.gradleDistributionType}", + "--quiet", + ) + directory(tmpDir.toFile()) + // Merge STDERR into STDOUT + redirectErrorStream(true) + } + try { + // THROWS: IOException, SecurityException, UnsupportedOperationException + val process = processBuilder.start() + // NOTE: We don't close streams that we didn't open. + val stdout = process.inputStream.bufferedReader().readText() + // THROWS: InterruptedException + val exitCode = process.waitFor() + if (exitCode != 0) throw IOException(stdout.trim()) + } catch (ex: IOException) { + println("Gradle wrapper: Failed to generate: ${ex.message}") + return + } catch (ex: SecurityException) { + println("Gradle wrapper: Failed to generate: ${ex.message}") + return + } catch (ex: UnsupportedOperationException) { + println("Gradle wrapper: Failed to generate: ${ex.message}") + return + } catch (ex: InterruptedException) { + println("Gradle wrapper: Failed to generate: ${ex.message}") + return + } + + // Remove the temporary Gradle settings file + settingsFile.deleteExisting() + // Copy the generated files back to the repository directory, overwriting what's there + tmpDir.copyToRecursively(repoDir, followLinks = false, overwrite = true) + + if (!gradleWrapperPropertiesExisted) { + println("Gradle wrapper: Generated") } else { - println("$filename: Updated") + println("Gradle wrapper: Updated") } } } diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 3426502..69c3b5e 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -3,6 +3,15 @@ package org.metaborg.repoman.meta import kotlinx.serialization.Serializable import org.metaborg.repoman.Markdown +/** Default values. */ +object Defaults { + /** The default main branch in Gitonium. */ + const val MAIN_BRANCH = "main" + /** THe default release tag prefix in Gitonium. */ + const val RELEASE_TAG_PREFIX = "release-" +} + +/** Repository metadata. */ @Serializable data class RepoMetadata( /** The owner of the repo on GitHub. For example: `"metaborg"` */ @@ -10,7 +19,11 @@ data class RepoMetadata( /** The name of the repo on GitHub (required). For example: `"resource"` */ val repoName: String, /** The name of the main branch. For example: `"master"` */ - val mainBranch: String = "main", + val mainBranch: String = Defaults.MAIN_BRANCH, + /** The release tag prefix to use. For example: `"devenv-release/"` */ + val releaseTagPrefix: String = Defaults.RELEASE_TAG_PREFIX, + /** The default Maven group of the artifacts in the build. For example: `"org.metaborg.devenv"` */ + val mavenGroup: String = "org.metaborg", /** The title of the repo (required). For example: `"Metaborg Resource"` */ val title: String, @@ -56,8 +69,6 @@ data class Files( val gradleWrapper: GradleWrapper = GradleWrapper(), /** The metadata for the Gradle root project files. */ val gradleRootProject: GradleRootProject = GradleRootProject(), - /** The metadata for the documentation (not generated by default). */ - val docs: Docs = Docs(), /** The metadata for the GitHub workflows. */ val githubWorkflows: GithubWorkflows = GithubWorkflows(), ) @@ -116,6 +127,8 @@ data class Gitignore( val generate: Boolean = true, /** Whether to update the file. */ val update: Boolean = true, + /** Extra entries to include at the bottom of the .gitignore file; or `null`. */ + val extra: String? = null, ) /** Metadata for the .gradlew files. */ @@ -127,6 +140,8 @@ data class GradleWrapper( val update: Boolean = true, /** The version of the Gradle wrapper to generate. */ val gradleVersion: String = "7.6.4", + /** The kind of Gradle distribution type to use, either `"bin"` or `"all"`. */ + val gradleDistributionType: String = "bin", ) /** Metadata for the Gradle root project files. */ @@ -135,33 +150,36 @@ data class GradleRootProject( /** Whether to generate the files. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = false, + /** The name of the root project. */ + val rootProjectName: String? = null, + /** Included builds. */ + val includedBuilds: List = emptyList(), + /** Included projects. */ + val includedProjects: List = emptyList(), /** The version of the Metaborg Gradle convention to use. */ val conventionVersion: String = "latest.integration", /** Whether to create `publish` tasks that delegate to the included builds and subprojects. */ val createPublishTasks: Boolean = false, ) -/** Metadata for the MkDocs documentation files. */ -@Serializable -data class Docs( - /** Whether to generate the files. */ - val generate: Boolean = true, - /** Whether to update the file. */ - val update: Boolean = false, -) - /** Metadata for the GitHub workflows. */ @Serializable data class GithubWorkflows( /** Whether to generate the files. */ - val generate: Boolean = false, + val generate: Boolean = true, /** Whether to update the file. */ val update: Boolean = true, /** Whether to publish releases using GitHub CI (instead of Jenkins or something else). */ - val releaseOnGitHub: Boolean = false, + val publishRelease: Boolean = false, /** Whether to publish snapshots using GitHub CI. */ - val snapshotOnGitHub: Boolean = false, + val publishSnapshot: Boolean = false, + /** The Gradle `:build` task to use. */ + val buildTask: String = "build", // NOTE: No `:` prefix to allow Gradle to figure it out itself. + /** The Gradle `:publish` task to use. */ + val publishTask: String = "publish", // NOTE: No `:` prefix to allow Gradle to figure it out itself. + /** The Gradle `:printVersion` task to use. */ + val printVersionTask: String = ":printVersion", /** Whether to build and publish the documentation using GitHub CI. */ val buildDocs: Boolean = false, ) @@ -186,6 +204,7 @@ data class GradlePlugin( val description: Markdown? = null, ) +/** A developer. */ @Serializable data class Developer( /** The ID of the developer, usually their GitHub nickname. */ @@ -194,4 +213,22 @@ data class Developer( val name: String, /** The e-mail address of the developer. */ val email: String, +) + +/** An included build. */ +@Serializable +data class IncludedBuild( + /** The name of the included build; or `null` to use the default. */ + val name: String? = null, + /** The path to the included build. */ + val path: String, +) + +/** An included project. */ +@Serializable +data class IncludedProject( + /** The name of the included project. */ + val name: String, + /** The path to the included project; or `null` to use the default. */ + val path: String? = null, ) \ No newline at end of file diff --git a/repoman/src/main/resources/templates/build.gradle.kts.kte b/repoman/src/main/resources/templates/build.gradle.kts.kte new file mode 100644 index 0000000..7ed0f40 --- /dev/null +++ b/repoman/src/main/resources/templates/build.gradle.kts.kte @@ -0,0 +1,56 @@ +@import org.metaborg.repoman.meta.Defaults +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +import org.metaborg.convention.Developer +import org.metaborg.convention.MavenPublishConventionExtension + +// Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + id("org.metaborg.convention.root-project") + alias(libs.plugins.gitonium) +} + +@if(meta.files.gradleRootProject.createPublishTasks) +rootProjectConvention { + // Add `publishAll` and `publish` tasks that delegate to the subprojects and included builds. + registerPublishTasks.set(true) +} +@endif + +allprojects { + apply(plugin = "org.metaborg.gitonium") + +@if(meta.mainBranch != Defaults.MAIN_BRANCH || meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) + // Configure Gitonium before setting the version + gitonium { + @if(meta.mainBranch != Defaults.MAIN_BRANCH) + mainBranch.set("${meta.mainBranch}") + @endif + @if(meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) + tagPrefix.set("${meta.releaseTagPrefix}") + @endif + } +@endif + + version = gitonium.version + group = "${meta.mavenGroup}" + + pluginManager.withPlugin("org.metaborg.convention.maven-publish") { + extensions.configure(MavenPublishConventionExtension::class.java) { + repoOwner.set("${meta.repoOwner}") + repoName.set("${meta.repoName}") + + metadata { + inceptionYear.set("${meta.inceptionYear}") +@if(meta.developers.isNotEmpty()) + developers.set(listOf( + @for(entry in meta.developers) + Developer("${entry.id}", "${entry.name}", "${entry.email}"), + @endfor + )) +@endif + } + } + } +} diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte new file mode 100644 index 0000000..59229fe --- /dev/null +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -0,0 +1,51 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +--- +name: 'Build & Publish' + +on: # yamllint disable-line rule:truthy + push: + pull_request: + branches: + - ${meta.mainBranch} + +jobs: + build: + uses: metaborg/actions/.github/workflows/gradle-build-matrix.yaml@main + with: + gradle-command: | + gradle ${meta.files.githubWorkflows.buildTask} +@if(meta.files.githubWorkflows.publishSnapshot) + + publish-snapshot: + uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main + with: + gradle-command: | + gradle ${meta.files.githubWorkflows.publishTask} -Pgitonium.isSnapshot=true + gradle-version-command: | + gradle -q ${meta.files.githubWorkflows.printVersionTask} -Pgitonium.isSnapshot=true + if: "github.event_name == 'push' && github.ref == 'refs/heads/${meta.mainBranch}'" + needs: [build] + secrets: + @raw + METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} + @endraw +@endif +@if(meta.files.githubWorkflows.publishRelease) + + publish-release: + uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main + with: + gradle-command: | + gradle ${meta.files.githubWorkflows.publishTask} + gradle-version-command: | + gradle -q ${meta.files.githubWorkflows.printVersionTask} + if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/${meta.releaseTagPrefix}')" + needs: [build] + secrets: + @raw + METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} + @endraw +@endif \ No newline at end of file diff --git a/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte b/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte new file mode 100644 index 0000000..cda4fba --- /dev/null +++ b/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte @@ -0,0 +1,14 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +--- +name: 'Documentation' + +on: # yamllint disable-line rule:truthy + push: + branches: + - ${meta.mainBranch} + workflow_dispatch: {} # Allow running this workflow manually (Actions tab) + +jobs: + documentation: + uses: metaborg/actions/.github/workflows/mkdocs-material.yaml@main diff --git a/repoman/src/main/resources/templates/.gitignore.kte b/repoman/src/main/resources/templates/gitignore.kte similarity index 80% rename from repoman/src/main/resources/templates/.gitignore.kte rename to repoman/src/main/resources/templates/gitignore.kte index 1f314c7..76d70b9 100644 --- a/repoman/src/main/resources/templates/.gitignore.kte +++ b/repoman/src/main/resources/templates/gitignore.kte @@ -1,3 +1,5 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata # Java *.class *.log @@ -68,4 +70,9 @@ local.properties .cache .DS_Store *.lock -jte-classes/ \ No newline at end of file +jte-classes/ + +@if(meta.files.gitignore.extra != null) +# Extra +${meta.files.gitignore.extra} +@endif \ No newline at end of file diff --git a/repoman/src/main/resources/templates/settings.gradle.kts.kte b/repoman/src/main/resources/templates/settings.gradle.kts.kte new file mode 100644 index 0000000..5920185 --- /dev/null +++ b/repoman/src/main/resources/templates/settings.gradle.kts.kte @@ -0,0 +1,38 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +dependencyResolutionManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + mavenCentral() + } +} + +pluginManagement { + repositories { + maven("https://artifacts.metaborg.org/content/groups/public/") + gradlePluginPortal() + } +} + +plugins { + id("org.metaborg.convention.settings") version "${meta.files.gradleRootProject.conventionVersion}" +} + +@if(meta.files.gradleRootProject.rootProjectName != null) +rootProject.name = "${meta.files.gradleRootProject.rootProjectName}" +@endif + +@for(entry in meta.files.gradleRootProject.includedProjects) +include(":${entry.name}") + @if(entry.path != null) +project(":${entry.name}").projectDir = file("${entry.path}") + @endif +@endfor + +@for(entry in meta.files.gradleRootProject.includedBuilds) + @if(entry.name != null) +includeBuild("${entry.path}") { name = "${entry.name}" } + @else +includeBuild("${entry.path}") + @endif +@endfor \ No newline at end of file From 26497cb9c2048170221339b8091e446992285478 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 15:42:38 +0200 Subject: [PATCH 25/54] Update Spoofax Releng to 0.1.41 --- depman/gradle/libs.versions.toml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 1da0b40..83e2e32 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -16,17 +16,17 @@ metaborg-resource = "0.14.1" # https://github.com spoofax3 = "0.23.1" # https://github.com/metaborg/spoofax-pie/ spoofax2 = "2.5.21" # https://spoofax.dev/ (https://github.com/metaborg/spoofax-releng) -esv = "0.1.38" # https://github.com/metaborg/esv/ -jsglr = "0.1.38" # https://github.com/metaborg/jsglr/ -mb-exec = "0.1.38" # https://github.com/metaborg/mb-exec/ -mb-rep = "0.1.38" # https://github.com/metaborg/mb-rep/ -nabl = "0.1.38" # https://github.com/metaborg/nabl/ -sdf = "0.1.38" # https://github.com/metaborg/sdf/ -spoofax-core = "0.1.38" # https://github.com/metaborg/spoofax/ -spoofax-gradle = "0.1.40" # https://github.com/metaborg/spoofax.gradle/ -spt = "0.1.38" # https://github.com/metaborg/spt/ -stratego = "0.1.38" # https://github.com/metaborg/stratego/ -strategoxt = "0.1.38" # https://github.com/metaborg/strategoxt/ +esv = "0.1.41" # https://github.com/metaborg/esv/ +jsglr = "0.1.41" # https://github.com/metaborg/jsglr/ +mb-exec = "0.1.41" # https://github.com/metaborg/mb-exec/ +mb-rep = "0.1.41" # https://github.com/metaborg/mb-rep/ +nabl = "0.1.41" # https://github.com/metaborg/nabl/ +sdf = "0.1.41" # https://github.com/metaborg/sdf/ +spoofax-core = "0.1.41" # https://github.com/metaborg/spoofax/ +spoofax-gradle = "0.1.41" # https://github.com/metaborg/spoofax.gradle/ +spt = "0.1.41" # https://github.com/metaborg/spt/ +stratego = "0.1.41" # https://github.com/metaborg/stratego/ +strategoxt = "0.1.41" # https://github.com/metaborg/strategoxt/ # Kotlin From 15f9e04399c4f75cb7a2fb1075ffd86dfbdbeb33 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 15:50:14 +0200 Subject: [PATCH 26/54] Fix github build workflow --- .github/workflows/build.yaml | 10 +++++++--- repo.yaml | 3 ++- .../templates/github/workflows/build.yaml.kte | 16 ++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 497d2e5..5c33c26 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,11 +10,15 @@ on: # yamllint disable-line rule:truthy jobs: build: uses: metaborg/actions/.github/workflows/gradle-build-matrix.yaml@main + with: + gradle-command: | + gradle build +# Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: gradle-command: | - gradle :publish -Pgitonium.isSnapshot=true + gradle publish -Pgitonium.isSnapshot=true gradle-version-command: | gradle -q :convention-plugin:printVersion -Pgitonium.isSnapshot=true if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" @@ -22,11 +26,12 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} +# Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: gradle-command: | - gradle :publish + gradle publish gradle-version-command: | gradle -q :convention-plugin:printVersion if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')" @@ -34,4 +39,3 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - diff --git a/repo.yaml b/repo.yaml index eadb382..9b41cf5 100644 --- a/repo.yaml +++ b/repo.yaml @@ -35,4 +35,5 @@ developers: files: githubWorkflows: publishRelease: true - publishSnapshot: true \ No newline at end of file + publishSnapshot: true + printVersionTask: ":convention-plugin:printVersion" \ No newline at end of file diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte index 59229fe..030c5a5 100644 --- a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -16,7 +16,7 @@ jobs: gradle-command: | gradle ${meta.files.githubWorkflows.buildTask} @if(meta.files.githubWorkflows.publishSnapshot) - +# Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -27,13 +27,11 @@ jobs: if: "github.event_name == 'push' && github.ref == 'refs/heads/${meta.mainBranch}'" needs: [build] secrets: - @raw - METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} - METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - @endraw + METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} @endif @if(meta.files.githubWorkflows.publishRelease) - +# Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -44,8 +42,6 @@ jobs: if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/${meta.releaseTagPrefix}')" needs: [build] secrets: - @raw - METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} - METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - @endraw + METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} @endif \ No newline at end of file From a8ae0405c5d7a4c0292ab300fcf5d3bc74b08def Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 15:59:42 +0200 Subject: [PATCH 27/54] Update metaborg-gradle to 0.15.6 --- depman/gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depman/gradle/libs.versions.toml b/depman/gradle/libs.versions.toml index 83e2e32..bf3290f 100644 --- a/depman/gradle/libs.versions.toml +++ b/depman/gradle/libs.versions.toml @@ -4,7 +4,7 @@ kotlin = "1.8.20" # https://kotlinlang gitonium = "1.7.5" # https://github.com/metaborg/gitonium foojay = "0.8.0" # https://github.com/gradle/foojay-toolchains metaborg-gradle-config = "0.7.3" # https://github.com/metaborg/gradle.config -metaborg-gradle = "0.15.0" # https://github.com/metaborg/metaborg-gradle +metaborg-gradle = "0.15.6" # https://github.com/metaborg/metaborg-gradle develocity = "3.17.5" # https://docs.gradle.com/develocity/gradle-plugin/current/ (https://plugins.gradle.org/plugin/com.gradle.develocity) # Spoofax From 790b928eea8136d13d4377b883373305268c6d68 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 22:20:57 +0200 Subject: [PATCH 28/54] Fix publish branch --- repoman/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repoman/build.gradle.kts b/repoman/build.gradle.kts index f7083f9..6dedb2a 100644 --- a/repoman/build.gradle.kts +++ b/repoman/build.gradle.kts @@ -46,7 +46,7 @@ publishing { mavenPublishConvention { repoOwner.set("metaborg") - repoName.set("metaborg-git") + repoName.set("metaborg-gradle") metadata { inceptionYear.set("2024") From bc08f07cc14cd177ded46e4a4192b2c102563b02 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 26 Jul 2024 23:11:53 +0200 Subject: [PATCH 29/54] Publish dist tar/zip --- repoman/build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repoman/build.gradle.kts b/repoman/build.gradle.kts index 6dedb2a..dcce129 100644 --- a/repoman/build.gradle.kts +++ b/repoman/build.gradle.kts @@ -38,8 +38,10 @@ javaConvention { publishing { publications { - create("mavenJava") { + create("mavenApp") { from(components["java"]) + artifact(tasks.distZip) + artifact(tasks.distTar) } } } From 61653f2fc0a07440154cf0d634596218a0d7ac28 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Sat, 27 Jul 2024 00:08:46 +0200 Subject: [PATCH 30/54] Add docs --- docs/content/projects/application.md | 62 ++++++++++++++++++++++++++++ docs/content/projects/index.md | 7 ++++ docs/content/projects/library.md | 46 +++++++++++++++++++++ docs/mkdocs.yml | 4 ++ 4 files changed, 119 insertions(+) create mode 100644 docs/content/projects/application.md create mode 100644 docs/content/projects/index.md create mode 100644 docs/content/projects/library.md diff --git a/docs/content/projects/application.md b/docs/content/projects/application.md new file mode 100644 index 0000000..26b6239 --- /dev/null +++ b/docs/content/projects/application.md @@ -0,0 +1,62 @@ +--- +title: "Application" +--- +# Application Project +An application project is runnable as a JAR and publishes TAR and ZIP artifacts that make running the application easier. The `build.gradle.kts` file is constructed as follows: + +## Plugins +At the very least, we need the following plugins: + +- the `application` plugin produces a runnable JAR; +- the `org.metaborg.convention.java` plugin applies the Metaborg convention for Java projects; +- the `org.metaborg.convention.maven-publish` plugin allows the project to be published in a Maven repository; and + +```kotlin title="build.gradle.kts" +// Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + application + id("org.metaborg.convention.java") + id("org.metaborg.convention.maven-publish") +} +``` + +!!! tip "" + The `@Suppress("DSL_SCOPE_VIOLATION")` [suppresses an error in IntelliJ](https://youtrack.jetbrains.com/issue/KTIJ-19369) when using `libs` and Gradle 7. This is not necessary in Gradle 8 or newer. + + + +## Main Class +When running the JAR from the command line, by default the main class is executed. This is set using the `application.mainClass` property: + +```kotlin title="build.gradle.kts +application { + mainClass.set("org.metaborg.myapp.Program") +} +``` + + +## Publications +To be able to publish the application using the `maven-publish` plugin, we need to configure the publications. For an application, these are the recommended publications: + +```kotlin title="build.gradle.kts +publishing { + publications { + create("mavenApp") { + from(components["java"]) + artifact(tasks.distZip) + artifact(tasks.distTar) + } + } +} +``` + +The `distZip` and `distTar` tasks build a ZIP and TAR, respectively, that include not only the application JAR but also its runtime dependencies and special scripts for running the application from the command-line. + + +## Maven Publish Convention +The `org.metaborg.convention.maven-publish` convention [must also be configured](../conventions/mavenpublish.md). This is usually done in the root project. + + +## Gitonium +The `org.metaborg.gitonium` plugin should be configured, also usually in the root project. diff --git a/docs/content/projects/index.md b/docs/content/projects/index.md new file mode 100644 index 0000000..a097fc3 --- /dev/null +++ b/docs/content/projects/index.md @@ -0,0 +1,7 @@ +--- +title: "Projects" +--- +# Project Configurations + +- [Application project](./application.md) +- [Library project](./library.md) diff --git a/docs/content/projects/library.md b/docs/content/projects/library.md new file mode 100644 index 0000000..83534ed --- /dev/null +++ b/docs/content/projects/library.md @@ -0,0 +1,46 @@ +--- +title: "Library" +--- +# Library Project +A library project is published as a JAR to Maven and can be used as a dependency for other projects. The `build.gradle.kts` file is constructed as follows: + +## Plugins +At the very least, we need the following plugins: + +- the `java-library` plugin produces a library JAR; +- the `org.metaborg.convention.java` plugin applies the Metaborg convention for Java projects; +- the `org.metaborg.convention.maven-publish` plugin allows the project to be published in a Maven repository; and + +```kotlin title="build.gradle.kts" +// Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 +@Suppress("DSL_SCOPE_VIOLATION") +plugins { + `java-library` + id("org.metaborg.convention.java") + id("org.metaborg.convention.maven-publish") +} +``` + +!!! tip "" + The `@Suppress("DSL_SCOPE_VIOLATION")` [suppresses an error in IntelliJ](https://youtrack.jetbrains.com/issue/KTIJ-19369) when using `libs` and Gradle 7. This is not necessary in Gradle 8 or newer. + + +## Publications +To be able to publish the application using the `maven-publish` plugin, we need to configure the publications. For a library, this is the recommended publication: + +```kotlin title="build.gradle.kts +publishing { + publications { + create("mavenLibrary") { + from(components["java"]) + } + } +``` + + +## Maven Publish Convention +The `org.metaborg.convention.maven-publish` convention [must also be configured](../conventions/mavenpublish.md). This is usually done in the root project. + + +## Gitonium +The `org.metaborg.gitonium` plugin should be configured, also usually in the root project. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index d45d372..58ca180 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -18,6 +18,10 @@ nav: - conventions/mavenpublish.md - conventions/rootproject.md - conventions/settings.md + - Projects: + - projects/index.md + - projects/application.md + - projects/library.md theme: name: material From 9b3dde7a05b48832e540baadadfab7b2a41c3203 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Sat, 27 Jul 2024 01:15:27 +0200 Subject: [PATCH 31/54] Support developers and contributors --- .../MavenPublishConventionExtension.kt | 18 ++++++++------- .../MavenPublishConventionPlugin.kt | 22 +++++++++++++++---- repo.yaml | 1 - repoman/build.gradle.kts | 4 ++-- repoman/examplemeta.yaml | 2 -- .../org/metaborg/repoman/meta/RepoMetadata.kt | 20 +++++++++-------- .../resources/templates/build.gradle.kts.kte | 11 ++++++++-- 7 files changed, 50 insertions(+), 28 deletions(-) delete mode 100644 repoman/examplemeta.yaml diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionExtension.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionExtension.kt index 713234a..0d4ab4b 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionExtension.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionExtension.kt @@ -40,7 +40,9 @@ open class MavenPublishConventionExtension @Inject constructor( /** The year the project was started. */ val inceptionYear: Property = objects.property(String::class.java) /** The developers of the project. */ - val developers: ListProperty = objects.listProperty(Developer::class.java) + val developers: ListProperty = objects.listProperty(Person::class.java) + /** The (main) contributors of the project. */ + val contributors: ListProperty = objects.listProperty(Person::class.java) /** The source control management system. */ val scm: Property = objects.property(SCM::class.java) .convention(SCM.GitHub) @@ -57,14 +59,14 @@ open class MavenPublishConventionExtension @Inject constructor( } -/** Specifies a developer. */ -data class Developer( - /** The developer's ID or username. */ - val id: String, - /** The developer's full name. */ +/** Specifies a person. */ +data class Person( + /** The person's full name. */ val name: String, - /** The developer's email address. */ - val email: String, + /** The person's ID or username. */ + val id: String? = null, + /** The person's email address. */ + val email: String? = null, ) diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt index 1097d56..14af880 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/MavenPublishConventionPlugin.kt @@ -47,13 +47,27 @@ class MavenPublishConventionPlugin: Plugin { distribution.set("repo") } } + organization { + name.set("Programming Languages Group, Delft University of Technology") + url.set("https://pl.ewi.tudelft.nl/") + } developers { metadata.developers.map { - for (dev in it) { + for (person in it) { developer { - id.set(dev.id) - name.set(dev.name) - email.set(dev.email) + id.set(person.id) + name.set(person.name) + email.set(person.email) + } + } + } + } + contributors { + metadata.contributors.map { + for (person in it) { + contributor { + name.set(person.name) + email.set(person.email) } } } diff --git a/repo.yaml b/repo.yaml index 9b41cf5..73ae9db 100644 --- a/repo.yaml +++ b/repo.yaml @@ -30,7 +30,6 @@ plugins: developers: - id: "Virtlink" name: "Daniel A. A. Pelsmaeker" - email: "developer@pelsmaeker.net" files: githubWorkflows: diff --git a/repoman/build.gradle.kts b/repoman/build.gradle.kts index dcce129..f166faf 100644 --- a/repoman/build.gradle.kts +++ b/repoman/build.gradle.kts @@ -1,4 +1,4 @@ -import org.metaborg.convention.Developer +import org.metaborg.convention.Person // Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 @Suppress("DSL_SCOPE_VIOLATION") @@ -53,7 +53,7 @@ mavenPublishConvention { metadata { inceptionYear.set("2024") developers.set(listOf( - Developer("Virtlink", "Daniel A. A. Pelsmaeker", "developer@pelsmaeker.net"), + Person("Virtlink", "Daniel A. A. Pelsmaeker", "developer@pelsmaeker.net"), )) } } diff --git a/repoman/examplemeta.yaml b/repoman/examplemeta.yaml deleted file mode 100644 index ef7363d..0000000 --- a/repoman/examplemeta.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -name: "My name" \ No newline at end of file diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 69c3b5e..04b73e8 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -43,8 +43,10 @@ data class RepoMetadata( /** A list of Gradle plugins published by the repo. */ val plugins: List = emptyList(), - /** An ordered list of (main) developers that worked on the repo. */ - val developers: List = emptyList(), + /** An ordered list of developers that may be contacted about the repo. */ + val developers: List = emptyList(), + /** An ordered list of (main) contributors that also worked on the repo. */ + val contributors: List = emptyList(), /** The configurations for the generated files. */ val files: Files = Files(), @@ -204,15 +206,15 @@ data class GradlePlugin( val description: Markdown? = null, ) -/** A developer. */ +/** A person. */ @Serializable -data class Developer( - /** The ID of the developer, usually their GitHub nickname. */ - val id: String, - /** The (full) name of the developer. */ +data class Person( + /** The ID of the person, usually their GitHub nickname. */ + val id: String? = null, + /** The (full) name of the person. */ val name: String, - /** The e-mail address of the developer. */ - val email: String, + /** The e-mail address of the person. */ + val email: String? = null, ) /** An included build. */ diff --git a/repoman/src/main/resources/templates/build.gradle.kts.kte b/repoman/src/main/resources/templates/build.gradle.kts.kte index 7ed0f40..3bcefe5 100644 --- a/repoman/src/main/resources/templates/build.gradle.kts.kte +++ b/repoman/src/main/resources/templates/build.gradle.kts.kte @@ -1,7 +1,7 @@ @import org.metaborg.repoman.meta.Defaults @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata -import org.metaborg.convention.Developer +import org.metaborg.convention.Person import org.metaborg.convention.MavenPublishConventionExtension // Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369 @@ -46,7 +46,14 @@ allprojects { @if(meta.developers.isNotEmpty()) developers.set(listOf( @for(entry in meta.developers) - Developer("${entry.id}", "${entry.name}", "${entry.email}"), + Person("${entry.name}", email = ${if (entry.email != null) "\"${entry.email}\"" else "null"}, id = ${if (entry.id != null) "\"${entry.id}\"" else "null"}), + @endfor + )) +@endif +@if(meta.contributors.isNotEmpty()) + contributors.set(listOf( + @for(entry in meta.contributors) + Person("${entry.name}", email = ${if (entry.email != null) "\"${entry.email}\"" else "null"}, id = ${if (entry.id != null) "\"${entry.id}\"" else "null"}), @endfor )) @endif From f9edf77cf2d89afa64441a8178e44e9c8ae0a01b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Sat, 27 Jul 2024 01:21:30 +0200 Subject: [PATCH 32/54] Update repo metadata --- repo.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/repo.yaml b/repo.yaml index 73ae9db..373eb04 100644 --- a/repo.yaml +++ b/repo.yaml @@ -35,4 +35,13 @@ files: githubWorkflows: publishRelease: true publishSnapshot: true - printVersionTask: ":convention-plugin:printVersion" \ No newline at end of file + printVersionTask: ":convention-plugin:printVersion" + gradleRootProject: + update: true + createPublishTasks: true + rootProjectName: "metaborg-gradle-project" + includedBuilds: + - path: "convention-plugin/" + - path: "depman/" + - path: "example/" + - path: "repoman/" From 9b910f133734c68f19fa9b860af7c9ab5095ec99 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Sat, 27 Jul 2024 01:58:54 +0200 Subject: [PATCH 33/54] Don't update --- repo.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/repo.yaml b/repo.yaml index 373eb04..04bc025 100644 --- a/repo.yaml +++ b/repo.yaml @@ -37,7 +37,6 @@ files: publishSnapshot: true printVersionTask: ":convention-plugin:printVersion" gradleRootProject: - update: true createPublishTasks: true rootProjectName: "metaborg-gradle-project" includedBuilds: From e3cbb8df3f7b651959f2c497972423799b9a3ca1 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 17:00:56 +0200 Subject: [PATCH 34/54] Trim leading colon --- repoman/src/main/resources/templates/settings.gradle.kts.kte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repoman/src/main/resources/templates/settings.gradle.kts.kte b/repoman/src/main/resources/templates/settings.gradle.kts.kte index 5920185..35dec8c 100644 --- a/repoman/src/main/resources/templates/settings.gradle.kts.kte +++ b/repoman/src/main/resources/templates/settings.gradle.kts.kte @@ -23,9 +23,9 @@ rootProject.name = "${meta.files.gradleRootProject.rootProjectName}" @endif @for(entry in meta.files.gradleRootProject.includedProjects) -include(":${entry.name}") +include(":${entry.name.trimStart(':')}") @if(entry.path != null) -project(":${entry.name}").projectDir = file("${entry.path}") +project(":${entry.name.trimStart(':')}").projectDir = file("${entry.path}") @endif @endfor From 56845583ec0421151595df5c8506b056b6abaa3a Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 17:19:47 +0200 Subject: [PATCH 35/54] Fix indentation --- .../resources/templates/build.gradle.kts.kte | 28 +++++++++---------- .../templates/settings.gradle.kts.kte | 10 +++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/repoman/src/main/resources/templates/build.gradle.kts.kte b/repoman/src/main/resources/templates/build.gradle.kts.kte index 3bcefe5..c1de171 100644 --- a/repoman/src/main/resources/templates/build.gradle.kts.kte +++ b/repoman/src/main/resources/templates/build.gradle.kts.kte @@ -21,17 +21,17 @@ rootProjectConvention { allprojects { apply(plugin = "org.metaborg.gitonium") -@if(meta.mainBranch != Defaults.MAIN_BRANCH || meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) + @if(meta.mainBranch != Defaults.MAIN_BRANCH || meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) // Configure Gitonium before setting the version gitonium { - @if(meta.mainBranch != Defaults.MAIN_BRANCH) + @if(meta.mainBranch != Defaults.MAIN_BRANCH) mainBranch.set("${meta.mainBranch}") - @endif - @if(meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) + @endif + @if(meta.releaseTagPrefix != Defaults.RELEASE_TAG_PREFIX) tagPrefix.set("${meta.releaseTagPrefix}") - @endif + @endif } -@endif + @endif version = gitonium.version group = "${meta.mavenGroup}" @@ -43,20 +43,20 @@ allprojects { metadata { inceptionYear.set("${meta.inceptionYear}") -@if(meta.developers.isNotEmpty()) + @if(meta.developers.isNotEmpty()) developers.set(listOf( - @for(entry in meta.developers) + @for(entry in meta.developers) Person("${entry.name}", email = ${if (entry.email != null) "\"${entry.email}\"" else "null"}, id = ${if (entry.id != null) "\"${entry.id}\"" else "null"}), - @endfor + @endfor )) -@endif -@if(meta.contributors.isNotEmpty()) + @endif + @if(meta.contributors.isNotEmpty()) contributors.set(listOf( - @for(entry in meta.contributors) + @for(entry in meta.contributors) Person("${entry.name}", email = ${if (entry.email != null) "\"${entry.email}\"" else "null"}, id = ${if (entry.id != null) "\"${entry.id}\"" else "null"}), - @endfor + @endfor )) -@endif + @endif } } } diff --git a/repoman/src/main/resources/templates/settings.gradle.kts.kte b/repoman/src/main/resources/templates/settings.gradle.kts.kte index 35dec8c..cd4687b 100644 --- a/repoman/src/main/resources/templates/settings.gradle.kts.kte +++ b/repoman/src/main/resources/templates/settings.gradle.kts.kte @@ -24,15 +24,15 @@ rootProject.name = "${meta.files.gradleRootProject.rootProjectName}" @for(entry in meta.files.gradleRootProject.includedProjects) include(":${entry.name.trimStart(':')}") - @if(entry.path != null) +@if(entry.path != null) project(":${entry.name.trimStart(':')}").projectDir = file("${entry.path}") - @endif +@endif @endfor @for(entry in meta.files.gradleRootProject.includedBuilds) - @if(entry.name != null) +@if(entry.name != null) includeBuild("${entry.path}") { name = "${entry.name}" } - @else +@else includeBuild("${entry.path}") - @endif +@endif @endfor \ No newline at end of file From 09d7679b5730abb407920eb63e2b441f6efcb3c7 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 17:26:57 +0200 Subject: [PATCH 36/54] Add update warnings --- repoman/src/main/resources/templates/CHANGELOG.md.kte | 8 ++++++++ repoman/src/main/resources/templates/CONTRIBUTING.md.kte | 8 ++++++++ repoman/src/main/resources/templates/README.md.kte | 8 ++++++++ repoman/src/main/resources/templates/build.gradle.kts.kte | 6 ++++++ repoman/src/main/resources/templates/gitignore.kte | 6 ++++++ .../src/main/resources/templates/settings.gradle.kts.kte | 6 ++++++ 6 files changed, 42 insertions(+) diff --git a/repoman/src/main/resources/templates/CHANGELOG.md.kte b/repoman/src/main/resources/templates/CHANGELOG.md.kte index 27e9776..96ef1ff 100644 --- a/repoman/src/main/resources/templates/CHANGELOG.md.kte +++ b/repoman/src/main/resources/templates/CHANGELOG.md.kte @@ -1,5 +1,13 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.changelog.update) + + +@endif # Changelog All notable changes to this project will be documented in this file. diff --git a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte index dacca16..8a62296 100644 --- a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte +++ b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte @@ -1,5 +1,13 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.contributing.update) + + +@endif # ${meta.title} ## How to Contribute diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte index a18d063..f55730d 100644 --- a/repoman/src/main/resources/templates/README.md.kte +++ b/repoman/src/main/resources/templates/README.md.kte @@ -1,5 +1,13 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.readme.update) + + +@endif # ${meta.title} [![Build][github-badge:build]][github:build] [![License][license-badge]][license] diff --git a/repoman/src/main/resources/templates/build.gradle.kts.kte b/repoman/src/main/resources/templates/build.gradle.kts.kte index c1de171..e1c686f 100644 --- a/repoman/src/main/resources/templates/build.gradle.kts.kte +++ b/repoman/src/main/resources/templates/build.gradle.kts.kte @@ -1,6 +1,12 @@ @import org.metaborg.repoman.meta.Defaults @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.gradleRootProject.update) +// !! THIS FILE WAS GENERATED USING repoman !! +// Modify `repo.yaml` instead and use `repoman` to update this file +// See: https://github.com/metaborg/metaborg-gradle/ + +@endif import org.metaborg.convention.Person import org.metaborg.convention.MavenPublishConventionExtension diff --git a/repoman/src/main/resources/templates/gitignore.kte b/repoman/src/main/resources/templates/gitignore.kte index 76d70b9..1e3040d 100644 --- a/repoman/src/main/resources/templates/gitignore.kte +++ b/repoman/src/main/resources/templates/gitignore.kte @@ -1,5 +1,11 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.gitignore.update) +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + +@endif # Java *.class *.log diff --git a/repoman/src/main/resources/templates/settings.gradle.kts.kte b/repoman/src/main/resources/templates/settings.gradle.kts.kte index cd4687b..7f14f90 100644 --- a/repoman/src/main/resources/templates/settings.gradle.kts.kte +++ b/repoman/src/main/resources/templates/settings.gradle.kts.kte @@ -1,5 +1,11 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata +@if(meta.files.gradleRootProject.update) +// !! THIS FILE WAS GENERATED USING repoman !! +// Modify `repo.yaml` instead and use `repoman` to update this file +// See: https://github.com/metaborg/metaborg-gradle/ + +@endif dependencyResolutionManagement { repositories { maven("https://artifacts.metaborg.org/content/groups/public/") From d8b5dae02e459b107d257bc519e69ca7f4b18eaf Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 22:17:00 +0200 Subject: [PATCH 37/54] Fix indentation --- .../templates/github/workflows/build.yaml.kte | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte index 030c5a5..e03aab6 100644 --- a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -15,8 +15,8 @@ jobs: with: gradle-command: | gradle ${meta.files.githubWorkflows.buildTask} -@if(meta.files.githubWorkflows.publishSnapshot) -# Publish snapshots + @if(meta.files.githubWorkflows.publishSnapshot) + # Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -29,9 +29,9 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} -@endif -@if(meta.files.githubWorkflows.publishRelease) -# Publish releases + @endif + @if(meta.files.githubWorkflows.publishRelease) + # Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -44,4 +44,4 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} -@endif \ No newline at end of file + @endif \ No newline at end of file From a261cdfcc48543920196d91f8398c2a17a26ae84 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 22:17:10 +0200 Subject: [PATCH 38/54] Enable build scan for publish (debug) --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5c33c26..479e617 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,6 +21,7 @@ jobs: gradle publish -Pgitonium.isSnapshot=true gradle-version-command: | gradle -q :convention-plugin:printVersion -Pgitonium.isSnapshot=true + gradle-build-scan-publish: true if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" needs: [build] secrets: @@ -34,6 +35,7 @@ jobs: gradle publish gradle-version-command: | gradle -q :convention-plugin:printVersion + gradle-build-scan-publish: true if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')" needs: [build] secrets: From 8267f5e7d89c81301f174c91f5460db92e366e7b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 23:07:08 +0200 Subject: [PATCH 39/54] Add GitHub issue template --- .../org/metaborg/repoman/GenerateCommand.kt | 8 ++ .../org/metaborg/repoman/meta/RepoMetadata.kt | 17 +++- .../ISSUE_TEMPLATE/20-report-a-bug.yml.kte | 80 +++++++++++++++++++ .../github/ISSUE_TEMPLATE/config.yml.kte | 22 +++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte create mode 100644 repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index c6ca570..66e839c 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -67,6 +67,7 @@ object GenerateCommand: CliktCommand( generator.generateGradleWrapper() generator.generateGradleRootProject() generator.generateGithubWorkflows() + generator.generateGithubIssueTemplates() println("Done!") } @@ -142,6 +143,13 @@ object GenerateCommand: CliktCommand( } } + fun generateGithubIssueTemplates() { + val generate = metadata.files.githubIssueTemplates.generate + val update = metadata.files.githubIssueTemplates.update || forceUpdate + generate("github/ISSUE_TEMPLATE/config.yml", generate, update, path = ".github/ISSUE_TEMPLATE/config.yml") + generate("github/ISSUE_TEMPLATE/20-report-a-bug.yml", generate, update, path = ".github/ISSUE_TEMPLATE/20-report-a-bug.yml") + } + private fun generate(templateName: String, generate: Boolean, update: Boolean, path: String = templateName) { val outputFile = repoDir.resolve(path) val outputFileExisted = outputFile.exists() diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 04b73e8..7efa883 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -73,6 +73,8 @@ data class Files( val gradleRootProject: GradleRootProject = GradleRootProject(), /** The metadata for the GitHub workflows. */ val githubWorkflows: GithubWorkflows = GithubWorkflows(), + /** The metadata for GitHub issue templates. */ + val githubIssueTemplates: GithubIssueTemplates = GithubIssueTemplates(), ) /** Metadata for the README.md file. */ @@ -186,6 +188,19 @@ data class GithubWorkflows( val buildDocs: Boolean = false, ) +/** Metadata for GitHub issue templates. */ +@Serializable +data class GithubIssueTemplates( + /** Whether to generate the files. */ + val generate: Boolean = true, + /** Whether to update the file. */ + val update: Boolean = true, + /** Whether to automatically assign developers to issues. */ + val assignDevelopers: Boolean = true, + /** Whether to use the GitHub Discussions tab. */ + val useDiscussions: Boolean = true, +) + /** A Maven artifact. */ @Serializable data class MavenArtifact( @@ -209,7 +224,7 @@ data class GradlePlugin( /** A person. */ @Serializable data class Person( - /** The ID of the person, usually their GitHub nickname. */ + /** The GitHub nickname of the person. */ val id: String? = null, /** The (full) name of the person. */ val name: String, diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte new file mode 100644 index 0000000..7ac510c --- /dev/null +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte @@ -0,0 +1,80 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +--- +@if(meta.files.gradleRootProject.update) +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + +@endif +name: "🐞 Report a Bug" +description: File a bug report or issue for any project in ${meta.title}. +title: "[Bug]: " +labels: ["bug", "triage"] +@if(meta.files.githubIssueTemplates.assignDevelopers) +assignees: + @for(person in meta.developers) + - ${person.id} + @endfor +@endif +body: + @if(meta.files.gradleRootProject.includedBuilds.isNotEmpty() || meta.files.gradleRootProject.includedProjects.isNotEmpty()) + - type: dropdown + id: project + attributes: + label: For which project in this repository does the issue occur? + multiple: true + options: + @for(project in meta.files.gradleRootProject.includedProjects) + - "${project.name}" + @endfor + @for(build in meta.files.gradleRootProject.includedBuilds) + - "${build.name}" + @endfor + @else + - type: textarea + attributes: + label: Project + description: For which project in this repository does the issue occur? + validations: + required: false + @endif + - type: textarea + attributes: + label: Version + description: The version of Spoofax or the commit of this project where the issue occurs. + validations: + required: false + - type: textarea + attributes: + label: Describe the issue + description: A clear and concise description of what the bug is. + validations: + required: false + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: false + - type: textarea + attributes: + label: Actual Behavior + description: A concise description of what happened instead. + validations: + required: false + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images, log files, or an example project by clicking this area to highlight it and then dragging files in. + validations: + required: false diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte new file mode 100644 index 0000000..596d137 --- /dev/null +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte @@ -0,0 +1,22 @@ +@import org.metaborg.repoman.meta.RepoMetadata +@param meta: RepoMetadata +--- +blank_issues_enabled: false +contact_links: + - name: 📚 Spoofax Documentation + url: https://www.spoofax.dev/ + about: Documentation about Spoofax and all included Meta-Languages. + - name: ⁉️ Spoofax Support Page + url: https://www.spoofax.dev/support + about: Information on Spoofax Support, and how to get in touch. + - name: 🙋🏽 Spoofax Users Channel + url: https://slde.slack.com/archives/C7254SF60 + about: The Spoofax Users channel on Slack. See the Spoofax Support Page on how to gain access. + @if(meta.files.githubIssueTemplates.useDiscussions) + - name: 💬 Discussions + url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/ + about: Alternatively, ask questions in the Discussions tab. + @endif + - name: 🛡️ Security issue + url: https://github.com/${meta.repoOwner}/${meta.repoName}/security/advisories/new + about: Security issue? Do not report security issues publicly, but create a private advisory. From af74d42c178501610450780b0786eea0637ff60b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Wed, 31 Jul 2024 23:49:39 +0200 Subject: [PATCH 40/54] Add test --- .../org/metaborg/repoman/meta/RepoMetadata.kt | 15 +- .../ISSUE_TEMPLATE/20-report-a-bug.yml.kte | 8 +- .../metaborg/repoman/GenerateCommandTests.kt | 169 ++++++++++++++++++ 3 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 7efa883..77cd15f 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -2,6 +2,7 @@ package org.metaborg.repoman.meta import kotlinx.serialization.Serializable import org.metaborg.repoman.Markdown +import java.time.Year /** Default values. */ object Defaults { @@ -34,7 +35,7 @@ data class RepoMetadata( /** The inception year of the repository (required). */ val inceptionYear: String, /** The current year in which the repository is still maintained. */ - val currentYear: String = "2024", + val currentYear: String = Year.now().toString(), /** A list of Maven libraries published by the repo. */ val libraries: List = emptyList(), @@ -199,6 +200,18 @@ data class GithubIssueTemplates( val assignDevelopers: Boolean = true, /** Whether to use the GitHub Discussions tab. */ val useDiscussions: Boolean = true, + /** The type label to apply to bugs; or `null` to not apply a label. */ + val bugTypeLabel: String? = "bug", + /** The type label to apply to feature requests; or `null` to not apply a label. */ + val featureRequestTypeLabel: String? = "feature-request", + /** The type label to apply to questions; or `null` to not apply a label. */ + val questionTypeLabel: String? = "question", + /** The state label to apply to new bugs; or `null` to not apply a label. */ + val bugStateLabel: String? = "needs-triage", + /** The state label to apply to new feature requests; or `null` to not apply a label. */ + val featureRequestStateLabel: String? = null, + /** The state label to apply to new questions; or `null` to not apply a label. */ + val questionStateLabel: String? = null, ) /** A Maven artifact. */ diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte index 7ac510c..ba4220f 100644 --- a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte @@ -10,7 +10,13 @@ name: "🐞 Report a Bug" description: File a bug report or issue for any project in ${meta.title}. title: "[Bug]: " -labels: ["bug", "triage"] +labels: + @if(meta.files.githubIssueTemplates.bugTypeLabel != null) + - "${meta.files.githubIssueTemplates.bugTypeLabel}" + @endif + @if(meta.files.githubIssueTemplates.bugStateLabel != null) + - "${meta.files.githubIssueTemplates.bugStateLabel}" + @endif @if(meta.files.githubIssueTemplates.assignDevelopers) assignees: @for(person in meta.developers) diff --git a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt new file mode 100644 index 0000000..9cfe6c5 --- /dev/null +++ b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt @@ -0,0 +1,169 @@ +package org.metaborg.repoman + +import com.github.ajalt.clikt.testing.test +import io.kotest.assertions.assertSoftly +import io.kotest.assertions.withClue +import io.kotest.core.spec.style.FunSpec +import io.kotest.engine.spec.tempdir +import io.kotest.matchers.file.shouldNotBeEmpty +import io.kotest.matchers.shouldBe + +/** Tests the [GenerateCommand]. */ +class GenerateCommandTests: FunSpec({ + + test("should generate the necessary files") { + // Arrange + val projectDir = tempdir() + val metadataFile = projectDir.resolve("repo.yaml") + // Try to exercise all the features + metadataFile.writeText( + """ + --- + repoOwner: "metaborgcube" + repoName: "queen" + mainBranch: "master" + releaseTagPrefix: "v" + mavenGroup: "org.metaborgcube" + + title: "Metaborgcube Queen" + description: "Resistance is futile." + documentationLink: "https://metaborgcube.dev/queen/" + inceptionYear: "2000" + currentYear: "2373" + + libraries: + - group: "org.metaborgcube" + name: "picard" + description: "Make it so." + - group: "org.metaborgcube" + name: "riker" + description: "Engage." + + languages: + - group: "org.metaborgcube" + name: "worf" + description: "Today is a good day to die." + - group: "org.metaborgcube" + name: "data" + description: "I am fully functional." + + plugins: + - id: "org.metaborgcube.enterprise" + description: "NCC-1701-D" + - id: "org.metaborgcube.voyager" + description: "NCC-74656" + + developers: + - id: "picard" + name: "Jean-Luc Picard" + email: "jl@enterprise.uss" + - id: "riker" + name: "William Riker" + email: "numberone@enterprise.uss" + + contributors: + - id: "worf" + name: "Worf" + email: "moghson@enterprise.uss" + - id: "data" + name: "Data" + email: "404@enterprise.uss" + + files: + readme: + generate: true + update: true + body: | + I am the beginning, the end, the one who is many. I am the Borg. + license: + generate: true + update: true + contributing: + generate: true + update: true + codeOfConduct: + generate: true + update: true + changelog: + generate: true + update: true + gitignore: + generate: true + update: true + extra: | + .dna/ + gradleWrapper: + generate: true + update: true + gradleVersion: "latest" + gradleDistributionType: "all" + gradleRootProject: + generate: true + update: true + rootProjectName: "queen" + includedBuilds: + - name: "sevenofnine" + path: "people/sevenofnine/" + includedProjects: + - name: ":core" + path: "core/" + - name: ":ui" + path: "ui/" + conventionVersion: "0.16.0" + createPublishTasks: true + githubWorkflows: + generate: true + update: true + publishRelease: true + publishSnapshot: true + buildTask: ":core:build" + publishTask: ":core:publish" + printVersionTask: ":core:printVersion" + buildDocs: true + githubIssueTemplates: + generate: true + update: true + assignDevelopers: true + useDiscussions: true + bugTypeLabel: "Type-Bug" + featureRequestTypeLabel: "Type-Enhancement" + questionTypeLabel: "Type-Question" + bugStateLabel: "State-Triage" + featureRequestStateLabel: "State-Triage" + questionStateLabel: "State-Triage" + """.trimIndent() + ) + + // Act + val result = CLI.test(arrayOf( + "generate", + "--meta", metadataFile.toString(), + "--repo", projectDir.toString(), + "--force-update" + )) + + // Assert + withClue(result.output) { + result.statusCode shouldBe 0 + } + assertSoftly { + projectDir.resolve("README.md").shouldNotBeEmpty() + projectDir.resolve("LICENSE.md").shouldNotBeEmpty() + projectDir.resolve("CONTRIBUTING.md").shouldNotBeEmpty() + projectDir.resolve("CODE_OF_CONDUCT.md").shouldNotBeEmpty() + projectDir.resolve("CHANGELOG.md").shouldNotBeEmpty() + projectDir.resolve(".gitignore").shouldNotBeEmpty() + projectDir.resolve("gradlew").shouldNotBeEmpty() + projectDir.resolve("gradlew.bat").shouldNotBeEmpty() + projectDir.resolve("gradle/wrapper/gradle-wrapper.jar").shouldNotBeEmpty() + projectDir.resolve("gradle/wrapper/gradle-wrapper.properties").shouldNotBeEmpty() + projectDir.resolve("settings.gradle.kts").shouldNotBeEmpty() + projectDir.resolve("build.gradle.kts").shouldNotBeEmpty() + projectDir.resolve(".github/workflows/build.yaml").shouldNotBeEmpty() + projectDir.resolve(".github/workflows/documentation.yaml").shouldNotBeEmpty() + projectDir.resolve(".github/ISSUE_TEMPLATE/config.yml").shouldNotBeEmpty() + projectDir.resolve(".github/ISSUE_TEMPLATE/20-report-a-bug.yml").shouldNotBeEmpty() + } + } + +}) \ No newline at end of file From 13f29ed997eb82a10325e5d73ef127f0776b7433 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 00:12:29 +0200 Subject: [PATCH 41/54] Fix default value --- .../src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 77cd15f..47d85be 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -209,7 +209,7 @@ data class GithubIssueTemplates( /** The state label to apply to new bugs; or `null` to not apply a label. */ val bugStateLabel: String? = "needs-triage", /** The state label to apply to new feature requests; or `null` to not apply a label. */ - val featureRequestStateLabel: String? = null, + val featureRequestStateLabel: String? = "needs-triage", /** The state label to apply to new questions; or `null` to not apply a label. */ val questionStateLabel: String? = null, ) From adf9407fadd27a25e0874dd918ab36dcb3649564 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 00:27:05 +0200 Subject: [PATCH 42/54] Allow repo.yml as an alternative --- .../org/metaborg/repoman/GenerateCommand.kt | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index 66e839c..a13747b 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -4,6 +4,7 @@ import com.charleskorn.kaml.Yaml import com.charleskorn.kaml.decodeFromStream import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.defaultLazy import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.path @@ -32,16 +33,19 @@ object GenerateCommand: CliktCommand( name = "generate", help = "Generates a README.md file for a specific repository." ) { - /** The file with the repository metadata. */ - val metadataFile: Path? by option("-m", "--meta", help = "The file with the repository metadata") - .path(canBeFile = true, canBeDir = false, mustExist = true) /** The directory with the repository. */ - val repoDir: Path? by option("-r", "--repo", help = "The directory with the repository") + val repoDir: Path by option("-r", "--repo", help = "The directory with the repository") .path(canBeFile = false, canBeDir = true, mustExist = true) + .defaultLazy { Path.of(System.getProperty("user.dir")) } + + /** The file with the repository metadata. */ + val metadataFile: Path by option("-m", "--meta", help = "The file with the repository metadata") + .path(canBeFile = true, canBeDir = false, mustExist = true) + .defaultLazy { repoDir.resolve("repo.yaml").let { d -> firstThatExistsOf(d, repoDir.resolve("repo.yml")) ?: d } } /** The Gradle binary to invoke. */ - val gradleBin: String? by option("--gradle-bin", help = "The Gradle binary to invoke") + val gradleBin: String by option("--gradle-bin", help = "The Gradle binary to invoke") .default("gradle") /** Whether to force updating files even if they exist. Use this to just update all files and manually @@ -51,8 +55,7 @@ object GenerateCommand: CliktCommand( override fun run() { - val repoDir = repoDir ?: Path.of(System.getProperty("user.dir")) - val metadata = readMetadata(repoDir) + val metadata = readMetadata() val resolver = ResourceCodeResolver("templates", Program::class.java.classLoader) val engine = TemplateEngine.create(resolver, ContentType.Plain) engine.setTrimControlStructures(true) @@ -71,15 +74,21 @@ object GenerateCommand: CliktCommand( println("Done!") } - private fun readMetadata(repoDir: Path): RepoMetadata { + private fun readMetadata(): RepoMetadata { println("Reading metadata...") - val metadataFile = metadataFile ?: repoDir.resolve("repo.yaml") val metadata = Yaml.default.decodeFromStream(metadataFile.inputStream()) return metadata } + private fun firstThatExistsOf(vararg paths: Path?): Path? { + for (path in paths) { + if (path != null && path.exists()) return path + } + return null + } + class Generator( private val repoDir: Path, private val engine: TemplateEngine, From 54405a38ed07e3292da80caec585bc305cdcbd68 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 00:41:34 +0200 Subject: [PATCH 43/54] Warning for generated files --- .../templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte | 2 +- .../templates/github/ISSUE_TEMPLATE/config.yml.kte | 6 ++++++ .../resources/templates/github/workflows/build.yaml.kte | 6 ++++++ .../templates/github/workflows/documentation.yaml.kte | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte index ba4220f..4e8e9c4 100644 --- a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/20-report-a-bug.yml.kte @@ -1,7 +1,7 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata --- -@if(meta.files.gradleRootProject.update) +@if(meta.files.githubIssueTemplates.update) # !! THIS FILE WAS GENERATED USING repoman !! # Modify `repo.yaml` instead and use `repoman` to update this file # See: https://github.com/metaborg/metaborg-gradle/ diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte index 596d137..2f322ac 100644 --- a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte @@ -1,6 +1,12 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata --- +@if(meta.files.githubIssueTemplates.update) +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + +@endif blank_issues_enabled: false contact_links: - name: 📚 Spoofax Documentation diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte index e03aab6..0a033a3 100644 --- a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -1,6 +1,12 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata --- +@if(meta.files.githubWorkflows.update) +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + +@endif name: 'Build & Publish' on: # yamllint disable-line rule:truthy diff --git a/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte b/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte index cda4fba..bec3569 100644 --- a/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/documentation.yaml.kte @@ -1,6 +1,12 @@ @import org.metaborg.repoman.meta.RepoMetadata @param meta: RepoMetadata --- +@if(meta.files.githubWorkflows.update) +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + +@endif name: 'Documentation' on: # yamllint disable-line rule:truthy From 564eed2344e2b438a7480fbc0d31417e56d9b50e Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 00:41:41 +0200 Subject: [PATCH 44/54] Fix test for CI --- .../test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt index 9cfe6c5..2632137 100644 --- a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt +++ b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt @@ -7,6 +7,7 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.engine.spec.tempdir import io.kotest.matchers.file.shouldNotBeEmpty import io.kotest.matchers.shouldBe +import java.nio.file.Path /** Tests the [GenerateCommand]. */ class GenerateCommandTests: FunSpec({ @@ -95,7 +96,7 @@ class GenerateCommandTests: FunSpec({ gradleWrapper: generate: true update: true - gradleVersion: "latest" + gradleVersion: "8.9" # change this into `latest` when using Gradle 8 gradleDistributionType: "all" gradleRootProject: generate: true @@ -139,6 +140,7 @@ class GenerateCommandTests: FunSpec({ "generate", "--meta", metadataFile.toString(), "--repo", projectDir.toString(), + "--gradle-bin", Path.of(System.getProperty("user.dir")).resolve("../gradlew").toString(), "--force-update" )) From b112ab32a4b24bedb0ccf2648aec2bc7f7f0b2a9 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 11:22:18 +0200 Subject: [PATCH 45/54] Support non-markdown LICENSE --- .../org/metaborg/repoman/GenerateCommand.kt | 56 ++--- .../org/metaborg/repoman/meta/RepoMetadata.kt | 4 +- .../src/main/resources/templates/LICENSE.kte | 202 ++++++++++++++++++ 3 files changed, 235 insertions(+), 27 deletions(-) create mode 100644 repoman/src/main/resources/templates/LICENSE.kte diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index a13747b..99f4ff1 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -92,69 +92,73 @@ object GenerateCommand: CliktCommand( class Generator( private val repoDir: Path, private val engine: TemplateEngine, - private val metadata: RepoMetadata, + private val meta: RepoMetadata, ) { fun generateReadme() { - val generate = metadata.files.readme.generate - val update = metadata.files.readme.update || forceUpdate + val generate = meta.files.readme.generate + val update = meta.files.readme.update || forceUpdate generate("README.md", generate, update) } fun generateLicense() { - val generate = metadata.files.license.generate - val update = metadata.files.license.update || forceUpdate - generate("LICENSE.md", generate, update) + val generate = meta.files.license.generate + val update = meta.files.license.update || forceUpdate + if (meta.files.license.markdown) { + generate("LICENSE.md", generate, update) + } else { + generate("LICENSE", generate, update) + } } fun generateContributing() { - val generate = metadata.files.contributing.generate - val update = metadata.files.contributing.update || forceUpdate + val generate = meta.files.contributing.generate + val update = meta.files.contributing.update || forceUpdate generate("CONTRIBUTING.md", generate, update) } fun generateCodeOfConduct() { - val generate = metadata.files.codeOfConduct.generate - val update = metadata.files.codeOfConduct.update || forceUpdate + val generate = meta.files.codeOfConduct.generate + val update = meta.files.codeOfConduct.update || forceUpdate generate("CODE_OF_CONDUCT.md", generate, update) } fun generateChangelog() { - val generate = metadata.files.changelog.generate - val update = metadata.files.changelog.update || forceUpdate + val generate = meta.files.changelog.generate + val update = meta.files.changelog.update || forceUpdate generate("CHANGELOG.md", generate, update) } fun generateGitignore() { - val generate = metadata.files.gitignore.generate - val update = metadata.files.gitignore.update || forceUpdate + val generate = meta.files.gitignore.generate + val update = meta.files.gitignore.update || forceUpdate generate("gitignore", generate, update, path = ".gitignore") } fun generateGradleWrapper() { - val generate = metadata.files.gradleWrapper.generate - val update = metadata.files.gradleWrapper.update || forceUpdate + val generate = meta.files.gradleWrapper.generate + val update = meta.files.gradleWrapper.update || forceUpdate generateGradleWrapper(generate, update) } fun generateGradleRootProject() { - val generate = metadata.files.gradleRootProject.generate - val update = metadata.files.gradleRootProject.update || forceUpdate + val generate = meta.files.gradleRootProject.generate + val update = meta.files.gradleRootProject.update || forceUpdate generate("settings.gradle.kts", generate, update) generate("build.gradle.kts", generate, update) } fun generateGithubWorkflows() { - val generate = metadata.files.githubWorkflows.generate - val update = metadata.files.githubWorkflows.update || forceUpdate + val generate = meta.files.githubWorkflows.generate + val update = meta.files.githubWorkflows.update || forceUpdate generate("github/workflows/build.yaml", generate, update, path = ".github/workflows/build.yaml") - if (metadata.files.githubWorkflows.buildDocs) { + if (meta.files.githubWorkflows.buildDocs) { generate("github/workflows/documentation.yaml", generate, update, path = ".github/workflows/documentation.yaml") } } fun generateGithubIssueTemplates() { - val generate = metadata.files.githubIssueTemplates.generate - val update = metadata.files.githubIssueTemplates.update || forceUpdate + val generate = meta.files.githubIssueTemplates.generate + val update = meta.files.githubIssueTemplates.update || forceUpdate generate("github/ISSUE_TEMPLATE/config.yml", generate, update, path = ".github/ISSUE_TEMPLATE/config.yml") generate("github/ISSUE_TEMPLATE/20-report-a-bug.yml", generate, update, path = ".github/ISSUE_TEMPLATE/20-report-a-bug.yml") } @@ -171,7 +175,7 @@ object GenerateCommand: CliktCommand( } FileOutput(outputFile).use { output -> - engine.render("$templateName.kte", metadata, output) + engine.render("$templateName.kte", meta, output) } if (!outputFileExisted) { @@ -204,8 +208,8 @@ object GenerateCommand: CliktCommand( command( gradleBin, "wrapper", - "--gradle-version=${metadata.files.gradleWrapper.gradleVersion}", - "--distribution-type=${metadata.files.gradleWrapper.gradleDistributionType}", + "--gradle-version=${meta.files.gradleWrapper.gradleVersion}", + "--distribution-type=${meta.files.gradleWrapper.gradleDistributionType}", "--quiet", ) directory(tmpDir.toFile()) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 47d85be..52bc99f 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -58,7 +58,7 @@ data class RepoMetadata( data class Files( /** The metadata for the README.md file. */ val readme: Readme = Readme(), - /** The metadata for the LICENSE.md file. */ + /** The metadata for the LICENSE/LICENSE.md file. */ val license: License = License(), /** The metadata for the CONTRIBUTING.md file. */ val contributing: Contributing = Contributing(), @@ -96,6 +96,8 @@ data class License( val generate: Boolean = true, /** Whether to update the file. */ val update: Boolean = true, + /** Whether to use a Markdown license file. */ + val markdown: Boolean = true, ) /** Metadata for the CONTRIBUTING.md file. */ diff --git a/repoman/src/main/resources/templates/LICENSE.kte b/repoman/src/main/resources/templates/LICENSE.kte new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/repoman/src/main/resources/templates/LICENSE.kte @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 1bb810e3858551a883c9cd92a44a625258372fb4 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 11:22:50 +0200 Subject: [PATCH 46/54] Separate Spoofax2/3 artifacts --- repo.yaml | 4 +- .../org/metaborg/repoman/meta/RepoMetadata.kt | 28 +++++-- .../main/resources/templates/README.md.kte | 84 ++++++++++++------- .../metaborg/repoman/GenerateCommandTests.kt | 28 +++++-- 4 files changed, 102 insertions(+), 42 deletions(-) diff --git a/repo.yaml b/repo.yaml index 04bc025..38cc36f 100644 --- a/repo.yaml +++ b/repo.yaml @@ -9,7 +9,7 @@ description: | documentationLink: https://spoofax.dev/metaborg-gradle/ inceptionYear: "2024" -libraries: +spoofax3Languages: - group: "org.metaborg" name: "catalog" description: "Version catalog" @@ -17,7 +17,7 @@ libraries: name: "platform" description: "Spoofax platform" -plugins: +spoofax3Plugins: - id: "org.metaborg.convention.settings" description: "Settings convention plugin" - id: "org.metaborg.convention.java" diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 52bc99f..512fdb8 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -37,6 +37,18 @@ data class RepoMetadata( /** The current year in which the repository is still maintained. */ val currentYear: String = Year.now().toString(), + /** A list of Maven libraries published by the repo as part of Spoofax 2. */ + val spoofax2Libraries: List = emptyList(), + /** A list of Spoofax languages published by the repo as part of Spoofax 2. */ + val spoofax2Languages: List = emptyList(), + + /** A list of Maven libraries published by the repo as part of Spoofax 3. */ + val spoofax3Libraries: List = emptyList(), + /** A list of Spoofax languages published by the repo as part of Spoofax 3. */ + val spoofax3Languages: List = emptyList(), + /** A list of Gradle plugins published by the repo as part of Spoofax 3. */ + val spoofax3Plugins: List = emptyList(), + /** A list of Maven libraries published by the repo. */ val libraries: List = emptyList(), /** A list of Spoofax languages published by the repo. */ @@ -51,7 +63,11 @@ data class RepoMetadata( /** The configurations for the generated files. */ val files: Files = Files(), -) +) { + /** All libraries and languages published by the repo (both Spoofax 2 and 3), except Gradle plugins. */ + val allArtifacts: List get() = + (spoofax2Libraries + spoofax2Languages + spoofax3Libraries + spoofax3Languages).sortedBy { "${it.group}:${it.name}" } +} /** Metadata for the files to generate. */ @Serializable @@ -69,11 +85,11 @@ data class Files( /** The metadata for the .gitignore file. */ val gitignore: Gitignore = Gitignore(), /** The metadata for the Gradle wrapper files. */ - val gradleWrapper: GradleWrapper = GradleWrapper(), + val gradleWrapper: GradleWrapper = GradleWrapper(), // Spoofax 3 /** The metadata for the Gradle root project files. */ - val gradleRootProject: GradleRootProject = GradleRootProject(), + val gradleRootProject: GradleRootProject = GradleRootProject(), // Spoofax 3 /** The metadata for the GitHub workflows. */ - val githubWorkflows: GithubWorkflows = GithubWorkflows(), + val githubWorkflows: GithubWorkflows = GithubWorkflows(), // Spoofax 3 /** The metadata for GitHub issue templates. */ val githubIssueTemplates: GithubIssueTemplates = GithubIssueTemplates(), ) @@ -225,7 +241,9 @@ data class MavenArtifact( val name: String, /** A short description. For example: `"Resource management library."` */ val description: Markdown? = null, -) +) { + override fun toString(): String = "$group:$name" +} /** A Gradle plugin. */ @Serializable diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte index f55730d..47e400c 100644 --- a/repoman/src/main/resources/templates/README.md.kte +++ b/repoman/src/main/resources/templates/README.md.kte @@ -24,35 +24,57 @@ ${meta.description} @endif -@if(meta.languages.isNotEmpty()) -| Language | Latest Release | Latest Snapshot | +@if(meta.spoofax3Libraries.isNotEmpty() || meta.spoofax3Languages.isNotEmpty() || meta.spoofax3Plugins.isNotEmpty()) +## Spoofax 3 Artifacts + +@if(meta.spoofax3Languages.isNotEmpty()) +| Spoofax Language | Latest Release | Latest Snapshot | |----------|----------------|-----------------| -@for(entry in meta.languages) -| `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | +@for(artifact in meta.spoofax3Languages) +| `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor - @endif - -@if(meta.libraries.isNotEmpty()) -| Artifact | Latest Release | Latest Snapshot | +@if(meta.spoofax3Libraries.isNotEmpty()) +| Maven Artifact | Latest Release | Latest Snapshot | |----------|----------------|-----------------| -@for(entry in meta.libraries) -| `${entry.group}:${entry.name}` | [![Release][mvn-rel-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | [![Snapshot][mvn-snap-badge:${entry.group}:${entry.name}]][mvn:${entry.group}:${entry.name}] | +@for(artifact in meta.spoofax3Libraries) +| `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor - @endif - -@if(meta.plugins.isNotEmpty()) +@if(meta.spoofax3Plugins.isNotEmpty()) | Gradle Plugin | Latest Release | Latest Snapshot | |---------------|----------------|-----------------| -@for(entry in meta.plugins) -| `${entry.id}` | [![Release][mvn-rel-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | [![Snapshot][mvn-snap-badge:${entry.id}:${entry.id}.gradle.plugin]][mvn:${entry.id}:${entry.id}.gradle.plugin] | +@for(plugin in meta.spoofax3Plugins) +| `${plugin.id}` | [![Release][mvn-rel-badge:${plugin.id}:${plugin.id}.gradle.plugin]][mvn:${plugin.id}:${plugin.id}.gradle.plugin] | [![Snapshot][mvn-snap-badge:${plugin.id}:${plugin.id}.gradle.plugin]][mvn:${plugin.id}:${plugin.id}.gradle.plugin] | @endfor +@endif @endif +@if(meta.spoofax2Libraries.isNotEmpty() || meta.spoofax2Languages.isNotEmpty()) +## Spoofax 2 Artifacts + +@if(meta.spoofax2Languages.isNotEmpty()) +| Spoofax Language | Latest Release | Latest Snapshot | +|----------|----------------|-----------------| +@for(artifact in meta.spoofax2Languages) +| `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | +@endfor +@endif + +@if(meta.spoofax2Libraries.isNotEmpty()) +| Maven Artifact | Latest Release | Latest Snapshot | +|----------|----------------|-----------------| +@for(artifact in meta.spoofax2Libraries) +| `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | +@endfor +@endif + +@endif + + @if(meta.files.readme.body != null) ${meta.files.readme.body} @@ -69,7 +91,11 @@ Unless required by applicable law or agreed to in writing, software distributed [github-badge:build]: https://img.shields.io/github/actions/workflow/status/${meta.repoOwner}/${meta.repoName}/build.yaml [github:build]: https://github.com/${meta.repoOwner}/${meta.repoName}/actions [license-badge]: https://img.shields.io/github/license/${meta.repoOwner}/${meta.repoName} +@if(meta.files.license.markdown) [license]: https://github.com/${meta.repoOwner}/${meta.repoName}/blob/${meta.mainBranch}/LICENSE.md +@else +[license]: https://github.com/${meta.repoOwner}/${meta.repoName}/blob/${meta.mainBranch}/LICENSE +@endif [github-badge:release]: https://img.shields.io/github/v/release/${meta.repoOwner}/${meta.repoName}?display_name=release [github:release]: https://github.com/${meta.repoOwner}/${meta.repoName}/releases @if(meta.documentationLink != null) @@ -78,19 +104,21 @@ Unless required by applicable law or agreed to in writing, software distributed [documentation-button]: https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=googledocs&logoColor=white @endif - -@for(entry in meta.languages) -[mvn:${entry.group}:${entry.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.group}~${entry.name}~~~ -[mvn-rel-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/r/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/s/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@for(artifact in meta.allArtifacts) +[mvn:${artifact.group}:${artifact.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${artifact.group}~${artifact.name}~~~ +@endfor +@for(plugin in meta.spoofax3Plugins) +[mvn:${plugin.id}:${plugin.id}.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~${plugin.id}~${plugin.id}.gradle.plugin~~~ +@endfor +@for(artifact in meta.allArtifacts) +[mvn-rel-badge:${artifact.group}:${artifact.name}]: https://img.shields.io/nexus/r/${artifact.group}/${artifact.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@endfor +@for(plugin in meta.spoofax3Plugins) +[mvn-rel-badge:${plugin.id}:${plugin.id}.gradle.plugin]: https://img.shields.io/nexus/r/${plugin.id}/${plugin.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @endfor -@for(entry in meta.libraries) -[mvn:${entry.group}:${entry.name}]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.group}~${entry.name}~~~ -[mvn-rel-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/r/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:${entry.group}:${entry.name}]: https://img.shields.io/nexus/s/${entry.group}/${entry.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@for(artifact in meta.allArtifacts) +[mvn-rel-badge:${artifact.group}:${artifact.name}]: https://img.shields.io/nexus/s/${artifact.group}/${artifact.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @endfor -@for(entry in meta.plugins) -[mvn:${entry.id}:${entry.id}.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~${entry.id}~${entry.id}.gradle.plugin~~~ -[mvn-rel-badge:${entry.id}:${entry.id}.gradle.plugin]: https://img.shields.io/nexus/r/${entry.id}/${entry.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:${entry.id}:${entry.id}.gradle.plugin]: https://img.shields.io/nexus/s/${entry.id}/${entry.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +@for(plugin in meta.spoofax3Plugins) +[mvn-snap-badge:${plugin.id}:${plugin.id}.gradle.plugin]: https://img.shields.io/nexus/s/${plugin.id}/${plugin.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @endfor diff --git a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt index 2632137..0573b79 100644 --- a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt +++ b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt @@ -32,7 +32,20 @@ class GenerateCommandTests: FunSpec({ inceptionYear: "2000" currentYear: "2373" - libraries: + spoofax2Libraries: + - group: "org.metaborg" + name: "gorn" + description: "Grn." + - group: "org.metaborg" + name: "trill" + description: "Trl." + + spoofax2Languages: + - group: "org.metaborg" + name: "Klingon" + description: "CHEGH-chew jaj-VAM jaj-KAK." + + spoofax3Libraries: - group: "org.metaborgcube" name: "picard" description: "Make it so." @@ -40,15 +53,15 @@ class GenerateCommandTests: FunSpec({ name: "riker" description: "Engage." - languages: + spoofax3Languages: - group: "org.metaborgcube" - name: "worf" - description: "Today is a good day to die." + name: "borg" + description: "We are the Borg." - group: "org.metaborgcube" - name: "data" - description: "I am fully functional." + name: "ferengi" + description: "Rules of Acquisition." - plugins: + spoofax3Plugins: - id: "org.metaborgcube.enterprise" description: "NCC-1701-D" - id: "org.metaborgcube.voyager" @@ -79,6 +92,7 @@ class GenerateCommandTests: FunSpec({ license: generate: true update: true + markdown: true contributing: generate: true update: true From 529bcf263e626d5dc1054ce4b9790640476c1474 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 11:23:09 +0200 Subject: [PATCH 47/54] Amend .gitignore for Spoofax projects --- repoman/src/main/resources/templates/gitignore.kte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repoman/src/main/resources/templates/gitignore.kte b/repoman/src/main/resources/templates/gitignore.kte index 1e3040d..0f837b7 100644 --- a/repoman/src/main/resources/templates/gitignore.kte +++ b/repoman/src/main/resources/templates/gitignore.kte @@ -78,6 +78,10 @@ local.properties *.lock jte-classes/ +# Spoofax +src-gen/ +target/ + @if(meta.files.gitignore.extra != null) # Extra ${meta.files.gitignore.extra} From 3d966b4fb6acf1abe6878469f4ead3465476b44b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 11:25:05 +0200 Subject: [PATCH 48/54] Delete other license files --- repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index 99f4ff1..be2fd3c 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -104,8 +104,10 @@ object GenerateCommand: CliktCommand( val generate = meta.files.license.generate val update = meta.files.license.update || forceUpdate if (meta.files.license.markdown) { + if (update) repoDir.resolve("LICENSE").deleteIfExists() generate("LICENSE.md", generate, update) } else { + if (update) repoDir.resolve("LICENSE.md").deleteIfExists() generate("LICENSE", generate, update) } } From 54e09d0d2810648cf13a8d66f8e84a05bddce24c Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 11:26:18 +0200 Subject: [PATCH 49/54] Regenerate meta files --- .github/workflows/build.yaml | 10 ++++++---- .gitignore | 8 ++++++++ CONTRIBUTING.md | 6 ++++++ README.md | 32 +++++++++++++++++++------------- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 479e617..95e5d5d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,8 @@ --- +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + name: 'Build & Publish' on: # yamllint disable-line rule:truthy @@ -13,7 +17,7 @@ jobs: with: gradle-command: | gradle build -# Publish snapshots + # Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -21,13 +25,12 @@ jobs: gradle publish -Pgitonium.isSnapshot=true gradle-version-command: | gradle -q :convention-plugin:printVersion -Pgitonium.isSnapshot=true - gradle-build-scan-publish: true if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" needs: [build] secrets: METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} -# Publish releases + # Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -35,7 +38,6 @@ jobs: gradle publish gradle-version-command: | gradle -q :convention-plugin:printVersion - gradle-build-scan-publish: true if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')" needs: [build] secrets: diff --git a/.gitignore b/.gitignore index c3b0106..bf43d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# !! THIS FILE WAS GENERATED USING repoman !! +# Modify `repo.yaml` instead and use `repoman` to update this file +# See: https://github.com/metaborg/metaborg-gradle/ + # Java *.class *.log @@ -70,3 +74,7 @@ local.properties *.lock jte-classes/ +# Spoofax +src-gen/ +target/ + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ee1fa3..4681b76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,9 @@ + + # Metaborg Gradle ## How to Contribute diff --git a/README.md b/README.md index 2e43fae..4ab2f27 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + # Metaborg Gradle [![Build][github-badge:build]][github:build] [![License][license-badge]][license] @@ -9,12 +15,12 @@ The Metaborg Gradle convention and development plugins, and the Metaborg depende [![Documentation][documentation-button]][documentation] +## Spoofax 3 Artifacts -| Artifact | Latest Release | Latest Snapshot | +| Spoofax Language | Latest Release | Latest Snapshot | |----------|----------------|-----------------| | `org.metaborg:catalog` | [![Release][mvn-rel-badge:org.metaborg:catalog]][mvn:org.metaborg:catalog] | [![Snapshot][mvn-snap-badge:org.metaborg:catalog]][mvn:org.metaborg:catalog] | | `org.metaborg:platform` | [![Release][mvn-rel-badge:org.metaborg:platform]][mvn:org.metaborg:platform] | [![Snapshot][mvn-snap-badge:org.metaborg:platform]][mvn:org.metaborg:platform] | - | Gradle Plugin | Latest Release | Latest Snapshot | |---------------|----------------|-----------------| | `org.metaborg.convention.settings` | [![Release][mvn-rel-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]][mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]][mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin] | @@ -22,6 +28,7 @@ The Metaborg Gradle convention and development plugins, and the Metaborg depende | `org.metaborg.convention.maven-publish` | [![Release][mvn-rel-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]][mvn:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]][mvn:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin] | | `org.metaborg.convention.root-project` | [![Release][mvn-rel-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]][mvn:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin] | [![Snapshot][mvn-snap-badge:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]][mvn:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin] | + ## License Copyright 2024 [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) @@ -38,22 +45,21 @@ Unless required by applicable law or agreed to in writing, software distributed [documentation-badge]: https://img.shields.io/badge/docs-latest-brightgreen [documentation]: https://spoofax.dev/metaborg-gradle/ [documentation-button]: https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=googledocs&logoColor=white - [mvn:org.metaborg:catalog]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~catalog~~~ -[mvn-rel-badge:org.metaborg:catalog]: https://img.shields.io/nexus/r/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:org.metaborg:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn:org.metaborg:platform]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg~platform~~~ -[mvn-rel-badge:org.metaborg:platform]: https://img.shields.io/nexus/r/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:org.metaborg:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.settings~org.metaborg.convention.settings.gradle.plugin~~~ -[mvn-rel-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/r/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/s/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.java~org.metaborg.convention.java.gradle.plugin~~~ -[mvn-rel-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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-snap-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.maven-publish~org.metaborg.convention.maven-publish.gradle.plugin~~~ -[mvn-rel-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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-snap-badge:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: https://artifacts.metaborg.org/#nexus-search;gav~org.metaborg.convention.root-project~org.metaborg.convention.root-project.gradle.plugin~~~ +[mvn-rel-badge:org.metaborg:catalog]: https://img.shields.io/nexus/r/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-rel-badge:org.metaborg:platform]: https://img.shields.io/nexus/r/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-rel-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/r/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-rel-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: 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:org.metaborg:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-rel-badge:org.metaborg:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/s/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: 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 From 854982fc5df2287d1881d9817d0c51dd7c699920 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 13:24:37 +0200 Subject: [PATCH 50/54] Fix metadata --- README.md | 4 +-- repo.yaml | 2 ++ .../org/metaborg/repoman/meta/RepoMetadata.kt | 25 +++++++------------ .../main/resources/templates/README.md.kte | 2 +- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 4ab2f27..dae0128 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ Unless required by applicable law or agreed to in writing, software distributed [mvn-rel-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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:org.metaborg.convention.root-project:org.metaborg.convention.root-project.gradle.plugin]: 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:org.metaborg:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 -[mvn-rel-badge:org.metaborg:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg:catalog]: https://img.shields.io/nexus/s/org.metaborg/catalog?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:org.metaborg:platform]: https://img.shields.io/nexus/s/org.metaborg/platform?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:org.metaborg.convention.settings:org.metaborg.convention.settings.gradle.plugin]: https://img.shields.io/nexus/s/org.metaborg.convention.settings/org.metaborg.convention.settings.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 [mvn-snap-badge:org.metaborg.convention.java:org.metaborg.convention.java.gradle.plugin]: 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:org.metaborg.convention.maven-publish:org.metaborg.convention.maven-publish.gradle.plugin]: 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 diff --git a/repo.yaml b/repo.yaml index 38cc36f..a835fb3 100644 --- a/repo.yaml +++ b/repo.yaml @@ -44,3 +44,5 @@ files: - path: "depman/" - path: "example/" - path: "repoman/" + githubIssueTemplates: + generate: false diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 512fdb8..4c2667e 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -22,7 +22,7 @@ data class RepoMetadata( /** The name of the main branch. For example: `"master"` */ val mainBranch: String = Defaults.MAIN_BRANCH, /** The release tag prefix to use. For example: `"devenv-release/"` */ - val releaseTagPrefix: String = Defaults.RELEASE_TAG_PREFIX, + val releaseTagPrefix: String = Defaults.RELEASE_TAG_PREFIX, // Spoofax 3 /** The default Maven group of the artifacts in the build. For example: `"org.metaborg.devenv"` */ val mavenGroup: String = "org.metaborg", @@ -49,13 +49,6 @@ data class RepoMetadata( /** A list of Gradle plugins published by the repo as part of Spoofax 3. */ val spoofax3Plugins: List = emptyList(), - /** A list of Maven libraries published by the repo. */ - val libraries: List = emptyList(), - /** A list of Spoofax languages published by the repo. */ - val languages: List = emptyList(), - /** A list of Gradle plugins published by the repo. */ - val plugins: List = emptyList(), - /** An ordered list of developers that may be contacted about the repo. */ val developers: List = emptyList(), /** An ordered list of (main) contributors that also worked on the repo. */ @@ -100,7 +93,7 @@ data class Readme( /** Whether to generate the file. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** Content to include in the main body of the readme; or `null`. */ val body: Markdown? = null, ) @@ -111,7 +104,7 @@ data class License( /** Whether to generate the file. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** Whether to use a Markdown license file. */ val markdown: Boolean = true, ) @@ -122,7 +115,7 @@ data class Contributing( /** Whether to generate the file. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, ) /** Metadata for the CODE_OF_CONDUCT.md file. */ @@ -131,7 +124,7 @@ data class CodeOfConduct( /** Whether to generate the file. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, ) /** Metadata for the CHANGELOG.md file. */ @@ -149,7 +142,7 @@ data class Gitignore( /** Whether to generate the file. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** Extra entries to include at the bottom of the .gitignore file; or `null`. */ val extra: String? = null, ) @@ -160,7 +153,7 @@ data class GradleWrapper( /** Whether to generate the files. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** The version of the Gradle wrapper to generate. */ val gradleVersion: String = "7.6.4", /** The kind of Gradle distribution type to use, either `"bin"` or `"all"`. */ @@ -192,7 +185,7 @@ data class GithubWorkflows( /** Whether to generate the files. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** Whether to publish releases using GitHub CI (instead of Jenkins or something else). */ val publishRelease: Boolean = false, /** Whether to publish snapshots using GitHub CI. */ @@ -213,7 +206,7 @@ data class GithubIssueTemplates( /** Whether to generate the files. */ val generate: Boolean = true, /** Whether to update the file. */ - val update: Boolean = true, + val update: Boolean = generate, /** Whether to automatically assign developers to issues. */ val assignDevelopers: Boolean = true, /** Whether to use the GitHub Discussions tab. */ diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte index 47e400c..85459cc 100644 --- a/repoman/src/main/resources/templates/README.md.kte +++ b/repoman/src/main/resources/templates/README.md.kte @@ -117,7 +117,7 @@ Unless required by applicable law or agreed to in writing, software distributed [mvn-rel-badge:${plugin.id}:${plugin.id}.gradle.plugin]: https://img.shields.io/nexus/r/${plugin.id}/${plugin.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @endfor @for(artifact in meta.allArtifacts) -[mvn-rel-badge:${artifact.group}:${artifact.name}]: https://img.shields.io/nexus/s/${artifact.group}/${artifact.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 +[mvn-snap-badge:${artifact.group}:${artifact.name}]: https://img.shields.io/nexus/s/${artifact.group}/${artifact.name}?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 @endfor @for(plugin in meta.spoofax3Plugins) [mvn-snap-badge:${plugin.id}:${plugin.id}.gradle.plugin]: https://img.shields.io/nexus/s/${plugin.id}/${plugin.id}.gradle.plugin?server=https%3A%2F%2Fartifacts.metaborg.org&label=%20 From 4f914527a3d16ba7a3b54362d0542606b83faed1 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 13:36:31 +0200 Subject: [PATCH 51/54] Fix newlines --- repoman/src/main/resources/templates/README.md.kte | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/repoman/src/main/resources/templates/README.md.kte b/repoman/src/main/resources/templates/README.md.kte index 85459cc..70c7180 100644 --- a/repoman/src/main/resources/templates/README.md.kte +++ b/repoman/src/main/resources/templates/README.md.kte @@ -28,48 +28,62 @@ ${meta.description} ## Spoofax 3 Artifacts @if(meta.spoofax3Languages.isNotEmpty()) + | Spoofax Language | Latest Release | Latest Snapshot | |----------|----------------|-----------------| @for(artifact in meta.spoofax3Languages) | `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor + @endif + @if(meta.spoofax3Libraries.isNotEmpty()) + | Maven Artifact | Latest Release | Latest Snapshot | |----------|----------------|-----------------| @for(artifact in meta.spoofax3Libraries) | `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor + @endif + @if(meta.spoofax3Plugins.isNotEmpty()) + | Gradle Plugin | Latest Release | Latest Snapshot | |---------------|----------------|-----------------| @for(plugin in meta.spoofax3Plugins) | `${plugin.id}` | [![Release][mvn-rel-badge:${plugin.id}:${plugin.id}.gradle.plugin]][mvn:${plugin.id}:${plugin.id}.gradle.plugin] | [![Snapshot][mvn-snap-badge:${plugin.id}:${plugin.id}.gradle.plugin]][mvn:${plugin.id}:${plugin.id}.gradle.plugin] | @endfor + @endif @endif + @if(meta.spoofax2Libraries.isNotEmpty() || meta.spoofax2Languages.isNotEmpty()) ## Spoofax 2 Artifacts @if(meta.spoofax2Languages.isNotEmpty()) + | Spoofax Language | Latest Release | Latest Snapshot | |----------|----------------|-----------------| @for(artifact in meta.spoofax2Languages) | `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor + @endif + @if(meta.spoofax2Libraries.isNotEmpty()) + | Maven Artifact | Latest Release | Latest Snapshot | |----------|----------------|-----------------| @for(artifact in meta.spoofax2Libraries) | `${artifact.group}:${artifact.name}` | [![Release][mvn-rel-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | [![Snapshot][mvn-snap-badge:${artifact.group}:${artifact.name}]][mvn:${artifact.group}:${artifact.name}] | @endfor + @endif @endif From bd263516e4e216c3b75f2314279c23b27b5930d9 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Thu, 1 Aug 2024 16:04:46 +0200 Subject: [PATCH 52/54] Add forceGenerate option --- repoman/build.gradle.kts | 5 ++-- .../org/metaborg/repoman/GenerateCommand.kt | 27 +++++++++++-------- .../org/metaborg/repoman/meta/RepoMetadata.kt | 12 ++++----- .../resources/templates/build.gradle.kts.kte | 1 + 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/repoman/build.gradle.kts b/repoman/build.gradle.kts index f166faf..1dc1379 100644 --- a/repoman/build.gradle.kts +++ b/repoman/build.gradle.kts @@ -16,10 +16,11 @@ version = gitonium.version group = "org.metaborg" description = "Repository manager for Metaborg/Spoofax projects." +val jteVersion = "3.1.12" dependencies { implementation("com.github.ajalt.clikt:clikt:4.4.0") // CLI interface - implementation("gg.jte:jte:3.1.12") // Templating engine - implementation("gg.jte:jte-kotlin:3.1.12") // Templating engine (Kotlin support) + implementation("gg.jte:jte:$jteVersion") // Templating engine + implementation("gg.jte:jte-kotlin:$jteVersion") // Templating engine (Kotlin support) implementation("com.charleskorn.kaml:kaml:0.59.0") // Deserialize YAML files testImplementation (libs.kotest) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt index be2fd3c..7f34d53 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/GenerateCommand.kt @@ -48,9 +48,14 @@ object GenerateCommand: CliktCommand( val gradleBin: String by option("--gradle-bin", help = "The Gradle binary to invoke") .default("gradle") + /** Whether to force generating files if they don't exist. Use this to just generate all files initially + * and then manually modify them as necessary. */ + val forceGenerate: Boolean by option("-f", "--force-generate", help = "Force generating files if they don't exist") + .flag(default = false) + /** Whether to force updating files even if they exist. Use this to just update all files and manually * use version control to sort out what to actually update. */ - val forceUpdate: Boolean by option("-f", "--force-update", help = "Force updating files even if they exist") + val forceUpdate: Boolean by option("-F", "--force-update", help = "Force updating files even if they exist") .flag(default = false) @@ -95,13 +100,13 @@ object GenerateCommand: CliktCommand( private val meta: RepoMetadata, ) { fun generateReadme() { - val generate = meta.files.readme.generate + val generate = meta.files.readme.generate || forceGenerate val update = meta.files.readme.update || forceUpdate generate("README.md", generate, update) } fun generateLicense() { - val generate = meta.files.license.generate + val generate = meta.files.license.generate || forceGenerate val update = meta.files.license.update || forceUpdate if (meta.files.license.markdown) { if (update) repoDir.resolve("LICENSE").deleteIfExists() @@ -113,44 +118,44 @@ object GenerateCommand: CliktCommand( } fun generateContributing() { - val generate = meta.files.contributing.generate + val generate = meta.files.contributing.generate || forceGenerate val update = meta.files.contributing.update || forceUpdate generate("CONTRIBUTING.md", generate, update) } fun generateCodeOfConduct() { - val generate = meta.files.codeOfConduct.generate + val generate = meta.files.codeOfConduct.generate || forceGenerate val update = meta.files.codeOfConduct.update || forceUpdate generate("CODE_OF_CONDUCT.md", generate, update) } fun generateChangelog() { - val generate = meta.files.changelog.generate + val generate = meta.files.changelog.generate || forceGenerate val update = meta.files.changelog.update || forceUpdate generate("CHANGELOG.md", generate, update) } fun generateGitignore() { - val generate = meta.files.gitignore.generate + val generate = meta.files.gitignore.generate || forceGenerate val update = meta.files.gitignore.update || forceUpdate generate("gitignore", generate, update, path = ".gitignore") } fun generateGradleWrapper() { - val generate = meta.files.gradleWrapper.generate + val generate = meta.files.gradleWrapper.generate || forceGenerate val update = meta.files.gradleWrapper.update || forceUpdate generateGradleWrapper(generate, update) } fun generateGradleRootProject() { - val generate = meta.files.gradleRootProject.generate + val generate = meta.files.gradleRootProject.generate || forceGenerate val update = meta.files.gradleRootProject.update || forceUpdate generate("settings.gradle.kts", generate, update) generate("build.gradle.kts", generate, update) } fun generateGithubWorkflows() { - val generate = meta.files.githubWorkflows.generate + val generate = meta.files.githubWorkflows.generate || forceGenerate val update = meta.files.githubWorkflows.update || forceUpdate generate("github/workflows/build.yaml", generate, update, path = ".github/workflows/build.yaml") if (meta.files.githubWorkflows.buildDocs) { @@ -159,7 +164,7 @@ object GenerateCommand: CliktCommand( } fun generateGithubIssueTemplates() { - val generate = meta.files.githubIssueTemplates.generate + val generate = meta.files.githubIssueTemplates.generate || forceGenerate val update = meta.files.githubIssueTemplates.update || forceUpdate generate("github/ISSUE_TEMPLATE/config.yml", generate, update, path = ".github/ISSUE_TEMPLATE/config.yml") generate("github/ISSUE_TEMPLATE/20-report-a-bug.yml", generate, update, path = ".github/ISSUE_TEMPLATE/20-report-a-bug.yml") diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index 4c2667e..f3539b7 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -131,9 +131,9 @@ data class CodeOfConduct( @Serializable data class Changelog( /** Whether to generate the file. */ - val generate: Boolean = true, + val generate: Boolean = false, /** Whether to update the file. */ - val update: Boolean = false, + val update: Boolean = generate, ) /** Metadata for the .gitignore file. */ @@ -164,9 +164,9 @@ data class GradleWrapper( @Serializable data class GradleRootProject( /** Whether to generate the files. */ - val generate: Boolean = true, + val generate: Boolean = false, /** Whether to update the file. */ - val update: Boolean = false, + val update: Boolean = generate, /** The name of the root project. */ val rootProjectName: String? = null, /** Included builds. */ @@ -176,7 +176,7 @@ data class GradleRootProject( /** The version of the Metaborg Gradle convention to use. */ val conventionVersion: String = "latest.integration", /** Whether to create `publish` tasks that delegate to the included builds and subprojects. */ - val createPublishTasks: Boolean = false, + val createPublishTasks: Boolean = true, ) /** Metadata for the GitHub workflows. */ @@ -204,7 +204,7 @@ data class GithubWorkflows( @Serializable data class GithubIssueTemplates( /** Whether to generate the files. */ - val generate: Boolean = true, + val generate: Boolean = false, /** Whether to update the file. */ val update: Boolean = generate, /** Whether to automatically assign developers to issues. */ diff --git a/repoman/src/main/resources/templates/build.gradle.kts.kte b/repoman/src/main/resources/templates/build.gradle.kts.kte index e1c686f..d1559b3 100644 --- a/repoman/src/main/resources/templates/build.gradle.kts.kte +++ b/repoman/src/main/resources/templates/build.gradle.kts.kte @@ -15,6 +15,7 @@ import org.metaborg.convention.MavenPublishConventionExtension plugins { id("org.metaborg.convention.root-project") alias(libs.plugins.gitonium) + alias(libs.plugins.spoofax.gradle.langspec) apply false } @if(meta.files.gradleRootProject.createPublishTasks) From 0478d203648e9ca2dace835e0c89c3c2a3599e6b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 2 Aug 2024 12:53:20 +0200 Subject: [PATCH 53/54] Use Discussions for ideas and questions --- .../org/metaborg/repoman/meta/RepoMetadata.kt | 6 ++- .../resources/templates/CONTRIBUTING.md.kte | 41 +++++++++++++++---- .../github/ISSUE_TEMPLATE/config.yml.kte | 22 +++++++--- .../metaborg/repoman/GenerateCommandTests.kt | 3 +- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index f3539b7..baa8f36 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -209,8 +209,10 @@ data class GithubIssueTemplates( val update: Boolean = generate, /** Whether to automatically assign developers to issues. */ val assignDevelopers: Boolean = true, - /** Whether to use the GitHub Discussions tab. */ - val useDiscussions: Boolean = true, + /** The category for Ideas/Feature Requests in the Discussions feature; or `null` to not use it. */ + val ideasDiscussionCategory: String? = "ideas", + /** The category for Questions in the Discussions feature; or `null` to not use it. */ + val questionsDiscussionCategory: String? = "q-a", /** The type label to apply to bugs; or `null` to not apply a label. */ val bugTypeLabel: String? = "bug", /** The type label to apply to feature requests; or `null` to not apply a label. */ diff --git a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte index 8a62296..a64c93e 100644 --- a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte +++ b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte @@ -19,15 +19,31 @@ Thank you for wanting to contribute to this project! :tada::+1: > for this project, or even outright reject it. #### **You have a question?** -Search the [Discussions][1] and [Stackoverflow][3] to see whether your question +@if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) +Search the [Discussions][questions] to see whether your question has already been answered, or ask your question there. Please do **not** make an issue on the Github repository. +@else +Please check the links on the [New Issue][new-issue] page, +or find more info on the [Spoofax Support][support] page. +@endif + + +#### **You have an idea or feature request?** +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +Search the [Discussions][ideas] to see whether your question +has already been answered, or ask your question there. +Please do **not** make an issue on the Github repository. +@else +Please check the links on the [New Issue][new-issue] page, +or find more info on the [Spoofax Support][support] page. +@endif #### **You found a bug** -Search the [Issues][2] to ensure the bug has not been reported before. +Search the [Issues][issues] to ensure the bug has not been reported before. -If the bug is new, open a new issue with a _clear title and description_. +If the bug is new, [open a new issue][new-issue] with a _clear title and description_. Please indicate: - what you did, - what you expected to happen, and @@ -48,7 +64,11 @@ Thank you! Please open a GitHub pull request with the patch. #### **You wrote a patch that adds a new feature or changes an existing one** -Please open an issue _first_, so we can discuss the change. +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +Please [create a discussion topic][ideas] _first_, so we can discuss the change. +@else +Please [open an issue][new-issue] _first_, so we can discuss the change. +@endif #### **You want to contribute to the documentation or test suite** @@ -60,6 +80,13 @@ Thanks! :heart: :heart: :heart: [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) -[1]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions -[2]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues -[3]: https://stackoverflow.com/ +@if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) +[questions]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.questionsDiscussionCategory} +@endif +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +[ideas]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.ideasDiscussionCategory} +@endif +[issues]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues +[new-issue]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues/new/choose +[support]: https://spoofax.dev/support/ + diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte index 2f322ac..9f0988f 100644 --- a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte @@ -9,19 +9,29 @@ @endif blank_issues_enabled: false contact_links: - - name: 📚 Spoofax Documentation + - name: 📚 Spoofax 2 Documentation url: https://www.spoofax.dev/ - about: Documentation about Spoofax and all included Meta-Languages. + about: Spoofax 2 documentation and all included meta-languages. + @if(meta.documentationLink != null) + - name: 📚 ${meta.title} Documentation + url: ${meta.documentationLink} + about: Documentation for this project. + @endif - name: ⁉️ Spoofax Support Page url: https://www.spoofax.dev/support about: Information on Spoofax Support, and how to get in touch. - name: 🙋🏽 Spoofax Users Channel url: https://slde.slack.com/archives/C7254SF60 about: The Spoofax Users channel on Slack. See the Spoofax Support Page on how to gain access. - @if(meta.files.githubIssueTemplates.useDiscussions) - - name: 💬 Discussions - url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/ - about: Alternatively, ask questions in the Discussions tab. + @if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) + - name: 🙏 Ask a Question + url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.questionsDiscussionCategory} + about: Ask questions in the Discussions. + @endif + @if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) + - name: 💡 Propose an Idea or Feature + url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.ideasDiscussionCategory} + about: Propose ideas and feature requests in the Discussions. @endif - name: 🛡️ Security issue url: https://github.com/${meta.repoOwner}/${meta.repoName}/security/advisories/new diff --git a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt index 0573b79..8a14a40 100644 --- a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt +++ b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt @@ -139,7 +139,8 @@ class GenerateCommandTests: FunSpec({ generate: true update: true assignDevelopers: true - useDiscussions: true + ideasDiscussionCategory: "feature-requests" + questionsDiscussionCategory: "ask-a-question" bugTypeLabel: "Type-Bug" featureRequestTypeLabel: "Type-Enhancement" questionTypeLabel: "Type-Question" From ce6b354a49b3e5681c4ef08d876356ffeb8fceb6 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 2 Aug 2024 16:56:05 +0200 Subject: [PATCH 54/54] Update conditional syntax --- .../main/resources/templates/github/workflows/build.yaml.kte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte index 0a033a3..95ea79d 100644 --- a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -30,7 +30,7 @@ jobs: gradle ${meta.files.githubWorkflows.publishTask} -Pgitonium.isSnapshot=true gradle-version-command: | gradle -q ${meta.files.githubWorkflows.printVersionTask} -Pgitonium.isSnapshot=true - if: "github.event_name == 'push' && github.ref == 'refs/heads/${meta.mainBranch}'" + if: ${'$'}{{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} needs: [build] secrets: METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} @@ -45,7 +45,7 @@ jobs: gradle ${meta.files.githubWorkflows.publishTask} gradle-version-command: | gradle -q ${meta.files.githubWorkflows.printVersionTask} - if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/${meta.releaseTagPrefix}')" + if: ${'$'}{{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/devenv-release/') }} needs: [build] secrets: METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }}