2022-04-20 17:09:40 +00:00
|
|
|
plugins {
|
|
|
|
id 'maven-publish'
|
2022-04-20 19:02:00 +00:00
|
|
|
alias(libs.plugins.quilt.loom)
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-20 19:02:00 +00:00
|
|
|
archivesBaseName = project.archives_base_name
|
2022-04-20 17:09:40 +00:00
|
|
|
version = project.version
|
2022-04-20 19:02:00 +00:00
|
|
|
group = project.maven_group
|
2022-04-20 17:09:40 +00:00
|
|
|
|
|
|
|
repositories {
|
2022-04-20 19:02:00 +00:00
|
|
|
// Add repositories to retrieve artifacts from in here.
|
|
|
|
// You should only use this when depending on other mods because
|
|
|
|
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
|
|
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
|
|
|
// for more information about repositories.
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-20 20:54:18 +00:00
|
|
|
// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
|
2022-04-20 19:02:00 +00:00
|
|
|
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
|
2022-04-20 17:09:40 +00:00
|
|
|
dependencies {
|
2022-04-20 19:02:00 +00:00
|
|
|
minecraft libs.minecraft
|
|
|
|
mappings loom.layered {
|
|
|
|
addLayer quiltMappings.mappings("org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:v2")
|
2022-04-20 20:53:20 +00:00
|
|
|
// officialMojangMappings() // Uncomment if you want to use Mojang mappings as your primary mappings, falling back on QM for parameters and Javadocs
|
2022-04-20 19:02:00 +00:00
|
|
|
}
|
|
|
|
modImplementation libs.quilt.loader
|
2022-04-20 17:09:40 +00:00
|
|
|
|
2022-04-20 19:02:00 +00:00
|
|
|
// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
|
|
|
|
// Quilted Fabric API will automatically pull in the correct QSL version.
|
|
|
|
modImplementation libs.quilted.fabric.api
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
2022-04-20 19:02:00 +00:00
|
|
|
inputs.property "version", version
|
2022-04-20 17:09:40 +00:00
|
|
|
|
|
|
|
filesMatching('quilt.mod.json') {
|
2022-04-20 22:21:17 +00:00
|
|
|
expand "version": version
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
2022-04-20 19:02:00 +00:00
|
|
|
it.options.encoding = "UTF-8"
|
|
|
|
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
|
2022-04-20 22:26:28 +00:00
|
|
|
it.options.release = 17
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
2022-04-20 20:01:00 +00:00
|
|
|
// Still required by IDEs such as Eclipse and Visual Studio Code
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
2022-04-20 17:09:40 +00:00
|
|
|
// 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()
|
2022-04-20 19:02:00 +00:00
|
|
|
|
|
|
|
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with developement.
|
|
|
|
// Uncomment this line to generate them.
|
|
|
|
// withJavadocJar()
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-20 19:02:00 +00:00
|
|
|
// If you plan to use a different file for the license, don't forget to change the file name here!
|
2022-04-20 17:09:40 +00:00
|
|
|
jar {
|
2022-04-20 19:02:00 +00:00
|
|
|
from("LICENSE") {
|
|
|
|
rename { "${it}_${archivesBaseName}" }
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-20 19:02:00 +00:00
|
|
|
// Configure the maven publication
|
2022-04-20 17:09:40 +00:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-20 19:02:00 +00:00
|
|
|
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
2022-04-20 17:09:40 +00:00
|
|
|
repositories {
|
2022-04-20 19:02:00 +00:00
|
|
|
// 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.
|
2022-04-20 17:09:40 +00:00
|
|
|
}
|
|
|
|
}
|