flan/forge/build.gradle

125 lines
3.1 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()
forge()
}
2021-12-05 23:14:45 +00:00
loom {
forge {
mixinConfigs = ["flan.mixins.json", "flan.forge.mixins.json"]
}
}
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
developmentForge.extendsFrom common
}
2021-07-20 22:27:08 +00:00
repositories {
mavenCentral()
maven {
name = "FTB"
url = "https://maven.saps.dev/minecraft"
}
2021-07-30 16:20:35 +00:00
maven {
name = "CurseMaven"
url "https://www.cursemaven.com"
}
2021-07-20 22:27:08 +00:00
}
2021-06-11 18:33:10 +00:00
dependencies {
2022-01-09 15:19:50 +00:00
forge "net.minecraftforge:forge:${rootProject.forge_version}"
2021-06-11 18:33:10 +00:00
2021-12-03 21:37:35 +00:00
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
2021-07-20 22:27:08 +00:00
modCompileOnly("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
2021-12-05 12:21:22 +00:00
modImplementation(dicemcmm)
2021-06-11 18:33:10 +00:00
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}
shadowJar {
exclude "fabric.mod.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier "forge"
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
2021-06-13 21:07:10 +00:00
classifier "forge-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 "forge-api-source"
from project(":common").sourceSets.main.output + sourceSets.main.output
include "io/github/flemmli97/flan/api/**"
}
2021-07-20 22:27:08 +00:00
task remapApiJar(type: net.fabricmc.loom.task.RemapJarTask) {
archiveClassifier.set "forge-api"
input.set apiJar.archiveFile
addNestedDependencies = false
dependsOn apiJar
}
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) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
artifact(remapApiJar)
2021-06-11 18:33:10 +00:00
artifactId project.archives_base_name
2021-06-13 21:07:10 +00:00
version project.version
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
}
}