Skip to content

Commit

Permalink
Finish rebranding to QuickBench, setup publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampflower committed Sep 23, 2023
1 parent 44d916e commit 9e48917
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 50 deletions.
74 changes: 53 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
alias(libs.plugins.loom)
alias(libs.plugins.minotaur)
alias(libs.plugins.cursegradle)
id 'maven-publish'
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}

version = project.minecraft_version + "-" + project.mod_version
final isPublish = System.getenv("GITHUB_EVENT_NAME") == "release"
final isRelease = System.getenv("BUILD_RELEASE")?.toBoolean() ?: false
final isActions = System.getenv("GITHUB_ACTIONS")?.toBoolean() ?: false
final baseVersion = "$projectVersion+mc.${libs.versions.minecraft.version.get()}"
version = isRelease ? baseVersion :
isActions ? "$baseVersion-build.${System.getenv("GITHUB_RUN_NUMBER")}-commit.${System.getenv("GITHUB_SHA").substring(0, 7)}-branch.${System.getenv("GITHUB_REF")?.substring(11)?.replace('/', '.') ?: "unknown"}" :
"$baseVersion-build.local"
group = project.maven_group

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
minecraft(libs.minecraft)
mappings(loom.officialMojangMappings())
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

//modRuntime "diggusmaximus:diggusmaximus:1.3.1-1.16"

// Fabric API. This is technically optional, but you probably want it anyway.
compileOnly "com.google.code.findbugs:jsr305:+"

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
modImplementation(libs.fabric.loader)
compileOnly(libs.bundles.compile)
}

processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
expand "version": project.version,
"java": java.targetCompatibility.majorVersion,
"minecraftRequired": libs.versions.minecraft.required.get()
}
}

Expand All @@ -39,13 +42,6 @@ tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
Expand All @@ -68,3 +64,39 @@ publishing {
// retrieving dependencies.
}
}

import java.nio.charset.StandardCharsets

final ref = System.getenv("GITHUB_REF")
final String _changelog = System.getenv("CHANGELOG") ?:
(ref != null && ref.startsWith("refs/tags/")) ?
"You may view the changelog at https://github.com/Modflower/music-moods/releases/tag/${URLEncoder.encode(ref.substring(10), StandardCharsets.UTF_8)}" :
"No changelog is available. Perhaps poke at https://github.com/Modflower/music-moods for a changelog?"

final type = System.getenv("RELEASE_OVERRIDE") ?:
projectVersion?.contains("alpha") ? "alpha" :
!isRelease || projectVersion.contains('-') ? "beta" :
"release"

final minecraftCompatible = libs.versions.minecraft.compatible.get().split(",").toList()

curseforge {
project {
apiKey = System.getenv("CURSEFORGE_TOKEN")
id = curseforgeId
changelog = _changelog
releaseType = type
gameVersionStrings.addAll(minecraftCompatible)
mainArtifact(remapJar)
}
}

modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(modrinthId)
versionType.set(type)
changelog.set(_changelog)
uploadFile.set(tasks.remapJar)
gameVersions.set(minecraftCompatible)
loaders.addAll("fabric", "quilt")
}
10 changes: 4 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.2
loader_version=0.14.10

# Mod Properties
mod_version=3
projectVersion=3
maven_group=gay.ampflower.mod

curseforgeId=914551
modrinthId=v2yISwb0
34 changes: 34 additions & 0 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[versions]

# Minecraft
minecraft_version = "1.19.2"
minecraft_required = "1.19"
minecraft_compatible = "1.19,1.19.1,1.19.2"

fabric_loader = "0.14.21"

# Libraries
annotations = "24.0.1"

# Plugins
loom = "1.+"
minotaur = "2.+"
cursegradle = "1.4.0"

[libraries]
# Minecraft
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft_version" }
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }

# Libraries
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }

[bundles]
compile = ["annotations"]
mod_dependency = []
mod_runtime = []

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }
cursegradle = { id = "com.matthewprenger.cursegradle", version.ref = "cursegradle" }
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ pluginManagement {
}
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
}

rootProject.name = "quickbench"
3 changes: 1 addition & 2 deletions src/main/java/tfar/fastbench/mixin/CraftingMenuMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
Expand All @@ -41,8 +42,6 @@
import tfar.fastbench.MixinHooks;
import tfar.fastbench.interfaces.CraftingInventoryDuck;

import javax.annotation.Nullable;

@Mixin(CraftingMenu.class)
abstract class CraftingMenuMixin<C extends Container> extends RecipeBookMenu<C> implements CraftingInventoryDuck {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -41,7 +42,6 @@
import tfar.fastbench.MixinHooks;
import tfar.fastbench.interfaces.CraftingInventoryDuck;

import javax.annotation.Nullable;
@Mixin(InventoryMenu.class)
abstract class PlayerContainerMixin extends AbstractContainerMenu implements CraftingInventoryDuck {

Expand Down
Binary file removed src/main/resources/assets/modid/icon.png
Binary file not shown.
Binary file added src/main/resources/assets/quickbench/pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 23 additions & 20 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
{
"schemaVersion": 1,
"id": "fastbench",
"id": "quickbench",
"version": "${version}",

"name": "FastBench",
"name": "QuickBench",
"description": "Optimizations to the vanilla crafting table",
"authors": [
"Tfarecnim"
"Ampflower",
"Tfarecnim",
"Shadows-of-Fire"
],
"provides": [
"fastbench"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"homepage": "https://mod.ampflower.gay/QuickBench",
"sources": "https://github.com/Modflower/QuickBench",
"issues": "https://github.com/Modflower/QuickBench/issues",
"discord": "https://discord.gg/EmPS9y9"
},

"license": "CC0-1.0",

"license": "MIT",
"icon": "assets/quickbench/pack.png",
"environment": "*",
"entrypoints": {
"main": [
],
"client": [
]
},
"mixins": [
"fastbench.mixins.json"
"quickbench.mixins.json"
],

"depends": {
"fabricloader": ">=0.7.2"
"fabricloader": ">=0.7.2",
"minecraft": ">=${minecraftRequired}"
},
"suggests": {
"flamingo": "*"
"custom": {
"modmenu": {
"links": {
"modmenu.discord": "https://discord.gg/EmPS9y9"
}
}
}
}
File renamed without changes.

0 comments on commit 9e48917

Please sign in to comment.