From 531e408d855517b5f7b4461690331cd86a1f4048 Mon Sep 17 00:00:00 2001 From: broccoli Date: Mon, 12 Aug 2024 20:17:34 +0100 Subject: [PATCH 1/5] feat(core): document shading cloud and some notes about versions --- docs/core/index.md | 7 +++++ main.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/docs/core/index.md b/docs/core/index.md index fea1787..668dd0c 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -750,3 +750,10 @@ contains an opinionated implementation of the help system for Minecraft. You can find examples on GitHub for either [Builders](https://github.com/Incendo/cloud-minecraft/blob/master/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/builder/feature/HelpExample.java) or [Annotations](https://github.com/Incendo/cloud-minecraft/blob/master/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/annotations/feature/HelpExample.java). + +### Build System + +Cloud will have differing versions between core and the other groups of modules, Cloud Minecraft for example will be updated seperately. If core has a bug fix or feature that is not yet available +inside of the current Cloud Minecraft release you can define cloud-core as it's own dependency force it's use that way.You should also shade Cloud inside of your project, here's an example of doing so: + +{{ shade_dependency() }} \ No newline at end of file diff --git a/main.py b/main.py index 613a5d2..f52f999 100644 --- a/main.py +++ b/main.py @@ -31,6 +31,76 @@ def dependency_listing(name: str, version: str = None) -> str: ``` """.format(name=name, version=env.variables.version[version]) + @env.macro + def shade_dependency() -> str: + return """ +=== "Maven" + + ```xml + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + package + + shade + + + + + org.incendo.cloud + com.yourpackage.libs.cloud + + + + + + + + + ``` + +=== "Gradle (Kotlin)" + + ```kotlin + plugins { + id("com.gradleup.shadow") version "8.3.0" + } + + tasks { + assemble { + dependsOn(shadowJar) + } + + shadowJar { + relocate("org.incendo.cloud", "com.yourpackage.libs.cloud") + } + } + ``` + +=== "Gradle (Groovy)" + + ```groovy + plugins { + id 'com.gradleup.shadow' version '8.3.0' + } + + tasks { + assemble { + dependsOn shadowJar + } + + shadowJar { + relocate 'org.incendo.cloud', 'com.yourpackage.libs.cloud' + } + } + ``` +""" + @env.macro def javadoc(link: str, title: str = None) -> str: if title is None: From 7a905fb39399d344d43b653140da4a9996c056f8 Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Sat, 17 Aug 2024 20:58:22 +0100 Subject: [PATCH 2/5] update shade/versioning section --- docs/core/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/index.md b/docs/core/index.md index 668dd0c..c75358e 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -751,9 +751,9 @@ You can find examples on GitHub for either [Builders](https://github.com/Incendo/cloud-minecraft/blob/master/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/builder/feature/HelpExample.java) or [Annotations](https://github.com/Incendo/cloud-minecraft/blob/master/examples/example-bukkit/src/main/java/cloud/commandframework/examples/bukkit/annotations/feature/HelpExample.java). -### Build System +### Usage within projects Cloud will have differing versions between core and the other groups of modules, Cloud Minecraft for example will be updated seperately. If core has a bug fix or feature that is not yet available inside of the current Cloud Minecraft release you can define cloud-core as it's own dependency force it's use that way.You should also shade Cloud inside of your project, here's an example of doing so: -{{ shade_dependency() }} \ No newline at end of file +{{ shade_dependency() }} From a9d44a904bcdc493dbc3cb2d5c800089adec76fb Mon Sep 17 00:00:00 2001 From: broccoli Date: Thu, 22 Aug 2024 15:05:54 +0100 Subject: [PATCH 3/5] feat: add examples for adding parameters flag --- docs/annotations/index.md | 4 +++ main.py | 73 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/docs/annotations/index.md b/docs/annotations/index.md index fc6d693..419c0b2 100644 --- a/docs/annotations/index.md +++ b/docs/annotations/index.md @@ -25,6 +25,10 @@ Cloud Annotations is available through [Maven Central](https://central.sonatype. {{ dependency_listing("annotations", "core") }} +In order to for Cloud to obtain the parameter names for arguments you'll need to add the parameter flag to your Java/Kotlin compilation step. + +{{ javac_parameters() }} + You then need to create an {{ javadoc("https://javadoc.io/doc/org.incendo/cloud-annotations/latest/org/incendo/cloud/annotations/AnnotationParser.html", "AnnotationParser") }} instance. diff --git a/main.py b/main.py index f52f999..86555f5 100644 --- a/main.py +++ b/main.py @@ -101,6 +101,79 @@ def shade_dependency() -> str: ``` """ + @env.macro + def javac_parameters() -> str: + return """ +=== "Maven" + + ```xml + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + -parameters + + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + 1.9.0 + + + compile + + compile + + + + -java-parameters + + + + + + + + ``` + +=== "Gradle (Kotlin)" + + ```kotlin + tasks.withType { + options.compilerArgs.add("-parameters") + } + + // only needed if your project uses Kotlin + tasks.withType { + compilerOptions { + freeCompilerArgs.add("-java-parameters") + } + } + ``` + +=== "Gradle (Groovy)" + + ```groovy + tasks.withType(JavaCompile) { + options.compilerArgs << "-parameters" + } + + // only needed if your project uses Kotlin + tasks.withType(KotlinCompile) { + kotlinOptions { + freeCompilerArgs << "-java-parameters" + } + } + ``` +""" + @env.macro def javadoc(link: str, title: str = None) -> str: if title is None: From 56c897ad899765693ce0e4b5d5aa658615639c64 Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Sun, 1 Sep 2024 18:30:06 +0100 Subject: [PATCH 4/5] review fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Söderberg <4096670+Citymonstret@users.noreply.github.com> --- docs/core/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/index.md b/docs/core/index.md index c75358e..ceaf186 100644 --- a/docs/core/index.md +++ b/docs/core/index.md @@ -754,6 +754,6 @@ You can find examples on GitHub for either ### Usage within projects Cloud will have differing versions between core and the other groups of modules, Cloud Minecraft for example will be updated seperately. If core has a bug fix or feature that is not yet available -inside of the current Cloud Minecraft release you can define cloud-core as it's own dependency force it's use that way.You should also shade Cloud inside of your project, here's an example of doing so: +inside of the current Cloud Minecraft release you can define cloud-core as it's own dependency force it's use that way. You should also shade Cloud inside of your project, here's an example of doing so: {{ shade_dependency() }} From c13134b587927a41048512a305bfb3fbdcacc06f Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Sun, 1 Sep 2024 18:30:41 +0100 Subject: [PATCH 5/5] fix indentation in maven example --- main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 86555f5..0307fa5 100644 --- a/main.py +++ b/main.py @@ -47,15 +47,15 @@ def shade_dependency() -> str: package - shade + shade - - - org.incendo.cloud - com.yourpackage.libs.cloud - - + + + org.incendo.cloud + com.yourpackage.libs.cloud + +