Skip to content

Commit

Permalink
chore: make build; gh actions; clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeblank committed Sep 17, 2024
1 parent d315f5d commit 914458e
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 18 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
java: [
21, # Current Java LTS
]
mod: [
"allium",
"bouquet"
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
Expand All @@ -27,11 +31,10 @@ jobs:
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
- name: build ${{ matrix.mod }}
run: ./gradlew :${{ matrix.mod }}:build
- name: capture ${{ matrix.mod }} build artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
name: ${{ matrix.mod }}
path: ${{ matrix.mod }}/build/libs/
16 changes: 16 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The MIT License (MIT)

Copyright © 2024 hugeblank

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 13 additions & 4 deletions allium/README.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Lua script loader for Java Minecraft.
Currently, only functioning and in development in Fabric, with the intent of supporting Forge/Quilt later on down the
road.

**NOTE**: this repo is only the loader, the Allium API can be found [here](https://github.com/hugeblank/allium-api/).

## Installing
Allium installs just like any other Fabric mod. If you don't know how to do this, [this Tech Insider video](https://www.youtube.com/watch?v=vNz0z1Aht1U) does a
pretty good job of explaining how.
Expand All @@ -28,8 +26,19 @@ these limitations will be resolved before version 1.0.
## Logos
Allium's logos are under the same license as the rest of the project. Feel free to use these in your own project

<img src="logos/icon.png" alt="Allium Icon" height="100"/> <img src="logos/logo.png" alt="Allium Logo" height="100"/>
<img src="logos/banner.png" alt="Powered by Allium" height="100"/>
<img src="allium/logos/icon.png" alt="Allium Icon" height="100"/> <img src="allium/logos/logo.png" alt="Allium Logo" height="100"/>
<img src="allium/logos/banner.png" alt="Powered by Allium" height="100"/>

## Contributing
Allium is broken up into 2 gradle subprojects that each build into their own jars. When making a pull request please
make sure to use the template that corresponds to which project you're contributing to (TODO).

### Allium
Found in the `allium` directory, this is the bare-minimum necessary for a Lua script to be run in the game.

### Bouquet
Found in the `bouquet` directory, this features additional quality of life libraries, as well as frequently used
event hooks into the games logic.

## Too much Allium...
Since 2018 a project under the name Allium has existed. This is being addressed to suppress the Mandela Effect.
Expand Down
2 changes: 1 addition & 1 deletion allium/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2022 hugeblank
Copyright © 2024 hugeblank

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
Expand Down
4 changes: 4 additions & 0 deletions allium/src/main/java/dev/hugeblank/allium/loader/Script.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public Script(Manifest manifest, Path path) {
}
}

public static void reloadAll() {
SCRIPTS.forEach((s, script) -> script.reload());
}

// TODO: Move to Allium API
public void reload() {
destroyAllResources();
Expand Down
2 changes: 1 addition & 1 deletion allium/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "allium",
"version": "${mod_version}",
"version": "${version}",

"name": "Allium Loader",
"description": "Lua Script loader for Minecraft",
Expand Down
2 changes: 0 additions & 2 deletions bouquet/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.brigadier.context.CommandContext;
import dev.hugeblank.allium.Allium;
import dev.hugeblank.allium.loader.Script;
import dev.hugeblank.allium.loader.ScriptExecutor;
import net.minecraft.server.command.ReloadCommand;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -13,6 +14,6 @@
public class ReloadCommandMixin {
@Inject(at = @At("HEAD"), method = "method_13530(Lcom/mojang/brigadier/context/CommandContext;)I")
private static void executes(CommandContext<?> context, CallbackInfoReturnable<Integer> cir) {
Allium.CANDIDATES.forEach(Script::reload);
Script.reloadAll();
}
}
14 changes: 11 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,22 @@ allprojects {
modImplementation(include("org.squiddev", "Cobalt", cobalt))
modImplementation(include("me.basiqueevangelist","enhanced-reflection", enhancedReflections))
}
}

subprojects.forEach {
tasks {
processResources {
inputs.property("version", project.version)
inputs.property("version", it.version)

filesMatching("fabric.mod.json") {
expand(mutableMapOf("version" to project.version))
expand(mutableMapOf("version" to it.version))
}
}

jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
val archivesName = it.base.archivesName.get()
rename { "${it}_${archivesName}" }
}
}
}
Expand Down Expand Up @@ -108,4 +111,9 @@ tasks {
}
}
}

register<GradleBuild>("buildMoonflower") {
group = "build"
tasks = subprojects.map { ":${it.name}:build" }
}
}

0 comments on commit 914458e

Please sign in to comment.