2022-04-20 17:09:40 +00:00
plugins {
id 'maven-publish'
2022-08-23 02:08:10 +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-10-14 20:09:02 +00:00
version = "${project.version}+${libs.versions.minecraft.get()}"
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
2022-10-24 22:49:22 +00:00
mappings variantOf ( libs . quilt . mappings ) { classifier 'intermediary-v2' }
2022-10-05 01:20:12 +00:00
// Replace the above line with the block below 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
mappings loom . layered {
2022-10-05 01:20:12 +00:00
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings ( )
2022-04-20 19:02:00 +00:00
}
2022-10-05 01:20:12 +00:00
* /
2022-10-09 19:30:21 +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-06-11 07:04:01 +00:00
// modImplementation libs.bundles.quilted.fabric.api // If you wish to use Fabric API's deprecated modules, you can replace the above line with this one
2022-04-20 17:09:40 +00:00
}
processResources {
2022-10-24 22:49:22 +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-10-24 22:49:22 +00:00
it . options . encoding = 'UTF-8'
2022-04-20 19:02:00 +00:00
// 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
2022-07-10 20:23:39 +00:00
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with development.
2022-04-20 19:02:00 +00:00
// Uncomment this line to generate them.
// withJavadocJar()
2022-04-20 17:09:40 +00:00
}
jar {
2022-10-24 22:51:19 +00:00
filesMatching ( 'LICENSE' ) {
rename '^(LICENSE.*?)(\\..*)?$' , "\$1_${archivesBaseName}\$2"
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
}
}