flan/fabric/build.gradle

180 lines
5.2 KiB
Groovy
Raw Normal View History

2021-06-11 18:33:10 +00:00
plugins {
2021-12-03 21:37:35 +00:00
id "com.github.johnrengelman.shadow" version "7.1.0"
2021-06-11 18:33:10 +00:00
}
architectury {
platformSetupLoomIde()
fabric()
}
2021-12-03 21:37:35 +00:00
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
}
2023-05-08 18:51:41 +00:00
loom {
runs {
client {
vmArgs "-Dmixin.debug.export=true"
}
}
}
2021-06-11 18:33:10 +00:00
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.*'
}
}
2021-07-20 17:16:29 +00:00
maven {
name = "HavenKing"
url = "https://hephaestus.dev/release"
}
2021-07-20 22:27:08 +00:00
maven {
name = "FTB"
url = "https://maven.saps.dev/minecraft"
}
2022-02-28 01:31:56 +00:00
maven {
name = "CurseMaven"
url "https://www.cursemaven.com"
}
2022-04-06 19:31:13 +00:00
maven { url = "https://jitpack.io" }
maven {
url = "https://maven.jamieswhiteshirt.com/libs-release/"
content {
includeGroup 'com.jamieswhiteshirt'
}
}
2021-06-11 18:33:10 +00:00
}
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}"
2022-07-01 16:24:47 +00:00
2021-12-03 21:37:35 +00:00
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
2021-12-05 12:21:22 +00:00
2021-06-11 18:33:10 +00:00
modImplementation "me.lucko:fabric-permissions-api:${rootProject.fabric_permissions_api}"
2022-01-08 16:29:56 +00:00
2022-07-01 16:24:47 +00:00
modImplementation octo_economy_api
2022-08-03 20:50:16 +00:00
modCompileOnly diamond_economy
2022-01-08 16:29:56 +00:00
modCompileOnly "io.github.ladysnake:PlayerAbilityLib:${rootProject.player_ability_lib}"
2021-07-20 17:16:29 +00:00
2022-08-03 20:50:16 +00:00
modCompileOnly "dev.ftb.mods:ftb-ranks-fabric:${rootProject.ftb_ranks}"
2022-04-06 19:31:13 +00:00
2023-05-06 13:58:42 +00:00
//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")
2023-03-29 21:05:33 +00:00
modCompileOnly harvest_with_ease_fabric
2021-06-11 18:33:10 +00:00
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
2023-05-21 22:39:21 +00:00
expand "version": project.version, "homepage": curse_page_fabric,
2023-05-21 22:46:24 +00:00
"mcversion": minecraft_version, "fabric_version": fabric_version
}
2021-06-11 18:33:10 +00:00
}
shadowJar {
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier "fabric"
2021-06-11 18:33:10 +00:00
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
classifier "fabric-sources"
2021-06-11 18:33:10 +00:00
}
2021-12-03 21:37:35 +00:00
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")
}
2021-07-20 22:27:08 +00:00
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")
*/
}
2021-06-11 18:33:10 +00:00
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
classifier null
2021-06-11 18:33:10 +00:00
builtBy remapJar
}
artifact(sourcesJar) {
classifier "sources"
2021-06-11 18:33:10 +00:00
builtBy remapSourcesJar
}
2023-05-06 15:04:27 +00:00
artifact(remapApiJar) {
classifier "api"
builtBy remapApiJar
}
2021-06-11 18:33:10 +00:00
artifactId project.archives_base_name
version project.version + "-fabric"
2021-06-11 18:33:10 +00:00
}
}
repositories {
2021-06-13 21:07:10 +00:00
maven {
2021-06-11 18:33:10 +00:00
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")
}
2021-06-13 21:07:10 +00:00
}
2021-06-11 18:33:10 +00:00
}
2021-06-13 19:02:33 +00:00
}