diff --git a/.github/scripts/test-no-crash-reports.sh b/.github/scripts/test-no-crash-reports.sh deleted file mode 100644 index c67e342..0000000 --- a/.github/scripts/test-no-crash-reports.sh +++ /dev/null @@ -1,9 +0,0 @@ -directory="run/crash-reports" -if [ -d $directory ]; then - echo "Crash reports detected:" - cat $directory/* - exit 1 -else - echo "No crash reports detected" - exit 0 -fi diff --git a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh deleted file mode 100644 index 6ab1b17..0000000 --- a/.github/scripts/update-version.sh +++ /dev/null @@ -1,10 +0,0 @@ -if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep build.gradle) ]; then - new_version="$(git log -n1 --format=format:"%H")" - sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle - git add build.gradle - git commit -m "[ci skip] update build script version to $new_version" - git push - echo "Updated buildscript version to $new_version"; -else - echo "Ignored buildscript version update: no changes detected" -fi diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 6c9b3cb..0000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,45 +0,0 @@ -# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Build and test - -on: - pull_request: - branches: [ master, main ] - push: - branches: [ master, main ] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up JDK 8 - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'adopt' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Setup the workspace - run: ./gradlew setupCIWorkspace - - - name: Build the mod - run: ./gradlew build - - - name: Run server for 1 minute - run: | - mkdir run - echo "eula=true" > run/eula.txt - timeout 10 ./gradlew runServer || true - - - name: Test no crashes happend - run: | - chmod +x .github/scripts/test-no-crash-reports.sh - .github/scripts/test-no-crash-reports.sh diff --git a/.github/workflows/buildscript-maintenance.yml b/.github/workflows/buildscript-maintenance.yml deleted file mode 100644 index f5128e3..0000000 --- a/.github/workflows/buildscript-maintenance.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow only meant for the source mod you shouldn't bring it into your own project - -name: Buildscript maintenance - -on: - push: - branches: [ master, main ] - -jobs: - buildscript-maintenance: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - - name: setup git config - run: | - git config user.name "GitHub CI Bot" - git config user.email "<>" - - - name: Ensure build script version is up to date - run: .github/scripts/update-version.sh diff --git a/.github/workflows/release-packages-latest.yml b/.github/workflows/release-packages-latest.yml deleted file mode 100644 index 1f1b162..0000000 --- a/.github/workflows/release-packages-latest.yml +++ /dev/null @@ -1,72 +0,0 @@ -# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release latest starter and migration packages - -on: - push: - branches: [ master, main ] - -jobs: - zip-and-release-packages: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set release version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Prepare release folder - run: | - mkdir packages - - - name: Zip starter - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/starter.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages-latest.yml" \ - -x ".github/workflows/release-packages-tags.yml" \ - \ - -x "*docs/*" \ - -x "README.md" \ - -x "LICENSE" \ - \ - -x "starter.zip" \ - -x "migration.zip" - - - name: Zip migration - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/migration.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages-latest.yml" \ - -x ".github/workflows/release-packages-tags.yml" \ - \ - -x "*docs/*" \ - -x "*src/*" \ - -x "LICENSE" \ - -x "README.md" \ - \ - -x "starter.zip" \ - -x "migration.zip" - - - name: Update latest tag - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-packages" - prerelease: false - title: "Latest starter and migration packages" - files: packages/* diff --git a/.github/workflows/release-packages-tags.yml b/.github/workflows/release-packages-tags.yml deleted file mode 100644 index c256222..0000000 --- a/.github/workflows/release-packages-tags.yml +++ /dev/null @@ -1,73 +0,0 @@ -# This workflow only meant for the source mod you shouldn't bring it into your own project - -name: Release starter and migration packages - -on: - push: - tags: - - '*' - -jobs: - zip-and-release-packages: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set release version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Prepare release folder - run: | - mkdir packages - - - name: Zip starter - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/starter.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages-latest.yml" \ - -x ".github/workflows/toolchain-compatibility.yml" \ - \ - -x "*docs/*" \ - -x "README.md" \ - -x "LICENSE" \ - \ - -x "starter.zip" \ - -x "migration.zip" - - - name: Zip migration - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/migration.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update-version.sh" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages-latest.yml" \ - -x ".github/workflows/release-packages-tags.yml" \ - -x ".github/workflows/toolchain-compatibility.yml" \ - \ - -x "*docs/*" \ - -x "*src/*" \ - -x "LICENSE" \ - -x "README.md" \ - \ - -x "starter.zip" \ - -x "migration.zip" - - - name: Release under current tag - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ env.RELEASE_VERSION }}-packages" - prerelease: false - title: "${{ env.RELEASE_VERSION }} starter and migration packages" - files: packages/* diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml deleted file mode 100644 index 25c354b..0000000 --- a/.github/workflows/release-tags.yml +++ /dev/null @@ -1,45 +0,0 @@ -# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release tagged build - -on: - push: - tags: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set release version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Set up JDK 8 - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'adopt' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Setup the workspace - run: ./gradlew setupCIWorkspace - - - name: Build the mod - run: ./gradlew build - - - name: Release under current tag - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ env.RELEASE_VERSION }}" - prerelease: false - title: "${{ env.RELEASE_VERSION }}" - files: build/libs/*.jar diff --git a/.github/workflows/toolchain-compatibility.yml b/.github/workflows/toolchain-compatibility.yml deleted file mode 100644 index a082bf3..0000000 --- a/.github/workflows/toolchain-compatibility.yml +++ /dev/null @@ -1,43 +0,0 @@ -# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Check if toolchain is applied when using differnt java versions - -on: - pull_request: - branches: [ master, main ] - -jobs: - check-compatibility-with-java-11: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Setup the workspace - run: ./gradlew setupCIWorkspace - - - name: Build the mod - run: ./gradlew build - - - name: Run server for 1 minute - run: | - mkdir run - echo "eula=true" > run/eula.txt - timeout 10 ./gradlew runServer || true - - - name: Test no crashes happend - run: | - chmod +x .github/scripts/test-no-crash-reports.sh - .github/scripts/test-no-crash-reports.sh diff --git a/docs/FAQ.md b/docs/FAQ.md deleted file mode 100644 index d5c950d..0000000 --- a/docs/FAQ.md +++ /dev/null @@ -1,13 +0,0 @@ -# Things we cannot protect you from (yet) - -### Select an mcp conf dir for the deobfuscator - -You may or may not run into this popup. For now, the only solution is to point the deopfuscator into the right direction. - -![](http://i.imgur.com/gzBMLrr.png) - -Solution: Point it to `~/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/conf`. On Windows, please use `%USERPROFILE%/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/conf`. - -### Could not find :forgeBin:1.7.10-10.13.4.1614-1.7.10 - -Run the gradle task `setupDecompWorkspace`. \ No newline at end of file diff --git a/docs/migration.md b/docs/migration.md deleted file mode 100644 index e8597da..0000000 --- a/docs/migration.md +++ /dev/null @@ -1,22 +0,0 @@ -# Migration guides - -## Generic migration -Migration for the typical mod which doesn't use anything special but Minecraft forge and some library dependencies. -For core plugin, Mixins, shadowing, access transformers, ASM or etc. you'll need to do some extra steps. -If they are missing in this document - we will gladly receive your suggestions/contribution. - -1. Copy and replace all files from [template](https://github.com/SinTh0r4s/ExampleMod1.7.10/releases/download/latest-packages/migration.zip) to your repository, but `build.gradle` -2. Copy all repositories from your `build.gradle(.kts)` to `repositories.gradle` -3. Copy all dependencies from your `build.gradle(.kts)` to `dependecies.gradle` -4. replace your `build.gradle(.kts)` with `build.gradle` from template. In case you have written some custom tasks/configurations not present in the template - move them into `addon.gradle`. It will automatically be integrated if present. -5. Adapt `gradle.properties` to your mod -6. Ensure `src/main/resources/mcmod.info` contains `${modId}`, `${modName}`. `${modVersion}` and `${minecraftVersion}` -7. Re-import the project to your IDE (e.g. restart with clean caches in IntelliJ IDEA) -8. Run `./gradlew clean setupDecompWorkspace` - -## Mixin configuration -For the reference checkout the [example mixin configuration branch](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins) of the template. - -1. Extract mixins package and plugin configuration from `mixins.yourModId.json` to `gradle.properties` -2. Implement MixinPlugin according to example from the reference -3. Remove mixins.mymodid.json diff --git a/docs/porting.md b/docs/porting.md deleted file mode 100644 index 28de4af..0000000 --- a/docs/porting.md +++ /dev/null @@ -1,56 +0,0 @@ -# Porting guidelines - -This is a list of steps which should help you on your probably not so easy journey of porting some mod: - -### 1. Setting up repository and build system -1. Checkout any information in mod REAMDE/Wiki/Docs to find out if there are any special tasks/configs that need to be applied to the build -2. Fork original repository to preserve commit history -3. Apply build migration as explained in [migration guidelines](migration.md) on your fork - -### 2. Refining the fork -Try to get rid of dependencies on concrete jars (usually in the `lib` folder) if any present. This way it will be much easier to change (upgrade/downgrade) your project dependencies, when needed. - -Check if they are in maven repository (usually authors put such information in the project readme), if it isn't accessible but project is open source with permissive enough license (e.g., MIT) - you still can publish them yourselves: - 1. Fork the repository - 2. Drop `jitpack.yml` and `.github/workflows/gradle.yml` in project root. You can find this file in this repository root. - 3. Make sure everything builds from console by running `./gradlew clean setupCIWorkspace` - 4. If all is fine/after fixing the errors - make a tag on Github or using console, this should trigger Github build hook and generate a release - 4. Lookup forked repository on `https://jitpack.io/` - 5. Find your release and click "Get it", which should scroll you down to the example of how to add the dependency (make sure you have jitpack repository in mod you are porting) - 6. Checkout build log beside button you clicked to make sure it succeeds - -Now when you are sure dependency is available in maven repository - just add it as a normal gradle dependency in `dependencies.gradle`. - -If there is not online dependency available, you may upload it as a jar to jitpack, see [jitpack single file publishing thread](https://gist.github.com/jitpack-io/f928a858aa5da08ad9d9662f982da983). Please ensure, that you have the rights to do so! - -There may also be a case where mods depend on another mods - then you'll need to port any dependencies first. (Yay, dependency hell! :D) - -### 3. Preparing for porting -Try to build the project and see check what types of errors are you getting. Generally, there should be 2 types of errors you encounter: - - Missing references to packages/classes/methods/fields/parameters. Things get renamed, moved, restructured, removed or even not yet exist. That's the straightforward part - you'll need to adjust references and way things are invoked. - In case of missing things, you'll either need to implement something that's imitates missing parts or resign from some functionality - - Build related errors (e.g., something that is a part of the mod in never versions previously was an external library - you'll need to add it as a dependencies) - -Fix all build related errors (so build system won't get in your way) - -### 4. Porting the mod -After all these preparations nothing should be in the way of porting the mod, the only thing left is the actual code to change, which probably is a most tedious part of this process. - -Good approach is to start working with smaller things first, building up your confidence in how the mod works and gradually approaching more complex stuff, here is a general algorithm: - 1. Begin with fixing moved/renamed things by deleting all bad imports and with help of the IDE re-import equivalents if present. - Intelij IDEA has settings for unambiguous auto-import and import optimization on the fly, which can greatly speedup the process. Just pay attention to what is actually imported. - 2. Remove all nonworking code which is not easily fixable (e.g., class only introduced in newer forge) and provide stubs in its place. - For example, replace reference to method of non existing class with your method in your class, it can have an empty body and mocked return so the code can compile and run without issues. - Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have a built in TODO browser). - 3. Build the project and attempt to run it - 4. If there were any critical errors which cause Minecraft to crash or mod to not work - try fixing them first, so you can test your changes - 5. Start fixing small things, ones that you think you have most chances to fix and work your way up - 6. If any there is any feature that is not worth it's time or you simply don't know how to do it - consider dropping it entirely and open an issue in your repository where you'll explain your findings and blockers. - Maybe somebody with greater knowledge/more time/motivation will try to take bite at it. -9. Fix bugs you've introduced when porting. - It is uncommon for mods to have lots of workarounds and hidden connections. - You'll need to test things and check if they work as intended (gl;hf ;p) - -### 5. Final words - -If after reading this, you are not discouraged and still want to port it - good luck porting it! You'll definitively need it.