From f348832af6ca0f1e6df5679bdac031b3febc4cbc Mon Sep 17 00:00:00 2001 From: Moderocky Date: Sun, 24 Sep 2023 12:37:22 +0100 Subject: [PATCH] Merge branch 'dev/patch' into dev/feature (#6065) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix ExprRandomNumber using a method from Java 17 (#6022) * Fix changing remaining time of command cooldown (#6021) Update ScriptCommand.java Co-authored-by: Moderocky * Bump version to 2.7.1 (#5993) Co-authored-by: Moderocky * fix 3 stray INSERT VERSIONs from 2.7.0 (#6027) correct incorrect values * Fix Documentation Actions on dev/patch (#6042) * Tidy up parts of config class. (#6025) * Add Release Model Document (#6041) Add release model document Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com> Co-authored-by: Moderocky * (Cherry Pick) Fix cast throwing if existing variable for command storage exists (#5942) (#6026) Fix cast throwing if existing variable for command storage exists (#5942) * Fix cast throwing if existing variable for command storage exists * Update src/main/java/ch/njol/skript/command/ScriptCommand.java --------- Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com> Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com> * (Cherry Pick) Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978) (#6023) Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978) * Avoid NPE and clean up class * Update ExprEntityAttribute.java * Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java * Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java --------- Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com> * Fix multiple aliases sections not working (#6050) * Fix error when unloading a script with multiple variables sections (#6047) * Returns the old 2.6.4 duplicate variables section behaviour. * Add an error but i don't know what it's for * Add lots of brackets to keep walrus happy :}}} * Add load tracker to prevent multiple loading. * Prevent variable data wipe, fix another bug * Support IDEs from the dark ages that don't know what a star is and think it orbits the earth or something * add a test --------- Co-authored-by: APickledWalrus * Bump actions/checkout from 3 to 4 (#6029) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... * ⚒ Disable Javadocs generation for nightly docs & improvements (#6059) * Let's see if I am good at GH actions 🤞 * ops! * Use proper docs template reference when possible * Disable nightly javadocs generation with an option Each javadoc is ~50mb, which was causing the big size of the docs! while each docs generation is ~2mb only * Fix building * Revert pull changes They are not what fixed the issue, probably the old PRs aren't syncing for some reason * Update build.gradle --------- Co-authored-by: Moderocky * Change the target branch of dependabot (#6063) Update dependabot.yml * Update cleanup-docs.yml --------- Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com> Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com> --- .github/dependabot.yml | 2 ++ .github/workflows/docs/generate-docs/action.yml | 16 +++++++++++++--- .github/workflows/nightly-docs.yml | 6 +++++- src/main/java/ch/njol/skript/SkriptCommand.java | 2 +- .../njol/skript/SkriptCommandTabCompleter.java | 3 ++- src/main/resources/lang/english.lang | 2 +- src/main/resources/lang/french.lang | 2 +- src/main/resources/lang/german.lang | 2 +- src/main/resources/lang/simplifiedchinese.lang | 2 +- 9 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 191b0e340d9..5b930003730 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,14 @@ version: 2 updates: - package-ecosystem: "github-actions" + target-branch: "dev/patch" directory: "/" schedule: interval: "weekly" labels: - "dependencies" - package-ecosystem: "gradle" + target-branch: "dev/patch" directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/docs/generate-docs/action.yml b/.github/workflows/docs/generate-docs/action.yml index 84cc2153f86..e033996868e 100644 --- a/.github/workflows/docs/generate-docs/action.yml +++ b/.github/workflows/docs/generate-docs/action.yml @@ -23,6 +23,11 @@ inputs: required: false default: "*" type: string + generate_javadocs: + description: "Designates whether to generate javadocs for this nightly documentation" + required: false + default: false + type: boolean outputs: DOCS_CHANGED: @@ -41,6 +46,7 @@ runs: SKRIPT_REPO_DIR: ${{ inputs.skript_repo_dir }} IS_RELEASE: ${{ inputs.is_release }} CLEANUP_PATTERN: ${{ inputs.cleanup_pattern }} + GENERATE_JAVADOCS: ${{ inputs.generate_javadocs }} run: | replace_in_directory() { find $1 -type f -exec sed -i -e "s/$2/$3/g" {} \; @@ -55,7 +61,7 @@ runs: if [ -d "${DOCS_REPO_DIR}/docs/templates" ] then export SKRIPT_DOCS_TEMPLATE_DIR=${DOCS_REPO_DIR}/docs/templates - else + else # compatibility for older versions export SKRIPT_DOCS_TEMPLATE_DIR=${DOCS_REPO_DIR}/doc-templates fi @@ -64,12 +70,16 @@ runs: cd $SKRIPT_REPO_DIR if [[ "${IS_RELEASE}" == "true" ]]; then ./gradlew genReleaseDocs releaseJavadoc - else + elif [[ "${GENERATE_JAVADOCS}" == "true" ]]; then ./gradlew genNightlyDocs javadoc + else + ./gradlew genNightlyDocs fi if [ -d "${DOCS_OUTPUT_DIR}" ]; then - mkdir -p "${SKRIPT_DOCS_OUTPUT_DIR}/javadocs" && cp -a "./build/docs/javadoc/." "$_" + if [[ "${GENERATE_JAVADOCS}" == "true" ]]; then + mkdir -p "${SKRIPT_DOCS_OUTPUT_DIR}/javadocs" && cp -a "./build/docs/javadoc/." "$_" + fi mkdir -p "/tmp/normalized-output-docs" && cp -a "${DOCS_OUTPUT_DIR}/." "$_" mkdir -p "/tmp/normalized-generated-docs" && cp -a "${SKRIPT_DOCS_OUTPUT_DIR}/." "$_" diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml index 0cddeb807e5..0d5cc824ad0 100644 --- a/.github/workflows/nightly-docs.yml +++ b/.github/workflows/nightly-docs.yml @@ -3,7 +3,11 @@ name: Nightly documentation on: push: branches: - - '**' + - 'dev/feature' + - 'dev/patch' + - 'enhancement/**' + - 'feature/**' + - 'fix/**' tags-ignore: - '**' diff --git a/src/main/java/ch/njol/skript/SkriptCommand.java b/src/main/java/ch/njol/skript/SkriptCommand.java index 7f01e3ff331..62261d0e426 100644 --- a/src/main/java/ch/njol/skript/SkriptCommand.java +++ b/src/main/java/ch/njol/skript/SkriptCommand.java @@ -398,7 +398,7 @@ else if (args[0].equalsIgnoreCase("info")) { else if (args[0].equalsIgnoreCase("gen-docs")) { File templateDir = Documentation.getDocsTemplateDirectory(); if (!templateDir.exists()) { - Skript.error(sender, "Cannot generate docs! Documentation templates not found at 'plugins/Skript/doc-templates/'"); + Skript.error(sender, "Cannot generate docs! Documentation templates not found at '" + Documentation.getDocsTemplateDirectory().getPath() + "'"); TestMode.docsFailed = true; return true; } diff --git a/src/main/java/ch/njol/skript/SkriptCommandTabCompleter.java b/src/main/java/ch/njol/skript/SkriptCommandTabCompleter.java index 19588312957..4cd9c445173 100644 --- a/src/main/java/ch/njol/skript/SkriptCommandTabCompleter.java +++ b/src/main/java/ch/njol/skript/SkriptCommandTabCompleter.java @@ -18,6 +18,7 @@ */ package ch.njol.skript; +import ch.njol.skript.doc.Documentation; import ch.njol.skript.test.runner.TestMode; import ch.njol.util.StringUtils; import org.bukkit.command.Command; @@ -116,7 +117,7 @@ public List onTabComplete(CommandSender sender, Command command, String options.add("disable"); options.add("update"); options.add("info"); - if (new File(Skript.getInstance().getDataFolder() + "/doc-templates").exists()) + if (Documentation.getDocsTemplateDirectory().exists()) options.add("gen-docs"); if (TestMode.DEV_MODE) options.add("test"); diff --git a/src/main/resources/lang/english.lang b/src/main/resources/lang/english.lang index 17225590e3b..40db6ddb7a0 100644 --- a/src/main/resources/lang/english.lang +++ b/src/main/resources/lang/english.lang @@ -45,7 +45,7 @@ skript command: changes: Lists all changes since the current version download: Download the newest version info: Prints a message with links to Skript's aliases and documentation - gen-docs: Generates documentation using doc-templates in plugin folder + gen-docs: Generates documentation using docs/templates in plugin folder test: Used for running internal Skript tests invalid script: Can't find the script '%s' in the scripts folder! diff --git a/src/main/resources/lang/french.lang b/src/main/resources/lang/french.lang index 9a548ba8587..6aa7e26342d 100644 --- a/src/main/resources/lang/french.lang +++ b/src/main/resources/lang/french.lang @@ -45,7 +45,7 @@ skript command: changes: Liste toutes les modifications apportées depuis la version actuelle download: Télécharge la dernière version info: Affiche un message contenant les liens vers les alias et la documentation de Skript - gen-docs: Génère la documentation en utilisant doc-templates dans le dossier du plugin + gen-docs: Génère la documentation en utilisant docs/templates dans le dossier du plugin test: Utilisé pour exécuter les tests Skript invalid script: Impossible de trouver le script '%s' dans le dossier des scripts ! diff --git a/src/main/resources/lang/german.lang b/src/main/resources/lang/german.lang index cb9637e9dd7..0a8255f44e8 100644 --- a/src/main/resources/lang/german.lang +++ b/src/main/resources/lang/german.lang @@ -45,7 +45,7 @@ skript command: changes: Listet alle Änderungen seit der aktuellen Version auf (auf englisch) download: Lädt die neueste Version herunter info: Druckt eine Nachricht mit Links zu den Aliases und der Dokumentation von Skript. - gen-docs: Generiert Dokumentation mithilfe von doc-templates im Plugin-Ordner + gen-docs: Generiert Dokumentation mithilfe von docs/templates im Plugin-Ordner test: Wird zum Ausführen von Skript-Tests verwendet invalid script: Das Skript '%s' konnte nicht gefunden werden. diff --git a/src/main/resources/lang/simplifiedchinese.lang b/src/main/resources/lang/simplifiedchinese.lang index e1229106eba..c64b007caba 100644 --- a/src/main/resources/lang/simplifiedchinese.lang +++ b/src/main/resources/lang/simplifiedchinese.lang @@ -45,7 +45,7 @@ skript command: changes: 列出自当前版本以来的所有变化 download: 下载最新的版本 info: 打印一个带有Skript的别名和文档链接的信息 - gen-docs: 使用插件文件夹中的doc-templates生成文档 + gen-docs: 使用插件文件夹中的docs/templates生成文档 test: 用于运行内部的Skript测试 invalid script: 无法在scripts文件夹中找到脚本%s