2022-05-31 10:50:46 -04:00
|
|
|
plugins {
|
|
|
|
`maven-publish`
|
|
|
|
id("fabric-loom") version "0.10-SNAPSHOT"
|
|
|
|
id("com.github.gmazzo.buildconfig") version "3.0.3"
|
|
|
|
}
|
|
|
|
|
|
|
|
val minecraftVersion: String by project
|
|
|
|
val commonRunsEnabled: String by project
|
|
|
|
val commonClientRunName: String? by project
|
|
|
|
val commonServerRunName: String? by project
|
|
|
|
val modName: String by project
|
|
|
|
val modId: String by project
|
|
|
|
val fabricLoaderVersion: String by project
|
2022-05-31 12:41:30 -04:00
|
|
|
val mappingsChannel: String by project
|
|
|
|
val mappingsVersion: String by project
|
2022-08-18 19:48:33 -04:00
|
|
|
val kubejsVersion: String by project
|
2022-08-18 17:21:42 -04:00
|
|
|
val jeiVersion: String by project
|
2022-05-31 10:50:46 -04:00
|
|
|
|
|
|
|
val baseArchiveName = "${modName}-common-${minecraftVersion}"
|
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName.set(baseArchiveName)
|
|
|
|
}
|
|
|
|
|
|
|
|
loom {
|
|
|
|
remapArchives.set(false);
|
|
|
|
setupRemappedVariants.set(false);
|
|
|
|
runConfigs.configureEach {
|
|
|
|
ideConfigGenerated(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
minecraft("com.mojang:minecraft:${minecraftVersion}")
|
2022-05-31 12:41:30 -04:00
|
|
|
mappings(loom.layered {
|
|
|
|
officialMojangMappings()
|
|
|
|
parchment("org.parchmentmc.data:${mappingsChannel}-${minecraftVersion}:${mappingsVersion}@zip")
|
|
|
|
})
|
2022-05-31 10:50:46 -04:00
|
|
|
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
|
|
|
|
2022-08-18 19:48:33 -04:00
|
|
|
modApi("dev.latvian.mods:kubejs-fabric:${kubejsVersion}")
|
2022-08-18 17:21:42 -04:00
|
|
|
modCompileOnlyApi("mezz.jei:jei-${minecraftVersion}-common-api:${jeiVersion}")
|
|
|
|
|
2022-05-31 10:50:46 -04:00
|
|
|
/**
|
|
|
|
* DON'T USE THIS! NEEDED TO COMPILE THIS PROJECT
|
|
|
|
*/
|
|
|
|
modCompileOnly("net.fabricmc:fabric-loader:${fabricLoaderVersion}")
|
2022-06-23 12:47:03 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test dependencies
|
|
|
|
*/
|
|
|
|
testImplementation ("org.junit.jupiter:junit-jupiter-api:5.8.1")
|
|
|
|
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.8.1")
|
2022-05-31 10:50:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
val buildProps = project.properties
|
|
|
|
|
|
|
|
filesMatching("pack.mcmeta") {
|
|
|
|
expand(buildProps)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
register("mavenJava", MavenPublication::class) {
|
|
|
|
artifactId = baseArchiveName
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("file://${System.getenv("local_maven")}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildConfig {
|
|
|
|
buildConfigField("String", "MOD_ID", "\"${modId}\"")
|
|
|
|
buildConfigField("String", "MOD_VERSION", "\"${project.version}\"")
|
|
|
|
buildConfigField("String", "MOD_NAME", "\"${modName}\"")
|
|
|
|
|
|
|
|
packageName(project.group as String)
|
|
|
|
}
|
2022-06-23 12:47:03 -04:00
|
|
|
|
|
|
|
tasks.withType<Test> {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|