Files

153 lines
4.4 KiB
Kotlin
Raw Permalink Normal View History

2024-06-15 20:10:42 +02:00
plugins {
2026-08-09 15:49:28 +02:00
id("com.falsepattern.fpgradle-mc") version "4.1.0"
2024-06-15 20:10:42 +02:00
}
group = "com.falsepattern"
2025-11-14 00:30:34 +01:00
//bump this after ANY change to the deploader!
val deploaderVersion = 10
2025-11-14 00:30:34 +01:00
2024-06-15 20:10:42 +02:00
minecraft_fp {
2024-07-15 12:09:12 +02:00
java {
compatibility = jvmDowngrader
jvmDowngraderShade = projectIsLgpl21PlusCompatible
2024-07-15 12:09:12 +02:00
version = JavaVersion.VERSION_17
}
2024-06-15 20:10:42 +02:00
mod {
modid = "falsepatternlib"
name = "FalsePatternLib"
rootPkg = "$group.lib"
}
api {
packages = listOf("asm", "compat", "config", "dependencies", "mapping", "mixin", "optifine", "text", "toasts", "turboasm", "util")
packagesNoRecurse = listOf(".")
}
core {
coreModClass = "internal.asm.CoreLoadingPlugin"
}
tokens {
tokenClass = "internal.Tags"
modid = "MODID"
name = "MODNAME"
version = "VERSION"
rootPkg = "GROUPNAME"
}
publish {
2024-06-15 23:47:17 +02:00
changelog = "https://github.com/FalsePattern/FalsePatternLib/releases/tag/$version"
2024-06-15 20:10:42 +02:00
maven {
repoUrl = "https://mvn.falsepattern.com/releases/"
repoName = "mavenpattern"
}
curseforge {
projectId = "665627"
2026-08-09 15:49:28 +02:00
side = Both
2024-06-15 20:10:42 +02:00
}
modrinth {
projectId = "eGLBEILf"
}
}
}
2025-11-13 06:29:03 +01:00
val java8Compiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
vendor = JvmVendorSpec.ADOPTIUM
}
fun createSourceSet(name: String, shareDeps: Boolean): SourceSet {
val set = sourceSets.create(name) {
if (shareDeps) {
compileClasspath += sourceSets["patchedMc"].output
}
}
tasks.named<JavaCompile>(set.compileJavaTaskName).configure {
javaCompiler = java8Compiler
}
afterEvaluate {
tasks.named<JavaCompile>(set.compileJavaTaskName).configure {
this.sourceCompatibility = "8"
this.targetCompatibility = "8"
this.options.release = null
}
}
if (shareDeps) {
configurations.named(set.compileClasspathConfigurationName) {
extendsFrom(configurations.getByName("compileClasspath"))
exclude("com.falsepattern", "falsepatternlib-mc1.7.10")
}
configurations.named(set.runtimeClasspathConfigurationName) {
extendsFrom(configurations.getByName("runtimeClasspath"))
exclude("com.falsepattern", "falsepatternlib-mc1.7.10")
}
configurations.named(set.annotationProcessorConfigurationName) {
extendsFrom(configurations.getByName("annotationProcessor"))
exclude("com.falsepattern", "falsepatternlib-mc1.7.10")
}
}
return set
}
val depLoader = createSourceSet("deploader", true)
val depLoaderJar = tasks.register<Jar>(depLoader.jarTaskName) {
from(depLoader.output)
archiveBaseName = "falsepatternlib-mc1.7.10"
archiveVersion = minecraft_fp.mod.version
archiveClassifier = "deploader"
manifest {
2025-11-14 00:30:34 +01:00
attributes("FPLib-Deploader-Version" to deploaderVersion)
2025-11-13 06:29:03 +01:00
}
}
val depLoaderStub = createSourceSet("deploaderStub", true)
val depLoaderStubJar = tasks.register<Jar>(depLoaderStub.jarTaskName) {
from(depLoaderStub.output)
archiveBaseName = "falsepatternlib-mc1.7.10"
archiveVersion = minecraft_fp.mod.version
archiveClassifier = "deploader_stub"
}
sourceSets["main"].compileClasspath += depLoader.output
sourceSets["main"].compileClasspath += depLoaderStub.output
afterEvaluate {
for (outgoingConfig in listOf("runtimeElements", "apiElements")) {
val outgoing = configurations.getByName(outgoingConfig)
outgoing.outgoing.artifact(depLoaderStubJar)
outgoing.outgoing.artifact(depLoaderJar)
}
}
tasks.jar {
dependsOn(depLoaderJar, depLoaderStubJar)
from(depLoaderJar.map { it.archiveFile }) {
rename { "fplib_deploader.jar" }
}
from(zipTree(depLoaderStubJar.map { it.archiveFile })) {
exclude("META-INF/MANIFEST.MF")
}
}
tasks.processResources {
val ver = minecraft_fp.mod.version
filesMatching("META-INF/deps.json") {
expand("modVersion" to ver.get())
}
}
2024-06-15 20:10:42 +02:00
repositories {
2024-07-15 12:00:06 +02:00
exclusive(maven("horizon", "https://mvn.falsepattern.com/horizon/"), "com.gtnewhorizons.retrofuturabootstrap")
2025-09-08 00:49:58 +02:00
exclusive(horizon()) {
includeModule("io.github.legacymoddingmc", "unimixins")
}
2024-06-15 20:10:42 +02:00
}
dependencies {
2026-04-27 19:55:08 +02:00
compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:1.0.16")
compileOnly("io.github.legacymoddingmc:unimixins:0.3.0:dev")
2024-06-15 20:10:42 +02:00
}