|
| 1 | +plugins { |
| 2 | + id 'fabric-loom' version '1.1-SNAPSHOT' |
| 3 | + id 'maven-publish' |
| 4 | +} |
| 5 | + |
| 6 | +sourceCompatibility = JavaVersion.VERSION_17 |
| 7 | +targetCompatibility = JavaVersion.VERSION_17 |
| 8 | + |
| 9 | +archivesBaseName = project.archives_base_name |
| 10 | +version = project.mod_version |
| 11 | +group = project.maven_group |
| 12 | + |
| 13 | +repositories { |
| 14 | + // Add repositories to retrieve artifacts from in here. |
| 15 | + // You should only use this when depending on other mods because |
| 16 | + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
| 17 | + // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
| 18 | + // for more information about repositories. |
| 19 | + maven { url 'https://maven.wispforest.io' } |
| 20 | + maven { url "https://maven.terraformersmc.com/" } |
| 21 | + maven { url 'https://masa.dy.fi/maven' } |
| 22 | + maven { url = "https://www.cursemaven.com" } |
| 23 | + mavenCentral() |
| 24 | +} |
| 25 | + |
| 26 | +dependencies { |
| 27 | + // To change the versions see the gradle.properties file |
| 28 | + modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" |
| 29 | + minecraft "com.mojang:minecraft:${project.minecraft_version}" |
| 30 | + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
| 31 | + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
| 32 | + modImplementation "blue.endless:jankson:1.1.0" |
| 33 | + modImplementation "fi.dy.masa.malilib:malilib-fabric-${project.malilib_version}" |
| 34 | + modImplementation "curse.maven:litematica-${project.litematica_projectid}:${project.litematica_fileid}" |
| 35 | + |
| 36 | + // Fabric API. This is technically optional, but you probably want it anyway. |
| 37 | + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" |
| 38 | + |
| 39 | + annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}") |
| 40 | + |
| 41 | + // Uncomment the following line to enable the deprecated Fabric API modules. |
| 42 | + // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. |
| 43 | + |
| 44 | + // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" |
| 45 | +} |
| 46 | + |
| 47 | +processResources { |
| 48 | + inputs.property "version", project.version |
| 49 | + |
| 50 | + filesMatching("fabric.mod.json") { |
| 51 | + expand "version": project.version |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +tasks.withType(JavaCompile).configureEach { |
| 56 | + // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. |
| 57 | + it.options.release = 17 |
| 58 | +} |
| 59 | + |
| 60 | +java { |
| 61 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 62 | + // if it is present. |
| 63 | + // If you remove this line, sources will not be generated. |
| 64 | + withSourcesJar() |
| 65 | +} |
| 66 | + |
| 67 | +jar { |
| 68 | + from("LICENSE") { |
| 69 | + rename { "${it}_${project.archivesBaseName}"} |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | +// configure the maven publication |
| 74 | +publishing { |
| 75 | + publications { |
| 76 | + mavenJava(MavenPublication) { |
| 77 | + from components.java |
| 78 | + } |
| 79 | + } |
| 80 | + |
| 81 | + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
| 82 | + repositories { |
| 83 | + // Add repositories to publish to here. |
| 84 | + // Notice: This block does NOT have the same function as the block in the top level. |
| 85 | + // The repositories here will be used for publishing your artifact, not for |
| 86 | + // retrieving dependencies. |
| 87 | + } |
| 88 | +} |
0 commit comments