-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
96 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import net.fabricmc.loom.api.LoomGradleExtensionAPI | ||
|
||
plugins { | ||
id("fabric-loom") version "1.5.+" | ||
} | ||
|
||
version = "mod_version"() | ||
group = "maven_group"() | ||
base.archivesName.set("archives_base_name"()) | ||
|
||
repositories { | ||
maven("https://maven.quiltmc.org/repository/release") // Quilt Mappings | ||
maven("https://maven.parchmentmc.org") // Parchment mappings | ||
maven("https://api.modrinth.com/maven") // Create Deco | ||
maven("https://mvn.devos.one/snapshots/") // Create, Porting Lib, Forge Tags, Milk Lib, Registrate | ||
maven("https://mvn.devos.one/releases/") // Porting Lib Releases | ||
maven("https://raw.githubusercontent.com/Fuzss/modresources/main/maven/") // Forge Config API Port | ||
maven("https://maven.jamieswhiteshirt.com/libs-release") // Reach Entity Attributes | ||
maven("https://jitpack.io/") // Fabric ASM | ||
maven("https://maven.tterrag.com/") // Flywheel | ||
} | ||
|
||
dependencies { | ||
"minecraft"("com.mojang:minecraft:${"minecraft_version"()}") | ||
|
||
val loom = project.extensions.getByType<LoomGradleExtensionAPI>() | ||
mappings(loom.layered { | ||
mappings("org.quiltmc:quilt-mappings:${"minecraft_version"()}+build.${"qm_version"()}:intermediary-v2") | ||
parchment("org.parchmentmc.data:parchment-${"minecraft_version"()}:${"parchment_version"()}@zip") | ||
officialMojangMappings { nameSyntheticMembers = false } | ||
}) | ||
|
||
modImplementation("net.fabricmc:fabric-loader:${"fabric_loader_version"()}") | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:${"fabric_api_version"()}") | ||
|
||
modImplementation("com.simibubi.create:create-fabric-${"minecraft_version"()}:${"create_version"()}") | ||
|
||
modImplementation("maven.modrinth:create-deco:2.0.1-1.20.1-fabric") | ||
} | ||
|
||
tasks.processResources { | ||
// set up properties for filling into metadata | ||
val properties = mapOf( | ||
"version" to version, | ||
"fabric_loader_version" to "fabric_loader_version"(), | ||
"fabric_api_version" to "fabric_api_version"(), | ||
"minecraft_version" to "minecraft_version"(), | ||
) | ||
|
||
inputs.properties(properties) | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand(properties) | ||
} | ||
} | ||
|
||
val targetJavaVersion = 17 | ||
tasks.withType<JavaCompile>().configureEach { | ||
options.encoding = "UTF-8" | ||
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { | ||
options.release.set(targetJavaVersion) | ||
} | ||
} | ||
|
||
java { | ||
val javaVersion = JavaVersion.toVersion(targetJavaVersion) | ||
if (JavaVersion.current() < javaVersion) { | ||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) | ||
} | ||
withSourcesJar() | ||
} | ||
|
||
tasks.jar { | ||
from("LICENSE") { | ||
rename { "${it}_${base.archivesName}"} | ||
} | ||
} | ||
|
||
operator fun String.invoke(): String { | ||
return rootProject.ext[this] as? String | ||
?: throw IllegalStateException("Property $this is not defined") | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
version=$(grep 'mod_version = ' "./gradle.properties" | cut -d'=' -f2 | tr -d ' ') | ||
|
||
git tag -s -a v"$version" -m "$1" | ||
|
||
git push origin v"$version" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pluginManagement { | ||
repositories { | ||
maven("https://maven.fabricmc.net/") | ||
gradlePluginPortal() | ||
} | ||
} |