almostunified/Common/build.gradle.kts

58 lines
2.3 KiB
Text
Raw Normal View History

2023-02-01 14:43:30 -05:00
val enabledPlatforms: String by project
2022-05-31 10:50:46 -04:00
val fabricLoaderVersion: String by project
2023-02-01 14:43:30 -05:00
val modId: String by project
val modName: String by project
val modPackage: 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
2023-02-01 14:43:30 -05:00
val junitVersion: String by project
val minecraftVersion: String by project
2022-05-31 10:50:46 -04:00
plugins {
2023-02-01 14:43:30 -05:00
id("com.github.gmazzo.buildconfig") version ("3.1.0")
}
2022-05-31 10:50:46 -04:00
2023-02-01 14:43:30 -05:00
architectury {
common(enabledPlatforms.split(","))
2022-05-31 10:50:46 -04:00
}
loom {
2023-02-01 14:43:30 -05:00
if (project.findProperty("enableAccessWidener") == "true") { // Optional property for `gradle.properties` to enable access wideners.
accessWidenerPath.set(file("src/main/resources/$modId.accesswidener"))
println("Access widener enabled for project ${project.name}. Access widener path: ${loom.accessWidenerPath.get()}")
2022-05-31 10:50:46 -04:00
}
}
dependencies {
2023-02-01 14:43:30 -05:00
modCompileOnly("dev.latvian.mods:kubejs:$kubejsVersion") // required for common kubejs plugin | common has remapping issues
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-06-23 12:47:03 -04:00
2023-02-01 14:43:30 -05:00
// The Fabric loader is required here to use the @Environment annotations and to get the mixin dependencies.
// Do NOT use other classes from the Fabric loader!
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")
2023-02-01 10:21:07 -05: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
buildConfig {
2023-02-01 14:43:30 -05:00
buildConfigField("String", "MOD_ID", "\"$modId\"")
buildConfigField("String", "MOD_NAME", "\"$modName\"")
buildConfigField("String", "MOD_VERSION", "\"$version\"")
packageName(modPackage)
2022-09-06 12:00:29 -04:00
}
2023-02-01 14:43:30 -05:00
// TODO reactivate when specific mod is not annoying anymore
//tasks {
// withType<Test> {
// useJUnitPlatform()
// }
//}