flan/fabric/build.gradle

181 lines
5.2 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.1.0"
}
architectury {
platformSetupLoomIde()
fabric()
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common
}
loom {
runs {
client {
vmArgs "-Dmixin.debug.export=true"
}
}
}
repositories {
mavenCentral()
maven {
name = 'Fabric-Permission-API'
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
name = "Gunpowder"
url = "https://maven.martmists.com/releases"
}
maven {
name = 'Ladysnake Mods'
url = 'https://ladysnake.jfrog.io/artifactory/mods'
content {
includeGroup 'io.github.ladysnake'
includeGroupByRegex 'io\\.github\\.onyxstudios.*'
}
}
maven {
name = "HavenKing"
url = "https://hephaestus.dev/release"
}
maven {
name = "FTB"
url = "https://maven.saps.dev/minecraft"
}
maven {
name = "CurseMaven"
url "https://www.cursemaven.com"
}
maven { url = "https://jitpack.io" }
maven {
url = "https://maven.jamieswhiteshirt.com/libs-release/"
content {
includeGroup 'com.jamieswhiteshirt'
}
}
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
modImplementation "me.lucko:fabric-permissions-api:${rootProject.fabric_permissions_api}"
modImplementation octo_economy_api
modCompileOnly diamond_economy
modCompileOnly "io.github.ladysnake:PlayerAbilityLib:${rootProject.player_ability_lib}"
//modCompileOnly "dev.ftb.mods:ftb-ranks-fabric:${rootProject.ftb_ranks}"
//modRuntimeOnly "dev.ftb.mods:ftb-chunks-fabric:${rootProject.ftb_chunks}"
//CompileOnly cause too many dependency
modCompileOnly goml_reserved
modCompileOnly include("com.jamieswhiteshirt:rtree-3i-lite-fabric:0.3.0")
modCompileOnly harvest_with_ease_fabric
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version, "homepage": curse_page_fabric,
"mcversion": minecraft_version, "fabric_version": fabric_version
}
}
shadowJar {
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier "fabric"
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
classifier "fabric-sources"
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
task apiJar(type: Jar, dependsOn: classes) {
archiveClassifier.set "fabric-api-source"
from project(":common").sourceSets.main.output + sourceSets.main.output
include "io/github/flemmli97/flan/api/**"
include "fabric.mod_api.json" //Include this so it gets remapped as a dependency
rename("fabric.mod_api.json", "fabric.mod.json")
}
task remapApiJar(type: net.fabricmc.loom.task.RemapJarTask) {
archiveClassifier.set "fabric-api"
input.set apiJar.archiveFile
addNestedDependencies = false
dependsOn apiJar
from sourceSets.main.output
/* Putting it here doesnt seem to work...
include "fabric.mod_api.json" //Include this so it gets remapped as a dependency
rename("fabric.mod_api.json", "fabric.mod.json")
*/
}
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
classifier null
builtBy remapJar
}
artifact(sourcesJar) {
classifier "sources"
builtBy remapSourcesJar
}
artifact(remapApiJar) {
classifier "api"
builtBy remapApiJar
}
artifactId project.archives_base_name
version project.version + "-fabric"
}
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/21830712/packages/maven"
//url "https://maven.pkg.github.com/flemmli97/<>"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN")
//password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN")
}
}
}
}