1+ plugins {
2+ id ' fabric-loom' version ' 1.9-SNAPSHOT'
3+ id ' maven-publish'
4+ id " org.jetbrains.kotlin.jvm" version " 2.1.0"
5+ }
6+
7+ version = project. mod_version
8+ group = project. maven_group
9+
10+ base {
11+ archivesName = project. archives_base_name
12+ }
13+
14+ repositories {
15+ // Add repositories to retrieve artifacts from in here.
16+ // You should only use this when depending on other mods because
17+ // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
18+ // See https://docs.gradle.org/current/userguide/declaring_repositories.html
19+ // for more information about repositories.
20+ }
21+
22+ dependencies {
23+ // To change the versions see the gradle.properties file
24+ minecraft " com.mojang:minecraft:${ project.minecraft_version} "
25+ mappings loom. officialMojangMappings()
26+ modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
27+
28+ // Fabric API. This is technically optional, but you probably want it anyway.
29+ modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
30+ modImplementation " net.fabricmc:fabric-language-kotlin:${ project.fabric_kotlin_version} "
31+ }
32+
33+ processResources {
34+ inputs. property " version" , project. version
35+
36+ filesMatching(" fabric.mod.json" ) {
37+ expand " version" : project. version
38+ }
39+ }
40+
41+ tasks. withType(JavaCompile ). configureEach {
42+ it. options. release = 21
43+ }
44+
45+ tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). all {
46+ kotlinOptions {
47+ jvmTarget = 21
48+ }
49+ }
50+
51+ java {
52+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
53+ // if it is present.
54+ // If you remove this line, sources will not be generated.
55+ withSourcesJar()
56+
57+ sourceCompatibility = JavaVersion . VERSION_21
58+ targetCompatibility = JavaVersion . VERSION_21
59+ }
60+
61+ jar {
62+ from(" LICENSE" ) {
63+ rename { " ${ it} _${ project.base.archivesName.get()} " }
64+ }
65+ }
66+
67+ // configure the maven publication
68+ publishing {
69+ publications {
70+ create(" mavenJava" , MavenPublication ) {
71+ artifactId = project. archives_base_name
72+ from components. java
73+ }
74+ }
75+
76+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
77+ repositories {
78+ // Add repositories to publish to here.
79+ // Notice: This block does NOT have the same function as the block in the top level.
80+ // The repositories here will be used for publishing your artifact, not for
81+ // retrieving dependencies.
82+ }
83+ }
0 commit comments