almostunified/Common/build.gradle.kts

86 lines
2.3 KiB
Text
Raw Normal View History

@file:Suppress("UnstableApiUsage")
2022-05-31 10:50:46 -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
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
val modId: String by project
val modName: String by project
val baseArchiveName = "$modId-common-$minecraftVersion"
2022-05-31 10:50:46 -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 {
shareCaches()
remapArchives.set(false)
2022-05-31 10:50:46 -04:00
setupRemappedVariants.set(false);
runConfigs.configureEach {
ideConfigGenerated(false)
}
mixin {
useLegacyMixinAp.set(false)
}
2022-05-31 10:50:46 -04:00
}
dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
modCompileOnly("net.fabricmc:fabric-loader:$fabricLoaderVersion")
2022-05-31 12:41:30 -04:00
mappings(loom.layered {
officialMojangMappings()
// 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-08-18 17:21:42 -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
// 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 {
// 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
}
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")}")
}
}