From 83fe0c2cee48b54d3cb3956faa43a54cce152100 Mon Sep 17 00:00:00 2001 From: cnlimiter Date: Wed, 14 Aug 2024 03:09:12 +0800 Subject: [PATCH] refactor(build): streamline gradle properties and workflow configs Refactor the gradle.properties file to introduce the mod id, name, and version labelsfor better project versioning control. Adjust the CI workflow configurations to use thesenew labels, ensuring consistency across the project. Additionally, update the fabric.mod.json to reference the new mod version variable. These changes aim to standardize version management and simplify future updates. --- .github/workflows/action.yml | 52 ----- .github/workflows/build-pr.yml | 49 +++++ .github/workflows/build.yml | 45 +++++ .github/workflows/publish.yml | 120 ++++++++++++ .github/workflows/release.yml | 49 ----- Common/build.gradle | 29 +++ .../java/cn/evole/mods/mcbot/Constants.java | 0 .../main/java/cn/evole/mods/mcbot/McBot.java | 0 .../cn/evole/mods/mcbot/api/bot/BotApi.java | 0 .../cn/evole/mods/mcbot/api/cmd/CmdApi.java | 0 .../mcbot/api/cmd/McBotCommandSource.java | 0 .../mods/mcbot/api/config/AutoConfig.java | 0 .../mods/mcbot/api/config/ConfigHandler.java | 0 .../mods/mcbot/api/config/ConfigManager.java | 0 .../mods/mcbot/api/connect/ConnectApi.java | 0 .../cn/evole/mods/mcbot/api/event/Event.java | 0 .../mods/mcbot/api/event/EventFactory.java | 0 .../mods/mcbot/api/event/ToggleableEvent.java | 0 .../mcbot/api/event/TypeTrackedEvent.java | 0 .../mods/mcbot/api/event/mod/McBotEvents.java | 0 .../api/event/server/ServerGameEvents.java | 0 .../mcbot/common/command/AddBindCommand.java | 0 .../common/command/AddGroupIDCommand.java | 0 .../mcbot/common/command/AuthKeyCommand.java | 0 .../mcbot/common/command/BotIDCommand.java | 0 .../mcbot/common/command/ConnectCommand.java | 0 .../mcbot/common/command/DebugCommand.java | 0 .../mcbot/common/command/DelBindCommand.java | 0 .../common/command/DelGroupIDCommand.java | 0 .../common/command/DisconnectCommand.java | 0 .../mcbot/common/command/HelpCommand.java | 0 .../common/command/ListCustomCommand.java | 0 .../common/command/ReConnectCommand.java | 0 .../mcbot/common/command/RecallCommand.java | 0 .../mcbot/common/command/ReceiveCommand.java | 0 .../mcbot/common/command/ReloadConfigCmd.java | 0 .../mcbot/common/command/SendCommand.java | 0 .../mcbot/common/command/StatusCommand.java | 0 .../mods/mcbot/common/config/BotConfig.java | 0 .../mods/mcbot/common/config/CmdConfig.java | 0 .../mcbot/common/config/CommonConfig.java | 0 .../mods/mcbot/common/config/ModConfig.java | 0 .../mcbot/common/config/StatusConfig.java | 0 .../mods/mcbot/core/data/ChatRecord.java | 0 .../evole/mods/mcbot/core/data/UserBind.java | 0 .../mods/mcbot/core/event/IBotEvent.java | 0 .../mods/mcbot/core/event/IChatEvent.java | 0 .../mods/mcbot/core/event/ICmdEvent.java | 0 .../mods/mcbot/core/event/IPlayerEvent.java | 0 .../mods/mcbot/core/event/ITickEvent.java | 0 .../evole/mods/mcbot/platform/Services.java | 0 .../platform/services/IPlatformHelper.java | 0 .../cn/evole/mods/mcbot/util/FileUtils.java | 0 .../evole/mods/mcbot/util/MsgThreadUtils.java | 0 .../mods/mcbot/util/onebot/BotUtils.java | 0 .../evole/mods/mcbot/util/onebot/CQUtils.java | 0 .../mods/mcbot/util/onebot/GuildRole.java | 0 .../evole/mods/mcbot/util/onebot/ImgUtil.java | 0 .../src/main/resources/lang/en_us.json | 0 .../src/main/resources/lang/zh_cn.json | 0 .../src/main/resources/lang/zh_hk.json | 0 .../src/main/resources/lang/zh_tw.json | 0 .../src/main/resources/mcbot.mixins.json | 0 .../src/main/resources/pack.mcmeta | 0 Fabric/build.gradle | 127 ++++++++++++ .../java/cn/evole/mods/mcbot/McBotFabric.java | 0 .../mcbot/mixin/PlayerAdvancementsMixin.java | 0 .../mcbot/mixin/ServerGamePktImplMixin.java | 0 .../mods/mcbot/mixin/ServerPlayerMixin.java | 0 .../mcbot/platform/FabricPlatformHelper.java | 0 ...ds.mcbot.platform.services.IPlatformHelper | 0 .../src/main/resources/fabric.mod.json | 2 +- .../main/resources/mcbot.fabric.mixins.json | 0 Forge/build.gradle | 182 ++++++++++++++++++ .../java/cn/evole/mods/mcbot/McBotForge.java | 0 .../mcbot/platform/ForgePlatformHelper.java | 0 .../src/main/resources/META-INF/mods.toml | 2 +- ...ds.mcbot.platform.services.IPlatformHelper | 0 .../main/resources/mcbot.forge.mixins.json | 0 build.gradle | 166 ++++++++-------- common/build.gradle | 39 ---- fabric/build.gradle | 106 ---------- forge/build.gradle | 167 ---------------- gradle.properties | 12 +- settings.gradle | 13 +- 85 files changed, 654 insertions(+), 506 deletions(-) delete mode 100644 .github/workflows/action.yml create mode 100644 .github/workflows/build-pr.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml create mode 100644 Common/build.gradle rename {common => Common}/src/main/java/cn/evole/mods/mcbot/Constants.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/McBot.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/cmd/CmdApi.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/config/ConfigHandler.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/connect/ConnectApi.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/Event.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/EventFactory.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/TypeTrackedEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/AddBindCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/AddGroupIDCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/AuthKeyCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/BotIDCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/ConnectCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/DebugCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/DelBindCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/DelGroupIDCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/DisconnectCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/HelpCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/ListCustomCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/ReConnectCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/RecallCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/ReceiveCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/ReloadConfigCmd.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/command/StatusCommand.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/config/CmdConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/config/CommonConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/common/config/StatusConfig.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/data/ChatRecord.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/data/UserBind.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/event/IChatEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/event/IPlayerEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/core/event/ITickEvent.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/platform/Services.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/FileUtils.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/MsgThreadUtils.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/onebot/BotUtils.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/onebot/CQUtils.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/onebot/GuildRole.java (100%) rename {common => Common}/src/main/java/cn/evole/mods/mcbot/util/onebot/ImgUtil.java (100%) rename {common => Common}/src/main/resources/lang/en_us.json (100%) rename {common => Common}/src/main/resources/lang/zh_cn.json (100%) rename {common => Common}/src/main/resources/lang/zh_hk.json (100%) rename {common => Common}/src/main/resources/lang/zh_tw.json (100%) rename {common => Common}/src/main/resources/mcbot.mixins.json (100%) rename {common => Common}/src/main/resources/pack.mcmeta (100%) create mode 100644 Fabric/build.gradle rename {fabric => Fabric}/src/main/java/cn/evole/mods/mcbot/McBotFabric.java (100%) rename {fabric => Fabric}/src/main/java/cn/evole/mods/mcbot/mixin/PlayerAdvancementsMixin.java (100%) rename {fabric => Fabric}/src/main/java/cn/evole/mods/mcbot/mixin/ServerGamePktImplMixin.java (100%) rename {fabric => Fabric}/src/main/java/cn/evole/mods/mcbot/mixin/ServerPlayerMixin.java (100%) rename {fabric => Fabric}/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java (100%) rename {fabric => Fabric}/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper (100%) rename {fabric => Fabric}/src/main/resources/fabric.mod.json (95%) rename {fabric => Fabric}/src/main/resources/mcbot.fabric.mixins.json (100%) create mode 100644 Forge/build.gradle rename {forge => Forge}/src/main/java/cn/evole/mods/mcbot/McBotForge.java (100%) rename {forge => Forge}/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java (100%) rename {forge => Forge}/src/main/resources/META-INF/mods.toml (96%) rename {forge => Forge}/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper (100%) rename {forge => Forge}/src/main/resources/mcbot.forge.mixins.json (100%) delete mode 100644 common/build.gradle delete mode 100644 fabric/build.gradle delete mode 100644 forge/build.gradle diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml deleted file mode 100644 index 484be556..00000000 --- a/.github/workflows/action.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Fabric Action - -on: - push: - branches: [ "multi/" ] - workflow_dispatch: - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - show-progress: false - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'zulu' - check-latest: true - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Make Gradle Wrapper Executable - run: chmod +x ./gradlew - - - name: Build - uses: gradle/gradle-build-action@v2 - with: - arguments: build - - - name: Find Correct JAR - id: findjar - run: | - output="$(find build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")" - echo "::set-output name=jarname::$output" - - name: Upload Build Artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.findjar.outputs.jarname }} - path: build/libs/${{ steps.findjar.outputs.jarname }} diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 00000000..68e7f6fa --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,49 @@ +name: 'Build PR' + +on: + pull_request: + types: + - synchronize + - opened + - ready_for_review + - reopened + + push: + branches: + - '*/**' + + workflow_dispatch: + +jobs: + build: + name: 'Build PR' + runs-on: ubuntu-latest + strategy: + matrix: + loader: [ 'Forge', 'Fabric' ] + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 100 + fetch-tags: true + + - name: 'Set up JDK 17' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 'Build ${{ matrix.loader }} with Gradle' + uses: gradle/gradle-build-action@v2 + with: + arguments: :${{ matrix.loader }}:build + cache-read-only: false + + - name: 'Upload ${{ matrix.loader }} artifacts' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: 'Artifacts-${{ matrix.loader }}' + path: ${{ matrix.loader }}/build/libs/*.jar \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..508c6a44 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: 'Build' + +on: + workflow_call: + push: + branches: + - 'multi/*' + +permissions: + contents: read + statuses: write + +jobs: + build: + name: 'Build' + runs-on: ubuntu-latest + strategy: + matrix: + loader: [ 'Forge', 'Fabric' ] + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 100 + fetch-tags: true + + - name: 'Set up JDK 17' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 'Build ${{ matrix.loader }} with Gradle' + uses: gradle/gradle-build-action@v2 + with: + arguments: :${{ matrix.loader }}:build + cache-read-only: false + + - name: 'Upload ${{ matrix.loader }} artifacts' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: 'Artifacts-${{ matrix.loader }}' + path: ${{ matrix.loader }}/build/libs/*.jar \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..14a6f991 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,120 @@ +name: 'Publish' + +on: + workflow_dispatch: + inputs: + label: + type: choice + description: 'Version label' + options: + - -beta + - -alpha + default: '' + required: false + +permissions: + contents: write + statuses: write + +jobs: + build: + name: 'Build' + runs-on: ubuntu-latest + strategy: + matrix: + loader: [ 'Forge', 'Fabric' ] + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 100 + fetch-tags: true + + - name: 'Set up JDK 17' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 'Build ${{ matrix.loader }} with Gradle' + uses: gradle/gradle-build-action@v2 + with: + arguments: :${{ matrix.loader }}:build + cache-read-only: false + + - name: 'Upload ${{ matrix.loader }} artifacts' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: 'Artifacts-${{ matrix.loader }}' + path: ${{ matrix.loader }}/build/libs/*.jar + + publish: + name: 'Publish' + runs-on: ubuntu-latest + + needs: [build] + + continue-on-error: true + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 100 + fetch-tags: true + + - name: 'Set up JDK 17' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 'Publish with Gradle' + uses: gradle/gradle-build-action@v2 + with: + arguments: publishMod + cache-read-only: false + env: + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + + release: + name: 'Create release' + runs-on: ubuntu-latest + + needs: [build, publish] + + continue-on-error: true + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + with: + fetch-depth: 100 + fetch-tags: true + + - name: 'Get latest tag' + id: latest-tag + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: '0.0.0.0' + + - name: 'Download ${{ matrix.loader }} artifacts' + uses: actions/download-artifact@v4 + with: + pattern: 'Artifacts-*' + path: artifacts/ + merge-multiple: true + + - name: 'Create release' + uses: softprops/action-gh-release@v1 + with: + name: "${{ github.event.repository.name }}-${{ github.ref_name }}-${{ steps.latest-tag.outputs.tag }}${{ inputs.label }}" + tag_name: ${{ steps.latest-tag.outputs.tag }} + target_commitish: ${{ github.ref }} + body_path: CHANGELOG.md + files: | + 'artifacts/*' + '!artifacts/*-slim.*' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 44c11fb9..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Fabric Release - -on: - push: - tags: - - 'v*' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - show-progress: false - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'zulu' - check-latest: true - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Make Gradle Wrapper Executable - run: chmod +x ./gradlew - - - name: Build - uses: gradle/gradle-build-action@v2 - with: - arguments: buildNeeded - - - name: Find Correct JAR - id: findjar - run: | - output="$(find build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")" - echo "::set-output name=jarname::$output" - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - name: McBot-${{ github.ref_name }} - files: build/libs/${{ steps.findjar.outputs.jarname }} - body: Please refer to [CHANGELOG.md](https://github.com/Nova-Committee/re-avaritia/blob/master/CHANGELOG.md) for details. \ No newline at end of file diff --git a/Common/build.gradle b/Common/build.gradle new file mode 100644 index 00000000..3c184cf1 --- /dev/null +++ b/Common/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'org.spongepowered.gradle.vanilla' + +println "Using Minecraft: $minecraft_version" + +minecraft { + version minecraft_version + if(file("src/main/resources/${mod_id}.accesswidener").exists()) { + accessWideners file("src/main/resources/${mod_id}.accesswidener") + } +} + +repositories { + mavenCentral() { + content { + includeGroup 'org.projectlombok' + } + } + maven { url 'https://maven.nova-committee.cn/releases' } +} + +dependencies { + implementation ("org.spongepowered:mixin:0.8.5") + compileOnly ("org.projectlombok:lombok:$lombok_version") + annotationProcessor ("org.projectlombok:lombok:$lombok_version") + implementation ("cn.evole.onebot:OneBot-Client:$onebot_client_version"){transitive = false} + implementation ("org.spongepowered:configurate-yaml:$yaml_version") + implementation("com.github.houbb:csv:0.2.0") + implementation ("com.google.code.findbugs:jsr305:3.0.1") +} \ No newline at end of file diff --git a/common/src/main/java/cn/evole/mods/mcbot/Constants.java b/Common/src/main/java/cn/evole/mods/mcbot/Constants.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/Constants.java rename to Common/src/main/java/cn/evole/mods/mcbot/Constants.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/McBot.java b/Common/src/main/java/cn/evole/mods/mcbot/McBot.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/McBot.java rename to Common/src/main/java/cn/evole/mods/mcbot/McBot.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java b/Common/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/cmd/CmdApi.java b/Common/src/main/java/cn/evole/mods/mcbot/api/cmd/CmdApi.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/cmd/CmdApi.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/cmd/CmdApi.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java b/Common/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigHandler.java b/Common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigHandler.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigHandler.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigHandler.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java b/Common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/connect/ConnectApi.java b/Common/src/main/java/cn/evole/mods/mcbot/api/connect/ConnectApi.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/connect/ConnectApi.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/connect/ConnectApi.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/EventFactory.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/EventFactory.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/EventFactory.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/EventFactory.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/TypeTrackedEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/TypeTrackedEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/TypeTrackedEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/TypeTrackedEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java b/Common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java rename to Common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/AddBindCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/AddBindCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/AddBindCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/AddBindCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/AddGroupIDCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/AddGroupIDCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/AddGroupIDCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/AddGroupIDCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/AuthKeyCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/AuthKeyCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/AuthKeyCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/AuthKeyCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/BotIDCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/BotIDCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/BotIDCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/BotIDCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/ConnectCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/ConnectCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/ConnectCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/ConnectCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/DebugCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/DebugCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/DebugCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/DebugCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/DelBindCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/DelBindCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/DelBindCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/DelBindCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/DelGroupIDCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/DelGroupIDCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/DelGroupIDCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/DelGroupIDCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/DisconnectCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/DisconnectCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/DisconnectCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/DisconnectCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/HelpCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/HelpCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/HelpCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/HelpCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/ListCustomCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/ListCustomCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/ListCustomCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/ListCustomCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/ReConnectCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/ReConnectCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/ReConnectCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/ReConnectCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/RecallCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/RecallCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/RecallCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/RecallCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/ReceiveCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/ReceiveCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/ReceiveCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/ReceiveCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/ReloadConfigCmd.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/ReloadConfigCmd.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/ReloadConfigCmd.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/ReloadConfigCmd.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/command/StatusCommand.java b/Common/src/main/java/cn/evole/mods/mcbot/common/command/StatusCommand.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/command/StatusCommand.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/command/StatusCommand.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/config/CmdConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/common/config/CmdConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/config/CmdConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/config/CmdConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/config/CommonConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/common/config/CommonConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/config/CommonConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/config/CommonConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/common/config/StatusConfig.java b/Common/src/main/java/cn/evole/mods/mcbot/common/config/StatusConfig.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/common/config/StatusConfig.java rename to Common/src/main/java/cn/evole/mods/mcbot/common/config/StatusConfig.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/data/ChatRecord.java b/Common/src/main/java/cn/evole/mods/mcbot/core/data/ChatRecord.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/data/ChatRecord.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/data/ChatRecord.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/data/UserBind.java b/Common/src/main/java/cn/evole/mods/mcbot/core/data/UserBind.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/data/UserBind.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/data/UserBind.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/event/IChatEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/core/event/IChatEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/event/IChatEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/event/IChatEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/event/IPlayerEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/core/event/IPlayerEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/event/IPlayerEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/event/IPlayerEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/core/event/ITickEvent.java b/Common/src/main/java/cn/evole/mods/mcbot/core/event/ITickEvent.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/core/event/ITickEvent.java rename to Common/src/main/java/cn/evole/mods/mcbot/core/event/ITickEvent.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/platform/Services.java b/Common/src/main/java/cn/evole/mods/mcbot/platform/Services.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/platform/Services.java rename to Common/src/main/java/cn/evole/mods/mcbot/platform/Services.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java b/Common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java rename to Common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/FileUtils.java b/Common/src/main/java/cn/evole/mods/mcbot/util/FileUtils.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/FileUtils.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/FileUtils.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/MsgThreadUtils.java b/Common/src/main/java/cn/evole/mods/mcbot/util/MsgThreadUtils.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/MsgThreadUtils.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/MsgThreadUtils.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/onebot/BotUtils.java b/Common/src/main/java/cn/evole/mods/mcbot/util/onebot/BotUtils.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/onebot/BotUtils.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/onebot/BotUtils.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/onebot/CQUtils.java b/Common/src/main/java/cn/evole/mods/mcbot/util/onebot/CQUtils.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/onebot/CQUtils.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/onebot/CQUtils.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/onebot/GuildRole.java b/Common/src/main/java/cn/evole/mods/mcbot/util/onebot/GuildRole.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/onebot/GuildRole.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/onebot/GuildRole.java diff --git a/common/src/main/java/cn/evole/mods/mcbot/util/onebot/ImgUtil.java b/Common/src/main/java/cn/evole/mods/mcbot/util/onebot/ImgUtil.java similarity index 100% rename from common/src/main/java/cn/evole/mods/mcbot/util/onebot/ImgUtil.java rename to Common/src/main/java/cn/evole/mods/mcbot/util/onebot/ImgUtil.java diff --git a/common/src/main/resources/lang/en_us.json b/Common/src/main/resources/lang/en_us.json similarity index 100% rename from common/src/main/resources/lang/en_us.json rename to Common/src/main/resources/lang/en_us.json diff --git a/common/src/main/resources/lang/zh_cn.json b/Common/src/main/resources/lang/zh_cn.json similarity index 100% rename from common/src/main/resources/lang/zh_cn.json rename to Common/src/main/resources/lang/zh_cn.json diff --git a/common/src/main/resources/lang/zh_hk.json b/Common/src/main/resources/lang/zh_hk.json similarity index 100% rename from common/src/main/resources/lang/zh_hk.json rename to Common/src/main/resources/lang/zh_hk.json diff --git a/common/src/main/resources/lang/zh_tw.json b/Common/src/main/resources/lang/zh_tw.json similarity index 100% rename from common/src/main/resources/lang/zh_tw.json rename to Common/src/main/resources/lang/zh_tw.json diff --git a/common/src/main/resources/mcbot.mixins.json b/Common/src/main/resources/mcbot.mixins.json similarity index 100% rename from common/src/main/resources/mcbot.mixins.json rename to Common/src/main/resources/mcbot.mixins.json diff --git a/common/src/main/resources/pack.mcmeta b/Common/src/main/resources/pack.mcmeta similarity index 100% rename from common/src/main/resources/pack.mcmeta rename to Common/src/main/resources/pack.mcmeta diff --git a/Fabric/build.gradle b/Fabric/build.gradle new file mode 100644 index 00000000..1a54eaf7 --- /dev/null +++ b/Fabric/build.gradle @@ -0,0 +1,127 @@ +import net.darkhax.curseforgegradle.Constants as CFConstants +import net.darkhax.curseforgegradle.TaskPublishCurseForge + +plugins { + id 'fabric-loom' version '1.7.+' +} + +base { + archivesName = "$mod_name-fabric-$minecraft_version" +} + +println "Fabric API: $fabric_version, Loader: $fabric_loader_version" + +loom { + runs { + configureEach { + ideConfigGenerated(true) + runDir("../Common/run") + } + + client { + client() + + setConfigName('Fabric: Client') + } + } + + mixin { + useLegacyMixinAp = false + } + + if (project(":Common").file("src/main/resources/${mod_id}.accesswidener").exists()) { + accessWidenerPath.set(project(":Common").file("src/main/resources/${mod_id}.accesswidener")) + } +} + +repositories { + maven { url 'https://maven.nova-committee.cn/releases' } + maven { url 'https://maven.minecraftforge.net/' } + maven { url 'https://maven.parchmentmc.org' } +} + +dependencies { + minecraft "com.mojang:minecraft:$minecraft_version" + + mappings loom.layered() { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-$minecraft_version:$mappings_version@zip") + } + + compileOnly project(':Common') + + modImplementation "net.fabricmc:fabric-loader:$fabric_loader_version" + modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version" + + implementation include("cn.evole.onebot:OneBot-Client:$onebot_client_version"){transitive = false} + implementation include("org.spongepowered:configurate-yaml:$yaml_version") + implementation include("com.github.houbb:csv:0.2.0") + + compileOnly "org.projectlombok:lombok:$lombok_version" + annotationProcessor "org.projectlombok:lombok:$lombok_version" +} + +sourcesJar { + from project(':Common').sourceSets.main.allSource +} + +artifacts { + archives remapJar + archives sourcesJar +} + +tasks.register('publishCurseForge', TaskPublishCurseForge) { + dependsOn(tasks.remapJar) + + apiToken = System.getenv('CURSEFORGE_TOKEN') + + var modFile = upload('534155', tasks.remapJar.archiveFile) + modFile.displayName = "${base.archivesName.get()}-$version" + modFile.releaseType = CFConstants.RELEASE_TYPE_BETA + modFile.addGameVersion(minecraft_version, 'client') + modFile.addModLoader 'Fabric' + modFile.addJavaVersion "Java $java_version" + modFile.addRequirement 'fabric-api' + + modFile.changelogType = CFConstants.CHANGELOG_HTML + modFile.changelog = provider { file("${rootDir}/CHANGELOG.md") } + +} + +modrinth { + token = System.getenv('MODRINTH_TOKEN') + + projectId = 'mcbot' + + versionName = "${base.archivesName.get()}-$version" + versionNumber = version + versionType = 'beta' + + gameVersions = [ minecraft_version ] + loaders = [ 'fabric' ] + + changelog = provider { file("${rootDir}/CHANGELOG.md") } + + uploadFile = tasks.remapJar + additionalFiles = [ tasks.sourcesJar ] +} + +tasks.modrinth.dependsOn(tasks.remapJar) +tasks.modrinth.dependsOn(tasks.sourcesJar) + +tasks.modrinth.dependsOn(':Changelog:makeMarkdownChangelog') + +publishing { + publications { + register('mavenJava', MavenPublication) { + artifact remapJar + artifact sourcesJar + + artifactId archivesBaseName + } + } + + repositories { + mavenLocal() + } +} \ No newline at end of file diff --git a/fabric/src/main/java/cn/evole/mods/mcbot/McBotFabric.java b/Fabric/src/main/java/cn/evole/mods/mcbot/McBotFabric.java similarity index 100% rename from fabric/src/main/java/cn/evole/mods/mcbot/McBotFabric.java rename to Fabric/src/main/java/cn/evole/mods/mcbot/McBotFabric.java diff --git a/fabric/src/main/java/cn/evole/mods/mcbot/mixin/PlayerAdvancementsMixin.java b/Fabric/src/main/java/cn/evole/mods/mcbot/mixin/PlayerAdvancementsMixin.java similarity index 100% rename from fabric/src/main/java/cn/evole/mods/mcbot/mixin/PlayerAdvancementsMixin.java rename to Fabric/src/main/java/cn/evole/mods/mcbot/mixin/PlayerAdvancementsMixin.java diff --git a/fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerGamePktImplMixin.java b/Fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerGamePktImplMixin.java similarity index 100% rename from fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerGamePktImplMixin.java rename to Fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerGamePktImplMixin.java diff --git a/fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerPlayerMixin.java b/Fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerPlayerMixin.java similarity index 100% rename from fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerPlayerMixin.java rename to Fabric/src/main/java/cn/evole/mods/mcbot/mixin/ServerPlayerMixin.java diff --git a/fabric/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java b/Fabric/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java similarity index 100% rename from fabric/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java rename to Fabric/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java diff --git a/fabric/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper b/Fabric/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper similarity index 100% rename from fabric/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper rename to Fabric/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper diff --git a/fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json similarity index 95% rename from fabric/src/main/resources/fabric.mod.json rename to Fabric/src/main/resources/fabric.mod.json index 06228dc9..e87548ec 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "${mod_id}", - "version": "${version}", + "version": "${mod_version}", "name": "${mod_name}", "description": "${description}", "authors": [ diff --git a/fabric/src/main/resources/mcbot.fabric.mixins.json b/Fabric/src/main/resources/mcbot.fabric.mixins.json similarity index 100% rename from fabric/src/main/resources/mcbot.fabric.mixins.json rename to Fabric/src/main/resources/mcbot.fabric.mixins.json diff --git a/Forge/build.gradle b/Forge/build.gradle new file mode 100644 index 00000000..c7410c6e --- /dev/null +++ b/Forge/build.gradle @@ -0,0 +1,182 @@ +import net.darkhax.curseforgegradle.Constants as CFConstants +import net.darkhax.curseforgegradle.TaskPublishCurseForge + +plugins { + id 'net.minecraftforge.gradle' version '6.+' + id 'org.parchmentmc.librarian.forgegradle' version '1.+' + id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' +} + +base { + archivesName = "$mod_name-forge-$minecraft_version" +} + +mixin { + add sourceSets.main, "${mod_id}.refmap.json" + + config "${mod_id}.mixins.json" + config "${mod_id}.forge.mixins.json" +} + +configurations { + library + implementation.extendsFrom library +} + +minecraft.runs.all { + lazyToken('minecraft_classpath') { + configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator) + } +} + +println "Forge: $forge_version" + +minecraft { + mappings channel: mappings_channel, version: "$mappings_version-$minecraft_version" + + copyIdeResources = true + + if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + } + + runs { + configureEach { + workingDirectory project(':Common').file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + property 'forge.enabledGameTestNamespaces', mod_id + + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "$buildDir/createSrgToMcp/output.srg" + + ideaModule "${rootProject.name}.${project.name}.main" + + mods { + "${mod_id}" { + source sourceSets.main + source project(':Common').sourceSets.main + } + } + } + + client + } +} + +sourceSets.each { + var dir = layout.buildDirectory.dir("sourcesSets/$it.name") + + it.output.resourcesDir = dir + it.java.destinationDirectory = dir +} + +repositories { + mavenCentral() { + content { + includeGroup 'org.projectlombok' + } + } + maven { url 'https://maven.nova-committee.cn/releases' } +} + +dependencies { + minecraft "net.minecraftforge:forge:$minecraft_version-$forge_version" + + compileOnly project(':Common') + + library ("cn.evole.onebot:OneBot-Client:$onebot_client_version"){transitive = false} + library ("org.spongepowered:configurate-yaml:$yaml_version") + library("com.github.houbb:csv:0.2.0") + + compileOnly "org.projectlombok:lombok:$lombok_version" + annotationProcessor "org.projectlombok:lombok:$lombok_version" +} + +afterEvaluate { + tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava) + tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava) +} + +jar { + archiveClassifier = 'slim' + + manifest { + attributes([ + 'MixinConfigs': "${mod_id}.mixins.json,${mod_id}.forge.mixins.json" + ]) + } + + finalizedBy('reobfJar') +} + +tasks.jarJar { + archiveClassifier = '' + + finalizedBy('reobfJarJar') +} + +sourcesJar { + from project(':Common').sourceSets.main.allSource +} + +artifacts { + archives jar + archives sourcesJar +} + +tasks.register('publishCurseForge', TaskPublishCurseForge) { + dependsOn(tasks.jarJar) + apiToken = System.getenv('CURSEFORGE_TOKEN') + + var modFile = upload('534155', tasks.jarJar.archiveFile) + modFile.displayName = "${base.archivesName.get()}-$version" + modFile.releaseType = CFConstants.RELEASE_TYPE_BETA + modFile.addGameVersion(minecraft_version, 'client') + modFile.addModLoader('Forge') + modFile.addJavaVersion "Java $java_version" + + modFile.changelogType = CFConstants.CHANGELOG_HTML + modFile. changelog = provider { file("${rootDir}/CHANGELOG.md") } +} + +modrinth { + token = System.getenv('MODRINTH_TOKEN') + + projectId = 'McBot' + + versionName = "${base.archivesName.get()}-$version" + versionNumber = version + versionType = 'beta' + + gameVersions = [ minecraft_version ] + loaders = [ 'forge' ] + + changelog = provider { file("${rootDir}/CHANGELOG.md") } + + uploadFile = tasks.jarJar + additionalFiles = [ tasks.sourcesJar ] +} + +tasks.modrinth.dependsOn(tasks.jarJar) +tasks.modrinth.dependsOn(tasks.sourcesJar) + +tasks.modrinth.dependsOn(':Changelog:makeMarkdownChangelog') + +publishing { + publications { + register('mavenJava', MavenPublication) { + artifact sourcesJar + + jarJar.component(it) + + artifactId archivesBaseName + } + } + + repositories { + mavenLocal() + } +} \ No newline at end of file diff --git a/forge/src/main/java/cn/evole/mods/mcbot/McBotForge.java b/Forge/src/main/java/cn/evole/mods/mcbot/McBotForge.java similarity index 100% rename from forge/src/main/java/cn/evole/mods/mcbot/McBotForge.java rename to Forge/src/main/java/cn/evole/mods/mcbot/McBotForge.java diff --git a/forge/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java b/Forge/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java similarity index 100% rename from forge/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java rename to Forge/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java diff --git a/forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml similarity index 96% rename from forge/src/main/resources/META-INF/mods.toml rename to Forge/src/main/resources/META-INF/mods.toml index 3a462896..b9496a5e 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -4,7 +4,7 @@ license = "${license}" # Review your options at https://choosealicense.com/. #issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional [[mods]] #mandatory modId = "${mod_id}" #mandatory -version = "${version}" #mandatory +version = "${mod_version}" #mandatory displayName = "${mod_name}" #mandatory #updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/) #displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI) diff --git a/forge/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper b/Forge/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper similarity index 100% rename from forge/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper rename to Forge/src/main/resources/META-INF/services/cn.evole.mods.mcbot.platform.services.IPlatformHelper diff --git a/forge/src/main/resources/mcbot.forge.mixins.json b/Forge/src/main/resources/mcbot.forge.mixins.json similarity index 100% rename from forge/src/main/resources/mcbot.forge.mixins.json rename to Forge/src/main/resources/mcbot.forge.mixins.json diff --git a/build.gradle b/build.gradle index 92d4c9c5..1899d3cd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,108 +1,108 @@ plugins { - // Required for NeoGradle - id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" + id 'org.spongepowered.gradle.vanilla' version '0.2.+' apply false + id 'net.darkhax.curseforgegradle' version '1.+' apply false + id 'com.modrinth.minotaur' version '2.+' apply false + id 'io.freefair.lombok' version '8.+' apply false + id 'net.neoforged.gradleutils' version '3.+' } +gradleutils.version { + tags { + if (mod_version_label != 'release') + label = mod_version_label + + appendCommitOffset = false + } +} + +println "$mod_name, Version: ${gradleutils.version.toString()}" +println "Minecraft: $minecraft_version, Mappings: $mappings_channel-$mappings_version" + subprojects { apply plugin: 'java' - java.toolchain.languageVersion = JavaLanguageVersion.of(17) - java.withSourcesJar() + if (name != 'Common') { + apply plugin: 'net.darkhax.curseforgegradle' + apply plugin: 'com.modrinth.minotaur' - jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_name}" } - } - manifest { - attributes([ - 'Specification-Title' : mod_name, - 'Specification-Vendor' : mod_author, - 'Specification-Version' : project.jar.archiveVersion, - 'Implementation-Title' : project.name, - 'Implementation-Version' : project.jar.archiveVersion, - 'Implementation-Vendor' : mod_author, - 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), - 'Timestamp' : System.currentTimeMillis(), - 'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", - 'Built-On-Minecraft' : minecraft_version - ]) - } + evaluationDependsOn(':Common') } - sourcesJar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_name}" } - } + apply plugin: 'io.freefair.lombok' + + apply plugin: 'idea' + apply plugin: 'maven-publish' + + java { + toolchain.languageVersion = JavaLanguageVersion.of(java_version) + + withSourcesJar() + + sourceCompatibility = JavaVersion."VERSION_$java_version" + targetCompatibility = JavaVersion."VERSION_$java_version" } - repositories { - mavenCentral() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - maven { - name = 'NeoForge' - url = 'https://maven.neoforged.net/releases/' + idea { + module { + downloadSources = true + downloadJavadoc = true } - maven { - name = 'Forge' - url = 'https://maven.minecraftforge.net/' - } - maven { - name = 'Sponge / Mixin' - url = 'https://repo.spongepowered.org/repository/maven-public/' - } - maven { - name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)' - url = 'https://maven.blamejared.com' - } - maven { - name = "Ladysnake Mods" - url = 'https://maven.ladysnake.org/releases' - } - maven { url = 'https://maven.nova-committee.cn/releases' } } + + version = gradleutils.version.toString() + group = project.group + tasks.withType(JavaCompile).configureEach { - - it.options.encoding = 'UTF-8' - it.options.getRelease().set(17) + source project(':Common').sourceSets.main.allSource + + options.encoding = 'UTF-8' } - processResources { - def expandProps = [ - "version": version, - "group": project.group, //Else we target the task's group. - "minecraft_version": minecraft_version, - "forge_version": forge_version, - "forge_loader_version_range": forge_loader_version_range, - "forge_version_range": forge_version_range, - "minecraft_version_range": minecraft_version_range, - "fabric_version": fabric_version, - "fabric_loader_version": fabric_loader_version, - "mod_name": mod_name, - "mod_author": mod_author, - "mod_id": mod_id, - "license": license, - "description": project.description, - "neoforge_version": neoforge_version, + tasks.withType(ProcessResources).configureEach { + from project(':Common').sourceSets.main.resources + + var replaceProperties = [ + 'mod_version' : version, + "minecraft_version" : minecraft_version, + "forge_version" : forge_version, + "forge_loader_version_range" : forge_loader_version_range, + "forge_version_range" : forge_version_range, + "minecraft_version_range" : minecraft_version_range, + "fabric_version" : fabric_version, + "fabric_loader_version" : fabric_loader_version, + "mod_name" : mod_name, + "mod_author" : mod_author, + "mod_id" : mod_id, + "license" : license, + "description" : project.description, + "neoforge_version" : neoforge_version, "neoforge_loader_version_range": neoforge_loader_version_range, - "credits": credits + "credits" : credits ] - filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { - expand expandProps + inputs.properties replaceProperties + + filesMatching(['META-INF/*mods.toml', 'fabric.mod.json', 'pack.mcmeta']) { + expand replaceProperties } - inputs.properties(expandProps) } - // Disables Gradle's custom module metadata from being published to maven. The - // metadata includes mapped dependencies which are not reasonably consumable by - // other mod developers. - tasks.withType(GenerateModuleMetadata).configureEach { - - enabled = false + tasks.withType(Jar).configureEach { + manifest { + attributes([ + 'Specification-Title' : mod_id, + 'Specification-Vendor' : mod_author, + 'Specification-Version' : '1', + 'Implementation-Title' : rootProject.name, + 'Implementation-Version': jar.archiveVersion, + 'Implementation-Vendor' : mod_author + ]) + } } - } + +tasks.register('publishMod') { + dependsOn(':Forge:publishCurseForge').finalizedBy(':Fabric:publishCurseForge') + dependsOn(':Forge:modrinth').finalizedBy(':Fabric:modrinth') +} \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle deleted file mode 100644 index c8acf674..00000000 --- a/common/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -plugins { - id 'idea' - id 'java' - id 'maven-publish' - id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' -} -base { - archivesName = "${mod_name}-common-${minecraft_version}" -} -minecraft { - version(minecraft_version) - if(file("src/main/resources/${mod_id}.accesswidener").exists()){ - accessWideners(file("src/main/resources/${mod_id}.accesswidener")) - } -} - -dependencies { - compileOnly ("org.spongepowered:mixin:0.8.5") - compileOnly ("org.projectlombok:lombok:1.18.30") - annotationProcessor ("org.projectlombok:lombok:1.18.30") - implementation ("cn.evole.onebot:OneBot-Client:${onebot_client_version}"){transitive = false} - implementation ("org.spongepowered:configurate-yaml:${yaml_version}") - implementation("com.github.houbb:csv:0.2.0") - implementation ("com.google.code.findbugs:jsr305:3.0.1") -} - -publishing { - publications { - mavenJava(MavenPublication) { - artifactId base.archivesName.get() - from components.java - } - } - repositories { - maven { - url "file://" + System.getenv("local_maven") - } - } -} \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle deleted file mode 100644 index fb041a93..00000000 --- a/fabric/build.gradle +++ /dev/null @@ -1,106 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'maven-publish' - id 'fabric-loom' version '1.6-SNAPSHOT' -} -base { - archivesName = "${mod_name}-fabric-${minecraft_version}" -} -dependencies { - minecraft "com.mojang:minecraft:${minecraft_version}" - mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" - compileOnly ("org.projectlombok:lombok:1.18.30") - annotationProcessor ("org.projectlombok:lombok:1.18.30") - implementation ("cn.evole.onebot:OneBot-Client:${onebot_client_version}"){transitive = false} - implementation ("org.spongepowered:configurate-yaml:${yaml_version}") - implementation("com.github.houbb:csv:0.2.0") - implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' - compileOnly project(":common") -} - -loom { - if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) { - accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener")) - } - mixin { - defaultRefmapName.set("${mod_id}.refmap.json") - } - runs { - client { - client() - setConfigName("Fabric Client") - ideConfigGenerated(true) - runDir("run") - } - server { - server() - setConfigName("Fabric Server") - ideConfigGenerated(true) - runDir("run") - } - } -} - -tasks.withType(JavaCompile).configureEach { - source(project(":common").sourceSets.main.allSource) -} -tasks.withType(Javadoc).configureEach { - source(project(":common").sourceSets.main.allJava) -} -tasks.named("sourcesJar", Jar) { - from(project(":common").sourceSets.main.allSource) -} - -processResources { - from project(":common").sourceSets.main.resources -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - - version = "${minecraft_version}-${version}" - artifactId = "lighteco-fabric" - groupId = "committee.nova.mods" - - - pom { - name = 'lighteco' - licenses { - license { - name = 'AGPL V3' - url = 'https://www.gnu.org/licenses/agpl-3.0.html' - } - } - developers { - developer { - id = 'mikhailtapio' - name = 'MikhailTapio' - } - developer { - id = 'cnlimiter' - name = '演变' - } - } - } - } - } - - repositories { - if (System.getenv('MAVEN_USERNAME') != null && System.getenv('MAVEN_PASSWORD') != null) { - maven { - name 'S3' - url = 'https://maven.nova-committee.cn/s3' - - credentials { - username System.getenv('MAVEN_USERNAME') - password System.getenv('MAVEN_PASSWORD') - } - } - } - } -} diff --git a/forge/build.gradle b/forge/build.gradle deleted file mode 100644 index fb7288d2..00000000 --- a/forge/build.gradle +++ /dev/null @@ -1,167 +0,0 @@ -plugins { - id 'idea' - id 'maven-publish' - id 'net.minecraftforge.gradle' version '[6.0,6.2)' - id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' -} -base { - archivesName = "${mod_name}-forge-${minecraft_version}" -} -mixin { - add(sourceSets.main, "${mod_id}.refmap.json") - - config("${mod_id}.mixins.json") - config("${mod_id}.forge.mixins.json") -} - -configurations { - library - implementation.extendsFrom library -} - - -minecraft.runs.all { - lazyToken('minecraft_classpath') { - configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator) - } -} - -minecraft { - mappings channel: 'official', version: minecraft_version - - copyIdeResources = true //Calls processResources when in dev - - // Automatically enable forge AccessTransformers if the file exists - // This location is hardcoded in Forge and can not be changed. - // https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 - if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - } - - runs { - client { - workingDirectory project.file('run') - ideaModule "${rootProject.name}.${project.name}.main" - taskName 'Client' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - mods { - modClientRun { - source sourceSets.main - source project(":common").sourceSets.main - } - } - } - - server { - workingDirectory project.file('run') - ideaModule "${rootProject.name}.${project.name}.main" - taskName 'Server' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - mods { - modServerRun { - source sourceSets.main - source project(":common").sourceSets.main - } - } - } - - data { - workingDirectory project.file('run') - ideaModule "${rootProject.name}.${project.name}.main" - args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') - taskName 'Data' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - mods { - modDataRun { - source sourceSets.main - source project(":common").sourceSets.main - } - } - } - } -} - -sourceSets.main.resources.srcDir 'src/generated/resources' - -dependencies { - minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" - compileOnly project(":common") - compileOnly ("org.projectlombok:lombok:1.18.30") - annotationProcessor ("org.projectlombok:lombok:1.18.30") - library ("cn.evole.onebot:OneBot-Client:${onebot_client_version}"){transitive = false} - library ("org.spongepowered:configurate-yaml:${yaml_version}") - library("com.github.houbb:csv:0.2.0") - annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor") -} - -tasks.withType(JavaCompile).configureEach { - source(project(":common").sourceSets.main.allSource) -} -tasks.withType(Javadoc).configureEach { - source(project(":common").sourceSets.main.allJava) -} -tasks.named("sourcesJar", Jar) { - from(project(":common").sourceSets.main.allSource) -} - -processResources { - from project(":common").sourceSets.main.resources -} - -jar.finalizedBy('reobfJar') - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - - version = "${minecraft_version}-${version}" - artifactId = "lighteco-forge" - groupId = "committee.nova.mods" - - - pom { - name = 'lighteco' - licenses { - license { - name = 'AGPL V3' - url = 'https://www.gnu.org/licenses/agpl-3.0.html' - } - } - developers { - developer { - id = 'mikhailtapio' - name = 'MikhailTapio' - } - developer { - id = 'cnlimiter' - name = '演变' - } - } - } - } - } - - repositories { - if (System.getenv('MAVEN_USERNAME') != null && System.getenv('MAVEN_PASSWORD') != null) { - maven { - name 'S3' - url = 'https://maven.nova-committee.cn/s3' - - credentials { - username System.getenv('MAVEN_USERNAME') - password System.getenv('MAVEN_PASSWORD') - } - } - } - } -} - -sourceSets.each { - def dir = layout.buildDirectory.dir("sourcesSets/$it.name") - it.output.resourcesDir = dir - it.java.destinationDirectory = dir -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index fb7655cc..d4516ccb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,15 +7,23 @@ group=cn.evole.mods yaml_version=4.1.2 onebot_client_version=0.4.1 +lombok_version = 1.18.+ +java_version = 17 + # Common -minecraft_version=1.20.1 +mod_id=mcbot mod_name=McBot mod_author=cnlimiter -mod_id=mcbot license=GNU AGPL 3.0 credits= description=Adds chat linking between QQ and Minecraft and QQ commands to request server data. minecraft_version_range=[1.20, 1.21) +minecraft_version=1.20.1 +mod_version_label=beta + +# Mappings +mappings_channel = parchment +mappings_version = 2023.09.03 # Fabric fabric_version=0.92.1+1.20.1 diff --git a/settings.gradle b/settings.gradle index ca52d4a0..bf25fd0c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,8 @@ pluginManagement { name = 'Forge' url = 'https://maven.minecraftforge.net/' } - maven { url = 'https://maven.nova-committee.cn/releases' } + maven { url 'https://maven.nova-committee.cn/releases' } + maven { url 'https://maven.parchmentmc.org/' } } } @@ -25,9 +26,9 @@ plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } -// This should match the folder name of the project, or else IDEA may complain (see https://youtrack.jetbrains.com/issue/IDEA-317606) rootProject.name = 'McBot' -include("common") -include("fabric") -include("forge") -//include("neoforge") +include ( + "Common", + "Fabric", + "Forge" +) \ No newline at end of file