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-27 12:10:51 -04:00
|
|
|
val reiVersion: 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
|
2023-02-01 10:35:48 -05:00
|
|
|
val modPackage: String by project
|
2022-09-24 14:05:47 -04:00
|
|
|
|
2022-10-17 14:57:09 -04:00
|
|
|
val baseArchiveName = "$modId-common"
|
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
|
|
|
remapArchives.set(false)
|
2022-09-27 12:10:51 -04:00
|
|
|
setupRemappedVariants.set(false)
|
2022-05-31 10:50:46 -04:00
|
|
|
runConfigs.configureEach {
|
|
|
|
ideConfigGenerated(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-10-17 14:57:09 -04:00
|
|
|
parchment("org.parchmentmc.data:$mappingsChannel-$minecraftVersion:$mappingsVersion@zip")
|
2022-05-31 12:41:30 -04:00
|
|
|
})
|
2022-08-18 17:21:42 -04:00
|
|
|
|
2022-09-27 12:10:51 -04:00
|
|
|
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:$reiVersion") // required for common rei plugin
|
2022-11-30 14:49:18 -05:00
|
|
|
compileOnly("me.shedaniel:REIPluginCompatibilities-forge-annotations:9.+") // required to disable rei compat layer on jei plugin
|
|
|
|
testCompileOnly("me.shedaniel:REIPluginCompatibilities-forge-annotations:9.+") // don't question this, it's required for compiling
|
2022-09-24 14:05:47 -04:00
|
|
|
modCompileOnly("mezz.jei:jei-$minecraftVersion-common:$jeiVersion") // required for common jei plugin and mixin
|
2022-10-17 14:57:09 -04:00
|
|
|
modCompileOnly("dev.latvian.mods:kubejs-fabric:$kubejsVersion") // required for common kubejs plugin | common has remapping issues
|
2022-06-23 12:47:03 -04:00
|
|
|
|
2023-02-01 10:21:07 -05:00
|
|
|
compileOnly("com.google.auto.service:auto-service:1.0.1")
|
|
|
|
annotationProcessor("com.google.auto.service:auto-service:1.0.1")
|
|
|
|
|
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
|
|
|
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}\"")
|
2023-02-01 10:35:48 -05:00
|
|
|
packageName(modPackage)
|
2022-09-06 12:00:29 -04:00
|
|
|
}
|
|
|
|
|
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")}")
|
|
|
|
}
|
|
|
|
}
|