Skip to content

Commit

Permalink
stop bundling dependencies, bump version number, set compile target t…
Browse files Browse the repository at this point in the history
…o 1.21-pre1
  • Loading branch information
CodeF53 committed May 30, 2024
1 parent 79e7af5 commit 719ebd2
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 87 deletions.
135 changes: 63 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -11,103 +11,94 @@ version = project.mod_version
group = project.maven_group

loom {
accessWidenerPath = file("src/main/resources/horsebuff.accesswidener")
accessWidenerPath = file("src/main/resources/horsebuff.accesswidener")
}

configurations {
modIncludeImplementation
modIncludeImplementation

include.extendsFrom modIncludeImplementation
modImplementation.extendsFrom modIncludeImplementation
include.extendsFrom modIncludeImplementation
modImplementation.extendsFrom modIncludeImplementation
}

repositories {
// Cloth Config
maven { url "https://maven.shedaniel.me/" }
// Cloth Config
maven { url "https://maven.shedaniel.me/" }

// Mod Menu
maven { url "https://maven.terraformersmc.com/" }
// Mod Menu
maven { url "https://maven.terraformersmc.com/" }

// Mixin Extras
maven { url 'https://jitpack.io' }
// Mixin Extras
maven { url 'https://jitpack.io' }
}

dependencies {
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
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modIncludeImplementation(fabricApi.module("fabric-api-base", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-registry-sync-v0", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-key-binding-api-v1", project.fabric_version))

// Cloth Config
modIncludeImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}"){
exclude(group: "net.fabricmc.fabric-api")
}
// Cloth devs wont update fabric api, so you cant use it certain versions without excluding it's fabric api
// but because you excluded its instance of fabric api, you need to re-add the bits it uses
modIncludeImplementation(fabricApi.module("fabric-screen-api-v1", project.fabric_version))
modIncludeImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_version))

// Mod Menu
modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}")

// Mixin Extras
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))
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
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Cloth Config
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

// Mod Menu
modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}")

// Mixin Extras
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))
}

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

filesMatching("fabric.mod.json") {
expand "version": project.version
}
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

tasks.withType(JavaCompile).configureEach {
// set encode to UTF-8, fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
// set encode to UTF-8, fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

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

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// 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.
}
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// 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.
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=24w21b
yarn_mappings=24w21b+build.8
minecraft_version=1.21-pre1
yarn_mappings=1.21-pre1+build.3
loader_version=0.15.11
# Mod Properties
mod_version=2.1.6
mod_version=2.1.7
maven_group=com.HorseBuff
archives_base_name=HorseBuff
# Dependencies
fabric_version=0.99.1+1.21
fabric_version=0.99.4+1.21
cloth_config_version=14.0.126
mod_menu_version=10.0.0-beta.1
mixinextras_version=0.3.5
28 changes: 17 additions & 11 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"schemaVersion": 1,
"id": "horsebuff",
"version": "${version}",

"accessWidener" : "horsebuff.accesswidener",

"accessWidener": "horsebuff.accesswidener",
"name": "HorseBuff",
"description": "Makes Horses better by removing stupid things",
"authors": [
Expand All @@ -14,23 +12,31 @@
"homepage": "https://modrinth.com/mod/horsebuff",
"sources": "https://github.com/CodeF53/Horse-Buff"
},

"license": "CC BY-NC-SA",
"icon": "assets/horsebuff/icon.png",

"environment": "*",
"entrypoints": {
"main": [ "net.F53.HorseBuff.HorseBuffInit" ],
"client": [ "net.F53.HorseBuff.ClientInit" ],
"modmenu": [ "net.F53.HorseBuff.config.ModMenuIntegration" ]
"main": [
"net.F53.HorseBuff.HorseBuffInit"
],
"client": [
"net.F53.HorseBuff.ClientInit"
],
"modmenu": [
"net.F53.HorseBuff.config.ModMenuIntegration"
]
},
"mixins": [
"horsebuff.mixins.json"
],

"depends": {
"fabricloader": ">=0.15.11",
"minecraft": ">=1.20.6",
"java": ">=17"
"minecraft": ">=1.21-",
"java": ">=17",
"fabric-api": "*",
"cloth-config": "*"
},
"suggests": {
"modmenu": "*"
}
}

0 comments on commit 719ebd2

Please sign in to comment.