Skip to content

Commit

Permalink
clean up build and fix metadata
Browse files Browse the repository at this point in the history
hopefully don't break anything don't murder me
  • Loading branch information
sisby-folk committed Jul 25, 2024
1 parent 016d9d1 commit dc8950f
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 92 deletions.
105 changes: 39 additions & 66 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
id "maven-publish"
alias libs.plugins.loom
}

version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

loom {
accessWidenerPath = file("src/main/resources/fireblanket.aw")
}
version = "$project.baseVersion+$project.branch"
archivesBaseName = "fireblanket"
group = "net.modfest"

repositories {
maven {
url "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven {
url "https://maven.enginehub.org/repo/"
}
maven { url "https://api.modrinth.com/maven" }
maven { url "https://maven.enginehub.org/repo/" }
mavenCentral()
}

Expand All @@ -32,45 +20,45 @@ configurations {
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "maven.modrinth:sodium:mc1.21-0.5.9"

modImplementation "io.netty.incubator:netty-incubator-transport-classes-io_uring:0.0.15.Final"
modImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.15.Final:linux-x86_64"
modImplementation "com.github.luben:zstd-jni:1.5.5-5"

modImplementation "com.sk89q.worldedit:worldedit-core:7.3.3"
modImplementation "com.sk89q.worldedit:worldedit-fabric-mc1.21:7.4.0-SNAPSHOT"
minecraft libs.mc
mappings variantOf(libs.yarn) { classifier "v2" }
modImplementation libs.fl
modImplementation libs.fapi
modImplementation libs.sodium

modImplementation libs.nettyIoUringClasses
modImplementation variantOf(libs.nettyIoUringNative) { classifier "linux-x86_64" }
modImplementation libs.zstd

shade("io.netty.incubator:netty-incubator-transport-classes-io_uring:0.0.15.Final") { transitive = false }
shade("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.15.Final:linux-x86_64") { transitive = false }
shade("com.github.luben:zstd-jni:1.5.5-5") { transitive = false }
modImplementation libs.worldeditCore
modImplementation libs.worldeditFabric

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
shade(libs.nettyIoUringClasses) { transitive = false }
shade(variantOf(libs.nettyIoUringNative) { classifier "linux-x86_64" }) { transitive = false }
shade(libs.zstd) { transitive = false }
}

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

filesMatching("fabric.mod.json") {
expand "version": project.version
}
final Map<String, String> map = [
"version": version.toString(),
"mc" : libs.versions.mc.get(),
"fl" : libs.versions.fl.get(),
"fapi" : libs.versions.fapi.get()
]

inputs.properties(map)
filesMatching("*.mod.json") { expand(map) }
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 21
}

loom {
accessWidenerPath = file("src/main/resources/fireblanket.aw")
}

sourceSets {
dummy {
compileClasspath += sourceSets.main.compileClasspath
Expand All @@ -80,15 +68,9 @@ sourceSets {
}
}


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()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand All @@ -105,19 +87,10 @@ jar {
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
24 changes: 9 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Gradle Properties
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11

org.gradle.caching.debug=false
org.gradle.configureondemand=true
# Enable advanced multi-module optimizations (share tiny-remaper instance between projects)
fabric.loom.multiProjectOptimisation=true
# Mod Properties
mod_version=0.5.4
maven_group=net.modfest
archives_base_name=fireblanket

# Dependencies
fabric_version=0.100.4+1.21
baseVersion = 0.5.4
branch = 1.21
31 changes: 31 additions & 0 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[versions]
loom = "1.7.+"

mc = "1.21"
fl = "0.15.11"
yarn = "1.21+build.9"
fapi = "0.100.7+1.21"

nettyIoUring = "0.0.15.Final"
zstd = "1.5.5-5"

sodium = "mc1.21-0.5.9"
worldeditCore = "7.3.3"
worldeditFabric = "7.4.0-SNAPSHOT"

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }

[libraries]
mc = { group = "mojang", name = "minecraft", version.ref = "mc" }
fl = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fl" }
yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" }
fapi = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fapi" }

nettyIoUringClasses = { group = "io.netty.incubator", name = "netty-incubator-transport-classes-io_uring", version.ref = "nettyIoUring" }
nettyIoUringNative = { group = "io.netty.incubator", name = "netty-incubator-transport-native-io_uring", version.ref = "nettyIoUring" }
zstd = { group = "com.github.luben", name = "zstd-jni", version.ref = "zstd" }

sodium = { group = "maven.modrinth", name = "sodium", version.ref = "sodium" }
worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldeditCore" }
worldeditFabric = { group = "com.sk89q.worldedit", name = "worldedit-fabric-mc1.21", version.ref = "worldeditFabric" }
16 changes: 10 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
maven { url 'https://maven.fabricmc.net/' }
gradlePluginPortal()
}
}
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
}
Binary file added src/main/resources/assets/fireblanket/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
"id": "fireblanket",
"version": "${version}",
"name": "Fireblanket",
"description": "Performance and bugfixing utilities for ModFest events.",
"description": "Performance, bugfixes, and utilities for ModFest events.",
"authors": [
"jaskarth",
"unascribed"
],
"contributors": [
"Patbox",
"IThundxr"
],
"license": "AGPL-3.0-or-later",
"icon": "assets/fireblanket/icon.png",
"environment": "*",
"contact": {
"homepage": "https://github.com/ModFest/fireblanket",
"issues": "https://github.com/ModFest/fireblanket/issues",
"sources": "https://github.com/ModFest/fireblanket"
},
"entrypoints": {
"main": [ "net.modfest.fireblanket.Fireblanket" ],
"client": [ "net.modfest.fireblanket.FireblanketClient" ]
},
"mixins": [ "fireblanket.mixins.json" ],
"accessWidener": "fireblanket.aw",
"depends": {
"minecraft": "~1.21",
"java": ">=17",
"fabric-api": "*"
"minecraft": ">=${mc}",
"fabricloader": ">=${fl}",
"fabric-api": ">=${fapi}"
}
}

0 comments on commit dc8950f

Please sign in to comment.