quilt-template-mod/build.gradle

106 lines
3.6 KiB
Groovy
Raw Normal View History

2022-04-20 17:09:40 +00:00
plugins {
id 'maven-publish'
alias libs.plugins.quilt.loom
2022-04-20 17:09:40 +00:00
}
2023-08-12 18:47:26 +00:00
base {
archivesName = project.archives_base_name
}
2023-06-05 02:11:31 +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
}
2023-09-25 20:47:51 +00:00
loom {
2023-10-03 04:15:46 +00:00
// Loom and Loader both use this block in order to gather more information about your mod.
2023-09-25 20:47:51 +00:00
mods {
2023-10-03 04:15:46 +00:00
// This should match your mod id.
2023-09-25 20:47:51 +00:00
"example_mod" {
// Tell Loom about each source set used by your mod here. This ensures that your mod's classes are properly transformed by Loader.
sourceSet("main")
// If you shade (directly include classes, not JiJ) a dependency into your mod, include it here using one of these methods:
2023-10-03 04:15:46 +00:00
// dependency("com.example.shadowedmod:1.2.3")
// configuration("exampleShadedConfigurationName")
2023-09-25 20:47:51 +00:00
}
}
}
2023-10-03 04:15:46 +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 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 19:02:00 +00:00
mappings loom.layered {
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings()
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-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 {
2024-01-28 04:21:48 +00:00
inputs.properties 'version': version, 'group': project.group
2022-04-20 17:09:40 +00:00
filesMatching('quilt.mod.json') {
2024-01-28 04:21:48 +00:00
expand 'version': version, 'group': project.group
2022-04-20 17:09:40 +00:00
}
}
tasks.withType(JavaCompile).configureEach {
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
}
// 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 {
from('LICENSE') {
2023-06-05 02:11:31 +00:00
rename { "${it}_${base.archivesName.get()}" }
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
}
}