summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle50
1 files changed, 27 insertions, 23 deletions
diff --git a/build.gradle b/build.gradle
index f807b77..1425a6c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,15 +1,15 @@
plugins {
- id 'fabric-loom' version '0.8-SNAPSHOT'
+ id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}
-sourceCompatibility = JavaVersion.VERSION_16
-targetCompatibility = JavaVersion.VERSION_16
-
-archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
+base {
+ archivesName = project.archives_base_name
+}
+
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
@@ -18,6 +18,18 @@ repositories {
// for more information about repositories.
}
+loom {
+ splitEnvironmentSourceSets()
+
+ mods {
+ "modid" {
+ sourceSet sourceSets.main
+ sourceSet sourceSets.client
+ }
+ }
+
+}
+
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
@@ -26,9 +38,11 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
+
+ // 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.
- // 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 "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
}
processResources {
@@ -40,14 +54,7 @@ processResources {
}
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"
-
- // Minecraft 1.17 (21w19a) upwards uses Java 16.
- it.options.release = 16
+ it.options.release = 17
}
java {
@@ -55,11 +62,14 @@ java {
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
+
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
- rename { "${it}_${project.archivesBaseName}"}
+ rename { "${it}_${project.base.archivesName.get()}"}
}
}
@@ -67,13 +77,7 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
- // add all the jars that should be included when publishing to maven
- artifact(remapJar) {
- builtBy remapJar
- }
- artifact(sourcesJar) {
- builtBy remapSourcesJar
- }
+ from components.java
}
}