Advertisement
gravityio

build.gradle

May 1st, 2023
2,096
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 2.90 KB | None | 0 0
  1. plugins {
  2.     id 'fabric-loom' version '1.1-SNAPSHOT'
  3.     id 'maven-publish'
  4. }
  5.  
  6. version = project.mod_version
  7. group = project.maven_group
  8.  
  9. repositories {
  10.     // Add repositories to retrieve artifacts from in here.
  11.     // You should only use this when depending on other mods because
  12.     // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
  13.     // See https://docs.gradle.org/current/userguide/declaring_repositories.html
  14.     // for more information about repositories.
  15.     mavenLocal()
  16.     maven { url = "https://maven.terraformersmc.com/" } // Mod Menu
  17.     maven { url = "https://api.modrinth.com/maven" } // LazyDFU
  18.     maven { url = "https://maven.shedaniel.me/" }
  19.     maven { url = 'https://jitpack.io' }
  20.     maven { url = "https://raw.githubusercontent.com/Aton-Kish/mcmod/maven" }
  21. }
  22.  
  23. dependencies {
  24.     // To change the versions see the gradle.properties file
  25.  
  26.     minecraft("com.mojang:minecraft:${project.minecraft_version}")
  27.     mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
  28.     // Fabric API / Loader
  29.     modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
  30.     modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
  31.  
  32.     // Mod Menu
  33.     modImplementation("com.terraformersmc:modmenu:${project.modmenu_version}")
  34.     // Cloth Config
  35.     modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}")
  36.     // Enchantable Blocks
  37.     modImplementation("me.gravityio:enchantable-blocks:${project.enchantable_blocks_version}")
  38.     include("me.gravityio:enchantable-blocks:${project.enchantable_blocks_version}")
  39.     // Lazy DFU
  40.     modLocalRuntime("maven.modrinth:lazydfu:${project.lazy_dfu_version}")
  41. }
  42.  
  43. base {
  44.     archivesName = project.mod_id
  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.     sourceCompatibility = JavaVersion.VERSION_17
  67.     targetCompatibility = JavaVersion.VERSION_17
  68. }
  69.  
  70. jar {
  71.     from("LICENSE") {
  72.         rename { "${it}_${base.archivesName.get()}"}
  73.     }
  74. }
  75.  
  76. // configure the maven publication
  77. publishing {
  78.     publications {
  79.         mavenJava(MavenPublication) {
  80.             artifactId = project.mod_id
  81.             from components.java
  82.         }
  83.     }
  84.  
  85.     // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  86.     repositories {
  87.         // Add repositories to publish to here.
  88.         // Notice: This block does NOT have the same function as the block in the top level.
  89.         // The repositories here will be used for publishing your artifact, not for
  90.         // retrieving dependencies.
  91.     }
  92. }
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement