almostunified/Common/build.gradle.kts

87 lines
2.2 KiB
Text
Raw Normal View History

2022-05-31 10:50:46 -04:00
plugins {
`maven-publish`
2022-08-23 08:40:49 -04:00
id("fabric-loom") version "0.12-SNAPSHOT"
2022-05-31 10:50:46 -04:00
id("com.github.gmazzo.buildconfig") version "3.0.3"
}
val minecraftVersion: 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()
// 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-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
}
2022-09-06 12:00:29 -04:00
tasks {
withType<Test> {
useJUnitPlatform()
}
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
}
}
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")}")
}
}