feat: add fabric-api/libjf BOM if version is specified
This commit is contained in:
parent
4f312a9c0d
commit
3c0b5637f7
|
@ -9,6 +9,7 @@ import org.jetbrains.annotations.ApiStatus.Internal
|
||||||
|
|
||||||
interface JfModExtension: LomExtension {
|
interface JfModExtension: LomExtension {
|
||||||
val libJfVersion: Property<String>
|
val libJfVersion: Property<String>
|
||||||
|
val fabricApiVersion: Property<String>
|
||||||
@get:Nested val curseforge: CurseForge
|
@get:Nested val curseforge: CurseForge
|
||||||
@get:Nested val modrinth: Modrinth
|
@get:Nested val modrinth: Modrinth
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ interface JfModExtension: LomExtension {
|
||||||
override fun check(proj: Project) {
|
override fun check(proj: Project) {
|
||||||
super.check(proj)
|
super.check(proj)
|
||||||
libJfVersion.finalizeValue()
|
libJfVersion.finalizeValue()
|
||||||
|
fabricApiVersion.finalizeValue()
|
||||||
modrinth.check(proj)
|
modrinth.check(proj)
|
||||||
curseforge.check(proj)
|
curseforge.check(proj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import gradle.kotlin.dsl.accessors._2b47c59e4bff1a1e15af40cb0a9df00c.versionCatalogs
|
||||||
import io.gitlab.jfronny.scripts.*
|
import io.gitlab.jfronny.scripts.*
|
||||||
import org.gradle.api.internal.project.ProjectStateInternal
|
import org.gradle.api.internal.project.ProjectStateInternal
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
|
@ -25,6 +26,9 @@ insertEarlyAfterEvaluate {
|
||||||
|
|
||||||
if (rootArgs.libJfVersion.isPresent) {
|
if (rootArgs.libJfVersion.isPresent) {
|
||||||
dependencies {
|
dependencies {
|
||||||
|
if (SemanticVersion.parse(rootArgs.libJfVersion.get()) > SemanticVersion.parse("3.14.2")) {
|
||||||
|
modImplementation(platform("io.gitlab.jfronny.libjf:libjf-bom:${rootArgs.libJfVersion.get()}"))
|
||||||
|
}
|
||||||
clientAnnotationProcessor(annotationProcessor("io.gitlab.jfronny.libjf:libjf-config-compiler-plugin-v2:${rootArgs.libJfVersion.get()}")!!)
|
clientAnnotationProcessor(annotationProcessor("io.gitlab.jfronny.libjf:libjf-config-compiler-plugin-v2:${rootArgs.libJfVersion.get()}")!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +36,15 @@ insertEarlyAfterEvaluate {
|
||||||
options.compilerArgs.add("-AmodId=" + base.archivesName.get())
|
options.compilerArgs.add("-AmodId=" + base.archivesName.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rootArgs.fabricApiVersion.isPresent) {
|
||||||
|
dependencies {
|
||||||
|
modImplementation(platform("net.fabricmc.fabric-api:fabric-api-bom:${rootArgs.fabricApiVersion.get()}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
versionCatalogs {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.pAfterEvaluate(action: (Project) -> Unit) =
|
fun Project.pAfterEvaluate(action: (Project) -> Unit) =
|
||||||
|
|
Loading…
Reference in New Issue