quilt-template-mod/build.gradle

89 lines
3 KiB
Groovy
Raw Normal View History

2022-04-20 11:09:40 -06:00
plugins {
id 'maven-publish'
alias libs.plugins.quilt.loom
2022-04-20 11:09:40 -06:00
}
2022-04-20 13:02:00 -06:00
archivesBaseName = project.archives_base_name
version = "${project.version}+${libs.versions.minecraft.get()}"
2022-04-20 13:02:00 -06:00
group = project.maven_group
2022-04-20 11:09:40 -06:00
repositories {
2022-04-20 13:02:00 -06: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 11:09:40 -06:00
}
2022-04-20 14:54:18 -06:00
// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
2022-04-20 13:02:00 -06:00
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
2022-04-20 11:09:40 -06:00
dependencies {
2022-04-20 13:02:00 -06:00
minecraft libs.minecraft
mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
// 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 13:02:00 -06:00
mappings loom.layered {
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings()
2022-04-20 13:02:00 -06:00
}
*/
modImplementation libs.quilt.loader
2022-04-20 11:09:40 -06:00
2022-04-20 13:02:00 -06: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 01:04:01 -06: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 11:09:40 -06:00
}
processResources {
inputs.property 'version', version
2022-04-20 11:09:40 -06:00
filesMatching('quilt.mod.json') {
2022-04-20 16:21:17 -06:00
expand "version": version
2022-04-20 11:09:40 -06:00
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
2022-04-20 13:02:00 -06:00
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
2022-04-20 16:26:28 -06:00
it.options.release = 17
2022-04-20 11:09:40 -06:00
}
java {
2022-04-20 14:01:00 -06:00
// Still required by IDEs such as Eclipse and Visual Studio Code
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2022-04-20 11:09:40 -06: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 13:02:00 -06:00
2022-07-10 14:23:39 -06: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 13:02:00 -06:00
// Uncomment this line to generate them.
// withJavadocJar()
2022-04-20 11:09:40 -06:00
}
// If you plan to use a different file for the license, don't forget to change the file name here!
2022-04-20 11:09:40 -06:00
jar {
from('LICENSE') {
rename { "${it}_${archivesBaseName}" }
2022-04-20 11:09:40 -06:00
}
}
2022-04-20 13:02:00 -06:00
// Configure the maven publication
2022-04-20 11:09:40 -06:00
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
2022-04-20 13:02:00 -06:00
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
2022-04-20 11:09:40 -06:00
repositories {
2022-04-20 13:02:00 -06: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 11:09:40 -06:00
}
}