almostunified/Common/build.gradle.kts

59 lines
1.9 KiB
Text
Raw Normal View History

2023-02-01 14:43:30 -05:00
val enabledPlatforms: String by project
2023-07-28 18:59:02 -04:00
val minecraftVersion: String by project
val modPackage: String by project
2023-02-01 14:43:30 -05:00
val modId: String by project
val modName: String by project
val junitVersion: String by project
2023-07-28 18:59:02 -04:00
val fabricLoaderVersion: String by project
val jeiVersion: String by project
val reiVersion: String by project
2022-05-31 10:50:46 -04:00
plugins {
2023-06-14 05:48:49 -04:00
id("com.github.gmazzo.buildconfig") version ("4.0.4")
}
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-07-28 18:59:02 -04:00
if (project.findProperty("enableAccessWidener") == "true") { // optional property for `gradle.properties`
2023-02-01 14:43:30 -05:00
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-07-28 18:59:02 -04:00
/**
* loader
* required here for the @Environment annotations and the mixin dependencies
* do NOT use other classes from the Fabric loader
*/
2023-06-14 05:48:49 -04:00
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")
// compile time mods
2023-07-28 18:59:02 -04:00
modCompileOnly("mezz.jei:jei-$minecraftVersion-common-api:$jeiVersion") // required for jei plugin
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:$reiVersion") // required for rei plugin
// compile time dependencies
compileOnly("me.shedaniel:REIPluginCompatibilities-forge-annotations:9.+") // required to disable rei compat layer
2022-06-23 12:47:03 -04:00
2023-06-14 05:48:49 -04:00
// 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)
2023-06-14 05:48:49 -04:00
useJavaOutput()
2022-09-06 12:00:29 -04:00
}
2023-02-01 14:43:30 -05:00
//tasks {
// withType<Test> {
// useJUnitPlatform()
// }
//}