forked from UltimateBoomer/mc-smoothboot
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update to 1.20.6 (& small gradle fixes) (#17)
* feat: update to 1.20.6 * fix: small improvements to gradle buildscript this notably fixes all deprecation warnings, and just reorganizes the file to be more "up-to-date" and define stuff the recommended way (most stuff is taken from fabric's mod template) also removes the unused maven publishing plugin :D * chore: update build action to java 21
- Loading branch information
Showing
9 changed files
with
74 additions
and
75 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
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,73 +1,53 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.4-SNAPSHOT' | ||
id 'maven-publish' | ||
id 'fabric-loom' version '1.6-SNAPSHOT' | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
archivesBaseName = "${project.mod_id}-fabric" | ||
version = "${project.minecraft_version}-${project.mod_version}" | ||
group = project.maven_group | ||
|
||
repositories { | ||
maven { url "https://maven.terraformersmc.com" } | ||
maven { url "https://maven.terraformersmc.com" } | ||
} | ||
|
||
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}" | ||
//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}" | ||
|
||
// Fabric API. This is technically optional, but you probably want it anyway. | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
|
||
// 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 "com.terraformersmc:modmenu:${project.mod_menu_version}" | ||
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
inputs.property "version", project.version | ||
filteringCharset "UTF-8" | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17. | ||
it.options.release = 17 | ||
|
||
base { | ||
archivesName = "${project.mod_id}-fabric" | ||
} | ||
|
||
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 | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.archivesBaseName}"} | ||
} | ||
withSourcesJar() | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
} | ||
} | ||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = "UTF-8" | ||
} | ||
|
||
// 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. | ||
} | ||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}" } | ||
} | ||
} |
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
Binary file not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
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
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,6 +1,5 @@ | ||
pluginManagement { | ||
repositories { | ||
jcenter() | ||
maven { | ||
name = 'Fabric' | ||
url = 'https://maven.fabricmc.net/' | ||
|
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