2022-09-24 14:05:47 -04:00
|
|
|
@file:Suppress("UnstableApiUsage")
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-09-24 14:05:47 -04:00
|
|
|
val junitVersion: String by project
|
2022-05-31 10:50:46 -04:00
|
|
|
val minecraftVersion: String by project
|
|
|
|
val fabricLoaderVersion: String by project
|
2022-09-24 14:05:47 -04:00
|
|
|
val jeiVersion: String by project
|
|
|
|
val kubejsVersion: String by project
|
2022-05-31 12:41:30 -04:00
|
|
|
val mappingsChannel: String by project
|
|
|
|
val mappingsVersion: String by project
|
2022-09-24 14:05:47 -04:00
|
|
|
val modId: String by project
|
|
|
|
val modName: String by project
|
|
|
|
|
|
|
|
val baseArchiveName = "$modId-common-$minecraftVersion"
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-09-24 14:05:47 -04:00
|
|
|
plugins {
|
|
|
|
id("fabric-loom") version "0.12-SNAPSHOT"
|
|
|
|
id("com.github.gmazzo.buildconfig") version "3.0.3"
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName.set(baseArchiveName)
|
|
|
|
}
|
|
|
|
|
|
|
|
loom {
|
2022-09-24 14:05:47 -04:00
|
|
|
shareCaches()
|
|
|
|
remapArchives.set(false)
|
2022-05-31 10:50:46 -04:00
|
|
|
setupRemappedVariants.set(false);
|
|
|
|
runConfigs.configureEach {
|
|
|
|
ideConfigGenerated(false)
|
|
|
|
}
|
2022-09-24 14:05:47 -04:00
|
|
|
mixin {
|
|
|
|
useLegacyMixinAp.set(false)
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-09-24 14:05:47 -04:00
|
|
|
minecraft("com.mojang:minecraft:$minecraftVersion")
|
|
|
|
modCompileOnly("net.fabricmc:fabric-loader:$fabricLoaderVersion")
|
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
|
2022-09-24 14:05:47 -04:00
|
|
|
parchment("org.parchmentmc.data:$mappingsChannel-$minecraftVersion.2:$mappingsVersion@zip")
|
2022-05-31 12:41:30 -04:00
|
|
|
})
|
2022-08-18 17:21:42 -04:00
|
|
|
|
2022-09-24 14:05:47 -04:00
|
|
|
modCompileOnly("mezz.jei:jei-$minecraftVersion-common:$jeiVersion") // required for common jei plugin and mixin
|
|
|
|
modCompileOnly("dev.latvian.mods:kubejs:$kubejsVersion") // required for common kubejs plugin
|
2022-06-23 12:47:03 -04:00
|
|
|
|
2022-09-24 14:05:47 -04:00
|
|
|
// JUnit Tests
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
|
|
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
2022-09-06 12:00:29 -04:00
|
|
|
tasks {
|
2022-09-24 14:05:47 -04:00
|
|
|
// TODO: test if this is necessary
|
2022-09-06 12:00:29 -04:00
|
|
|
processResources {
|
|
|
|
val buildProps = project.properties
|
2022-05-31 10:50:46 -04:00
|
|
|
|
2022-09-06 12:00:29 -04:00
|
|
|
filesMatching("pack.mcmeta") {
|
|
|
|
expand(buildProps)
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
2022-09-24 14:05:47 -04:00
|
|
|
withType<Test> {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
2022-09-06 12:00:29 -04:00
|
|
|
buildConfig {
|
|
|
|
buildConfigField("String", "MOD_ID", "\"${modId}\"")
|
|
|
|
buildConfigField("String", "MOD_VERSION", "\"${project.version}\"")
|
|
|
|
buildConfigField("String", "MOD_NAME", "\"${modName}\"")
|
|
|
|
packageName(project.group as String)
|
|
|
|
}
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
register("mavenJava", MavenPublication::class) {
|
|
|
|
artifactId = baseArchiveName
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("file://${System.getenv("local_maven")}")
|
|
|
|
}
|
|
|
|
}
|