mirror of
https://github.com/GeyserMC/Rainbow.git
synced 2025-12-19 14:59:16 +00:00
Create build-logic, main rainbow and client module
This commit is contained in:
18
build-logic/build.gradle.kts
Normal file
18
build-logic/build.gradle.kts
Normal file
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Fabric"
|
||||
url = uri("https://maven.fabricmc.net/")
|
||||
}
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Very ugly... https://github.com/gradle/gradle/issues/15383
|
||||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||
|
||||
implementation(libs.fabric.loom)
|
||||
}
|
||||
7
build-logic/settings.gradle.kts
Normal file
7
build-logic/settings.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
6
build-logic/src/main/kotlin/libs.kt
Normal file
6
build-logic/src/main/kotlin/libs.kt
Normal file
@@ -0,0 +1,6 @@
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
|
||||
val Project.libs: LibrariesForLibs
|
||||
get() = rootProject.extensions.getByType()
|
||||
@@ -0,0 +1,90 @@
|
||||
plugins {
|
||||
id("fabric-loom")
|
||||
}
|
||||
|
||||
version = properties["mod_version"]!! as String
|
||||
group = properties["maven_group"]!! as String
|
||||
|
||||
val archivesBaseName = properties["archives_base_name"]!! as String
|
||||
val targetJavaVersion = 21
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "ParchmentMC"
|
||||
url = uri("https://maven.parchmentmc.org")
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "Jitpack"
|
||||
url = uri("https://jitpack.io")
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "Open Collaboration"
|
||||
url = uri("https://repo.opencollab.dev/main")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft(libs.minecraft)
|
||||
mappings(loom.layered {
|
||||
officialMojangMappings()
|
||||
parchment(libs.parchment)
|
||||
})
|
||||
|
||||
modImplementation(libs.fabric.loader)
|
||||
modImplementation(libs.fabric.api)
|
||||
|
||||
implementation(libs.creative.api)
|
||||
implementation(libs.creative.serializer.minecraft)
|
||||
implementation(libs.packconverter)
|
||||
include(libs.creative.api)
|
||||
include(libs.creative.serializer.minecraft)
|
||||
include(libs.packconverter)
|
||||
}
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
inputs.property("version", version)
|
||||
inputs.property("supported_versions", libs.versions.minecraft.supported.get())
|
||||
inputs.property("loader_version", libs.versions.fabric.loader.get())
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
mapOf(
|
||||
"version" to version,
|
||||
"supported_versions" to libs.versions.minecraft.supported.get(),
|
||||
"loader_version" to libs.versions.fabric.loader.get()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${archivesBaseName}" }
|
||||
}
|
||||
}
|
||||
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release = targetJavaVersion
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
||||
if (JavaVersion.current() < javaVersion) {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
||||
}
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
loom {
|
||||
runs {
|
||||
named("server") {
|
||||
runDir = "run-server"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user