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