Unicopia/build.gradle
2024-09-21 21:41:21 +01:00

165 lines
6 KiB
Groovy

buildscript {
dependencies {
classpath 'com.github.dexman545:Outlet:1.6.1'
}
}
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'com.modrinth.minotaur' version '2.+'
id 'org.ajoberstar.reckon' version '0.13.1'
}
apply plugin: 'io.github.dexman545.outlet'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
}
outlet.allowSnapshotsForProject = false
outlet.mcVersionRange = project.minecraft_version_range
group = project.group
description = project.displayname
archivesBaseName = project.name
loom {
mixin.defaultRefmapName = 'unicopia.mixin.refmap.json'
accessWidenerPath = file('src/main/resources/unicopia.aw')
}
fabricApi {
configureDataGeneration {
modId = 'unicopia'
}
}
reckon {
scopeFromProp()
stageFromProp 'beta', 'rc', 'final'
}
repositories {
mavenLocal()
flatDir { dirs 'lib' }
maven { name 'entity-reach-attributes'; url 'https://maven.jamieswhiteshirt.com/libs-release'; content { includeGroup "com.jamieswhiteshirt" } }
maven { name 'trinkets'; url 'https://maven.ladysnake.org/releases' }
maven { name 'mod-menu'; url 'https://maven.terraformersmc.com/' }
maven { name 'minelp-snapshot'; url 'https://repo.minelittlepony-mod.com/maven/snapshot' }
maven { name 'minelp-releases'; url 'https://repo.minelittlepony-mod.com/maven/release' }
maven { name 'TerraformersMC'; url 'https://maven.terraformersmc.com/' }
maven { name 'Nodium'; url 'https://maven.cafeteria.dev/releases/' }
maven { name 'Greenhouse Maven For Farmers delight'; url 'https://maven.greenhouseteam.dev/releases/' }
maven { name 'Porting Lib For Farmers delight'; url = 'https://mvn.devos.one/releases/' }
maven { name 'Modrinth'; url 'https://api.modrinth.com/maven' }
maven { name 'JitPack'; url 'https://jitpack.io'; content { includeGroup "com.github.Virtuoel" } }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi "com.minelittlepony:minelittlepony:${project.minelp_version}"
modApi "com.minelittlepony:kirin:${project.kirin_version}"
include "com.minelittlepony:kirin:${project.kirin_version}"
modApi "com.jamieswhiteshirt:reach-entity-attributes:${project.reach_attributes_version}"
include "com.jamieswhiteshirt:reach-entity-attributes:${project.reach_attributes_version}"
modApi "com.sollace:fabwork:${project.fabwork_version}"
include "com.sollace:fabwork:${project.fabwork_version}"
compileOnly "com.sollace:Romanizer:Romanizer:1.0.2"
include "com.sollace:Romanizer:Romanizer:1.0.2"
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
if (project.use_trinkets == '1') {
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0"
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0"
} else {
modCompileOnly "dev.emi:trinkets-dummy:${project.trinkets_version}"
}
modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}"
include "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}"
modImplementation "me.luligabi:NoIndium:${project.nodium_version}"
include "me.luligabi:NoIndium:${project.nodium_version}"
//modImplementation "vectorwing:FarmersDelight-Refabricated:${project.farmers_delight_version}", {
// exclude group: "net.fabricmc"
//}
if (project.use_pehkui == '1') {
modCompileOnly "maven.modrinth:pehkui:${project.pehkui_version}", { exclude group: "net.fabricmc.fabric-api" }
modCompileOnly "com.github.Virtuoel:KanosConfig:0.4.1", { exclude group: "net.fabricmc.fabric-api" }
}
if (project.use_sodium == '1') {
modCompileOnly "maven.modrinth:indium:${project.indium_version}", { exclude group: "net.fabricmc.fabric-api" }
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}", { exclude group: "net.fabricmc.fabric-api" }
if (project.use_iris == '1') {
modCompileOnly "maven.modrinth:iris:${project.iris_version}", { exclude group: "net.fabricmc.fabric-api" }
modImplementation "org.anarres:jcpp:1.4.14"
modImplementation "org.antlr:antlr4-runtime:4.13.1"
modImplementation "io.github.douira:glsl-transformer:2.0.1"
}
}
if (project.tmi_type == 'emi') {
modCompileOnly "dev.emi:emi-fabric:${project.emi_version}"
} else {
modCompileOnly "dev.emi:emi-fabric-dummy:${project.emi_version}"
}
}
remapJar {
addNestedDependencies = true
}
processResources {
inputs.property "version", project.version.toString()
filesMatching("fabric.mod.json") {
expand "version": project.version.toString(),
"minecraftVersion": project.minecraft_version_range,
"loaderVersion": ">=${project.loader_version}",
"fabricVersion": ">=${project.fabric_version}",
"fabworkVersion": ">=${project.fabwork_version}",
"kirinVersion": ">=${project.kirin_version}"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
tasks.modrinth {
onlyIf {
def stage = version.version.stage.value
stage == null || stage.name != 'beta'
}
}
modrinth {
token = System.env.MODRINTH_KEY
projectId = project.modrinth_project_id
//featured = true
versionNumber = version.toString()
versionName = archivesBaseName + '-' + version
changelog = "[Changelog](https://github.com/Sollace/Unicopia/releases/tag/${version.toString()})"
uploadFile = remapJar
outlet.mcVersions().each{ver ->
gameVersions.add ver
}
dependencies {
required.project 'P7dR8mSH'
optional.project '5aaWibi9'
optional.project 'JBjInUXM'
optional.project 'fRiHVvU7'
}
}