2022-05-31 10:50:46 -04:00
|
|
|
plugins {
|
|
|
|
idea
|
|
|
|
`maven-publish`
|
2022-08-23 08:40:49 -04:00
|
|
|
id("fabric-loom") version "0.12-SNAPSHOT"
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
val minecraftVersion: String by project
|
|
|
|
val fabricVersion: String by project
|
|
|
|
val fabricLoaderVersion: String by project
|
|
|
|
val modName: String by project
|
|
|
|
val modId: String by project
|
2022-05-31 12:41:30 -04:00
|
|
|
val mappingsChannel: String by project
|
|
|
|
val mappingsVersion: String by project
|
2022-08-21 13:47:06 -04:00
|
|
|
val extraModsDirectory: String by project
|
2022-05-31 17:19:29 -04:00
|
|
|
val reiVersion: String by project
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-08-21 07:41:39 -04:00
|
|
|
val baseArchiveName = "${modId}-fabric-${minecraftVersion}"
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName.set(baseArchiveName)
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
minecraft("com.mojang:minecraft:${minecraftVersion}")
|
2022-05-31 12:41:30 -04:00
|
|
|
mappings(loom.layered {
|
|
|
|
officialMojangMappings()
|
2022-08-23 09:28:26 -04:00
|
|
|
// TODO: change this when updating to 1.19.2
|
|
|
|
parchment("org.parchmentmc.data:${mappingsChannel}-${minecraftVersion}.2:${mappingsVersion}@zip")
|
2022-05-31 12:41:30 -04:00
|
|
|
})
|
2022-05-31 17:19:29 -04:00
|
|
|
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
modImplementation("net.fabricmc:fabric-loader:${fabricLoaderVersion}")
|
2022-05-31 17:19:29 -04:00
|
|
|
modApi("net.fabricmc.fabric-api:fabric-api:${fabricVersion}")
|
2022-05-31 10:50:46 -04:00
|
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricVersion}")
|
2022-05-31 17:19:29 -04:00
|
|
|
|
|
|
|
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${reiVersion}")
|
|
|
|
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${reiVersion}")
|
|
|
|
|
2022-08-21 13:47:06 -04:00
|
|
|
fileTree("$extraModsDirectory-$minecraftVersion") { include("**/*.jar") }
|
2022-07-29 16:45:44 -04:00
|
|
|
.forEach { f ->
|
|
|
|
val sepIndex = f.nameWithoutExtension.lastIndexOf('-');
|
|
|
|
if(sepIndex == -1) {
|
|
|
|
throw IllegalArgumentException("Invalid mod name: ${f.nameWithoutExtension}")
|
|
|
|
}
|
|
|
|
val mod = f.nameWithoutExtension.substring(0, sepIndex);
|
|
|
|
val version = f.nameWithoutExtension.substring(sepIndex + 1);
|
|
|
|
println("Extra mod $mod with version $version detected")
|
2022-08-21 13:47:06 -04:00
|
|
|
modLocalRuntime("$extraModsDirectory:$mod:$version")
|
2022-07-29 16:45:44 -04:00
|
|
|
}
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
implementation(project(":Common"))
|
|
|
|
}
|
|
|
|
|
|
|
|
loom {
|
|
|
|
runs {
|
|
|
|
named("client") {
|
|
|
|
client()
|
|
|
|
configName = "Fabric Client"
|
|
|
|
ideConfigGenerated(true)
|
|
|
|
runDir("run")
|
|
|
|
}
|
|
|
|
named("server") {
|
|
|
|
server()
|
|
|
|
configName = "Fabric Server"
|
|
|
|
ideConfigGenerated(true)
|
|
|
|
runDir("run")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-15 09:54:03 -04:00
|
|
|
mixin {
|
|
|
|
defaultRefmapName.set("${modId}.refmap.json")
|
|
|
|
}
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
from(project(":Common").sourceSets.main.get().resources)
|
|
|
|
inputs.property("version", project.version)
|
|
|
|
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
|
|
expand("version" to project.version)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
source(project(":Common").sourceSets.main.get().allSource)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jar {
|
|
|
|
from("LICENSE") {
|
|
|
|
rename { "${it}_${modName}" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
register("mavenJava", MavenPublication::class) {
|
|
|
|
artifactId = baseArchiveName
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("file://${System.getenv("local_maven")}")
|
|
|
|
}
|
|
|
|
}
|