123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- //file:noinspection GradlePackageVersionRange
- plugins {
- id "fabric-loom" version "1.0.+"
- id "io.github.juuxel.loom-quiltflower" version "1.+"
- id "org.quiltmc.quilt-mappings-on-loom" version "4.2.0"
- id "maven-publish"
- }
- loom {
- accessWidenerPath = file("src/main/resources/twilightforest.accesswidener")
- }
- sourceCompatibility = JavaVersion.VERSION_17
- targetCompatibility = JavaVersion.VERSION_17
- java.toolchain.languageVersion = JavaLanguageVersion.of(17)
- archivesBaseName = "${project.mod_id}-fabric-${minecraft_version}"
- version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
- group = project.group_name
- sourceSets.main.resources {
- srcDir "src/generated/resources"
- }
- repositories {
- mavenLocal() // test builds of Porting Lib
- maven { url = "https://cursemaven.com" } // Forge Config API Port
- maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker
- maven { url = "https://maven.shedaniel.me/" } // Cloth Config
- maven { url = "https://maven.wispforest.io" } // TOP
- maven { url = "https://storage.googleapis.com/devan-maven/" }
- maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu, Trinkets
- maven { url = "https://mvn.devos.one/snapshots/" } // Porting Lib, Forge Tags, Tinkers, Mantle
- maven { url = "https://ladysnake.jfrog.io/artifactory/mods" } // Cardinal Components API
- maven { url = "https://maven.parchmentmc.net/" } // Parchment
- maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
- maven {
- url = "https://jitpack.io" // Fabric ASM, Mixin Extras
- content {
- includeGroup("com.github.LlamaLad7")
- includeGroup("com.github.Chocohead")
- }
- }
- }
- dependencies {
- // dev env
- minecraft "com.mojang:minecraft:${project.minecraft_version}"
- mappings loom.officialMojangMappings()
- modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
- modLocalRuntime("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}") { exclude(group: "net.fabricmc.fabric-api") }
- modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") { exclude(group: "net.fabricmc.fabric-api") }
- modLocalRuntime("dev.architectury:architectury-fabric:${project.architectury_version}") { exclude(group: "net.fabricmc.fabric-api") } // for REI
- modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") { exclude(group: "net.fabricmc.fabric-api") }
- modLocalRuntime("maven.modrinth:lazydfu:0.1.2")
- modLocalRuntime("maven.modrinth:suggestion-tweaker:${project.suggestion_tweaker_version}")
- modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") } // for Suggestion Tweaker
- // dependencies
- modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
- modImplementation(include(fabricApi.module("fabric-data-generation-api-v1", project.fabric_version))) // include datagen api since FAPI fatjar doesn't
- modImplementation(include("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version}+${project.minecraft_version}"))
- modImplementation(include("com.jamieswhiteshirt:reach-entity-attributes:${project.reach_entity_attributes_version}"))
- modImplementation(include("curse.maven:forge-config-api-port-fabric-547434:${project.config_api_version}"))
- modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"))
- modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"))
- modImplementation(include("com.github.Chocohead:Fabric-ASM:v2.3"))
- modImplementation(include("me.alphamode:ForgeTags:2.1"))
- modImplementation(include("maven.modrinth:here-be-no-dragons:1.0.0"))
- implementation(include("com.electronwill.night-config:core:3.6.3"))
- implementation(include("com.electronwill.night-config:toml:3.6.3"))
- implementation(include("javax.annotation:javax.annotation-api:1.3.2"))
- implementation(include("com.google.code.findbugs:jsr305:3.0.2"))
- // compat
- modCompileOnly("slimeknights.tconstruct:TConstruct:${project.minecraft_version}-${project.tcon_version}") { exclude(group: "io.github.fabricators_of_create") }
- modImplementation("dev.emi:trinkets:${project.trinkets_version}")
- }
- loom {
- runs {
- datagen {
- client()
- name "Data Generation"
- vmArg "-Dfabric-api.datagen"
- vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
- vmArg "-Dfabric-api.datagen.modid=twilightforest"
- property "twilightforest.data.existingData", file("src/main/resources").absolutePath
- runDir "build/datagen"
- }
- }
- }
- processResources {
- inputs.property "version", project.version
- filesMatching("fabric.mod.json") {
- expand "version": project.version
- }
- }
- tasks.withType(JavaCompile).configureEach {
- it.options.encoding = "UTF-8"
- it.options.release = 17
- }
- java {
- withSourcesJar()
- }
- jar {
- from("LICENSE") {
- rename { "${it}_${project.archivesBaseName}"}
- }
- }
- // configure the maven publication
- publishing {
- publications {
- mavenJava(MavenPublication) {
- from components.java
- }
- }
- // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
- repositories {
- // 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.
- }
- }
|