almostunified/Common/build.gradle.kts

81 lines
2.5 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 reiVersion: 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 modPackage: String by project
2022-10-17 14:57:09 -04:00
val baseArchiveName = "$modId-common"
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 {
remapArchives.set(false)
setupRemappedVariants.set(false)
2022-05-31 10:50:46 -04:00
runConfigs.configureEach {
ideConfigGenerated(false)
}
}
dependencies {
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
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:$reiVersion") // required for common rei plugin
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
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")
// 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 {
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(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")}")
}
}