generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b00269e
commit f0ca8b5
Showing
4 changed files
with
114 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,124 @@ | ||
plugins { | ||
id 'fabric-loom' version '0.11-SNAPSHOT' | ||
id 'maven-publish' | ||
id "dev.architectury.loom" version "1.3-SNAPSHOT" | ||
id "maven-publish" | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
base { | ||
archivesName = project.archives_base_name | ||
} | ||
|
||
archivesBaseName = project.archives_base_name | ||
version = project.mod_version | ||
group = project.maven_group | ||
|
||
repositories { | ||
flatDir { | ||
dirs 'libs' | ||
} | ||
java { | ||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
loom { | ||
// use this if you are using the official mojang mappings | ||
// and want loom to stop warning you about their license | ||
silentMojangMappingsLicense() | ||
|
||
// since loom 0.10, you are **required** to use the | ||
// "forge" block to configure forge-specific features, | ||
// such as the mixinConfigs array or datagen | ||
forge { | ||
// specify the mixin configs used in this mod | ||
// this will be added to the jar manifest as well! | ||
mixinConfigs = [ | ||
"holographic_renders.mixins.json" | ||
] | ||
|
||
// missing access transformers? | ||
// don't worry, you can still use them! | ||
// note that your AT *MUST* be located at | ||
// src/main/resources/META-INF/accesstransformer.cfg | ||
// to work as there is currently no config option to change this. | ||
// also, any names used in your access transformer will need to be | ||
// in SRG mapped ("func_" / "field_" with MCP class names) to work! | ||
// (both of these things may be subject to change in the future) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url 'https://jitpack.io' } | ||
maven { | ||
name = "CottonMC" | ||
url = "https://server.bbkr.space/artifactory/libs-release" | ||
} | ||
mavenCentral() | ||
maven { url 'https://jitpack.io' } | ||
maven { | ||
name = "CottonMC" | ||
url = "https://server.bbkr.space/artifactory/libs-release" | ||
} | ||
} | ||
|
||
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}" | ||
// to change the versions see the gradle.properties file | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
forge "net.minecraftforge:forge:${project.forge_version}" | ||
|
||
modImplementation "com.github.Mysticpasta1:worldmesher:${project.worldmesher_version}" | ||
include "com.github.Mysticpasta1:worldmesher:${project.worldmesher_version}" | ||
modImplementation "com.github.Mysticpasta1:worldmesher:${project.worldmesher_version}" | ||
include "com.github.Mysticpasta1:worldmesher:${project.worldmesher_version}" | ||
|
||
modImplementation include("io.github.cottonmc:LibGui:8.1.0+1.20.1") | ||
modImplementation include("io.github.cottonmc:LibGui:8.1.0+1.20.1") | ||
|
||
implementation 'com.madgag:animated-gif-lib:1.4' | ||
include 'com.madgag:animated-gif-lib:1.4' | ||
implementation 'com.madgag:animated-gif-lib:1.4' | ||
include 'com.madgag:animated-gif-lib:1.4' | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
// define properties that can be used during resource processing | ||
inputs.property "version", project.version | ||
|
||
// this will replace the property "${version}" in your mods.toml | ||
// with the version you've defined in your gradle.properties | ||
filesMatching("META-INF/mods.toml") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
// ensure that the encoding is set to UTF-8, no matter what the system default is | ||
// this 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" | ||
|
||
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too | ||
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. | ||
// We'll use that if it's available, but otherwise we'll use the older option. | ||
def targetVersion = 17 | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
it.options.release = targetVersion | ||
} | ||
tasks.withType(JavaCompile) { | ||
// ensure that the encoding is set to UTF-8, no matter what the system default is | ||
// this 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. | ||
options.encoding = "UTF-8" | ||
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() | ||
// 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}"} | ||
} | ||
// add some additional metadata to the jar manifest | ||
manifest { | ||
attributes([ | ||
"Specification-Title" : project.mod_id, | ||
"Specification-Vendor" : project.mod_author, | ||
"Specification-Version" : "1", | ||
"Implementation-Title" : project.name, | ||
"Implementation-Version" : version, | ||
"Implementation-Vendor" : project.mod_author, | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
} | ||
|
||
// 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) { | ||
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. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
pluginManagement { | ||
// when using additional gradle plugins like shadow, | ||
// add their repositories to this list! | ||
repositories { | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
} | ||
maven { url "https://maven.fabricmc.net/" } | ||
maven { url "https://maven.architectury.dev/" } | ||
maven { url "https://files.minecraftforge.net/maven/" } | ||
gradlePluginPortal() | ||
} | ||
} |