Skip to content

Commit

Permalink
[v3.0.0+1.20] organized entrypoints & introduced gametest (#75)
Browse files Browse the repository at this point in the history
* bump deps

* introduced gametest

* renamed reinfshulkerclient to reinfshulker-client

* fixed entrypoints

* added gametest utils

* added gametest testcases

* added gametest phase to workflows

* re-integrated with shulker box tooltip

* fixed fabric.mod.json format

* fixed methods

* fixed styles

* bump mod version to v3.0.0+1.20
  • Loading branch information
Aton-Kish committed Jun 15, 2024
1 parent 0deb042 commit 0286c47
Show file tree
Hide file tree
Showing 22 changed files with 1,998 additions and 30 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ jobs:
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
run: ./gradlew runServerTest build
- name: capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
- name: publish test report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: build/gametest/junit.xml
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: publish
run: ./gradlew publish
run: ./gradlew runServerTest publish
- name: push to mcmod repository
uses: cpina/github-action-push-to-another-repository@main
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: release
run: ./gradlew build curseforge modrinth
run: ./gradlew runServerTest build curseforge modrinth
- name: capture build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
41 changes: 28 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,10 @@ repositories {
// url "https://maven.kyrptonaught.dev"
// }

// // Shulker Box Tooltip
// maven {
// url "https://maven.misterpemodder.com/libs-release"
// }

// // Fabric ASM (Shulker Box Tooltip deps)
// maven {
// url "https://jitpack.io"
// }
// Shulker Box Tooltip
maven {
url "https://maven.misterpemodder.com/libs-release"
}
}

loom {
Expand All @@ -59,6 +54,26 @@ loom {
sourceSet sourceSets.client
}
}

runs {
serverTest {
server()
ideConfigGenerated true
name "Minecraft Server Test"
vmArg "-Dfabric-api.gametest"
vmArg "-Dfabric-api.gametest.report-file=${project.buildDir}/gametest/junit.xml"
vmArg "-Datonkish.reinfshulker.gametest"
runDir "build/gametest"
}

clientTest {
client()
ideConfigGenerated true
name "Minecraft Client Test"
vmArg "-Datonkish.reinfshulker.gametest"
runDir "build/gametest"
}
}
}

dependencies {
Expand All @@ -82,8 +97,8 @@ dependencies {
// // Quick Shulker deps
// modImplementation "net.kyrptonaught:shulkerutils:${project.shulkerutils_version}"

// // Shulker Box Tooltip
// modImplementation "com.misterpemodder:shulkerboxtooltip-fabric:${project.shulker_box_tooltip_version}"
// Shulker Box Tooltip
modImplementation "com.misterpemodder:shulkerboxtooltip-fabric:${project.shulker_box_tooltip_version}"
}

processResources {
Expand Down Expand Up @@ -158,7 +173,7 @@ curseforge {
requiredDependency "fabric-api"
embeddedLibrary "cloth-config"
optionalDependency "modmenu"
// optionalDependency "shulkerboxtooltip"
optionalDependency "shulkerboxtooltip"
// optionalDependency "quick-shulker"
optionalDependency "reinforced-chests"
}
Expand All @@ -183,7 +198,7 @@ modrinth {
required.project "fabric-api"
embedded.project "cloth-config"
optional.project "modmenu"
// optional.project "shulkerboxtooltip"
optional.project "shulkerboxtooltip"
// optional.project "quickshulker"
optional.project "reinforced-chests"
}
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Mod Properties
mod_version=2.6.0+1.20
mod_version=3.0.0+1.20
mod_id=reinfshulker
maven_group=atonkish.reinfshulker
archives_base_name=reinforced-shulker-boxes

# Dependencies
fabric_version=0.97.8+1.20.6
reinforced_core_version=3.1.4+1.20
reinforced_chests_version=2.4.6+1.20
fabric_version=0.100.0+1.20.6
reinforced_core_version=4.0.0+1.20
reinforced_chests_version=3.0.0+1.20
# quick_shulker_version=1.4.0-1.20
# shulker_box_tooltip_version=4.0.8+1.20.4
shulker_box_tooltip_version=4.1.0-alpha.4+1.20.6
# # Quick Shulker deps
# shulkerutils_version=1.0.4-1.19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public void onInitializeReinforcedCoreClient() {
// init Reinforced Shulker Boxes
initializeReinforcedShulkerBoxesClient();

// entrypoint: "reinfshulkerclient"
// entrypoint: "reinfshulker-client"
FabricLoader.getInstance()
.getEntrypoints(ReinforcedShulkerBoxesMod.MOD_ID + "client",
.getEntrypoints(String.format("%s-client", ReinforcedShulkerBoxesMod.MOD_ID),
ReinforcedShulkerBoxesClientModInitializer.class)
.forEach(ReinforcedShulkerBoxesClientModInitializer::onInitializeReinforcedShulkerBoxesClient);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package atonkish.reinfshulker.gametest;

import java.util.ArrayList;
import java.util.Collection;

import net.minecraft.test.CustomTestProvider;
import net.minecraft.test.TestFunction;

import atonkish.reinfshulker.gametest.testcase.AdvancementTests;
import atonkish.reinfshulker.gametest.testcase.CauldronBehaviorTests;
import atonkish.reinfshulker.gametest.testcase.DispenserBehaviorTests;
import atonkish.reinfshulker.gametest.testcase.InventoryTests;
import atonkish.reinfshulker.gametest.testcase.LootTableTests;
import atonkish.reinfshulker.gametest.testcase.OpenTests;
import atonkish.reinfshulker.gametest.testcase.PiglinTests;
import atonkish.reinfshulker.gametest.testcase.PistonBehaviorTests;
import atonkish.reinfshulker.gametest.testcase.RecipeTests;

public class ReinforcedShulkerBoxesModGameTest {
@CustomTestProvider
public Collection<TestFunction> registerTests() {
Collection<TestFunction> testFunctions = new ArrayList<>();

if (System.getProperty(this.getClass().getPackageName()) == null) {
return testFunctions;
}

testFunctions.addAll(AdvancementTests.TEST_FUNCTIONS);
testFunctions.addAll(CauldronBehaviorTests.TEST_FUNCTIONS);
testFunctions.addAll(DispenserBehaviorTests.TEST_FUNCTIONS);
testFunctions.addAll(InventoryTests.TEST_FUNCTIONS);
testFunctions.addAll(LootTableTests.TEST_FUNCTIONS);
testFunctions.addAll(OpenTests.TEST_FUNCTIONS);
testFunctions.addAll(PiglinTests.TEST_FUNCTIONS);
testFunctions.addAll(PistonBehaviorTests.TEST_FUNCTIONS);
testFunctions.addAll(RecipeTests.TEST_FUNCTIONS);

return testFunctions;
}
}
Loading

0 comments on commit 0286c47

Please sign in to comment.