Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup JDK 21
uses: actions/setup-java@v5
with:
Expand All @@ -24,19 +24,15 @@ jobs:
- name: Build
run: ./gradlew build
- name: Upload Artifact
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v7.0.0
with:
name: 1.21.5
path: build/libs/*-1.21.5.jar
- uses: actions/upload-artifact@v4.0.0
with:
name: 1.21.8
path: build/libs/*-1.21.8.jar
- uses: actions/upload-artifact@v4.0.0
with:
name: 1.21.10
archive: false
path: build/libs/*-1.21.10.jar
- uses: actions/upload-artifact@v4.0.0
- uses: actions/upload-artifact@v7.0.0
with:
name: 1.21.11
archive: false
path: build/libs/*-1.21.11.jar
- uses: actions/upload-artifact@v7.0.0
with:
archive: false
path: build/libs/*-26.1.jar
2 changes: 1 addition & 1 deletion annotations/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "2.2.0"
kotlin("jvm")
}

repositories {
Expand Down
199 changes: 2 additions & 197 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,199 +1,4 @@
import net.fabricmc.loom.task.ValidateAccessWidenerTask
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
idea
id("fabric-loom")
`versioned-catalogues`
kotlin("jvm") version "2.2.0"
alias(libs.plugins.meowdding.auto.mixins)
alias(libs.plugins.kotlin.symbol.processor)
id("net.fabricmc.fabric-loom")
`cs-setup`
}

repositories {
fun scopedMaven(url: String, vararg paths: String) = maven(url) { content { paths.forEach(::includeGroupAndSubgroups) } }

scopedMaven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1", "me.djtheredstoner")
scopedMaven("https://repo.hypixel.net/repository/Hypixel", "net.hypixel")
scopedMaven("https://maven.parchmentmc.org/", "org.parchmentmc")
scopedMaven("https://api.modrinth.com/maven", "maven.modrinth")
scopedMaven(
"https://maven.teamresourceful.com/repository/maven-public/",
"earth.terrarium",
"com.teamresourceful",
"tech.thatgravyboat",
"me.owdding",
"com.terraformersmc"
)
scopedMaven("https://maven.nucleoid.xyz/", "eu.pb4")
scopedMaven(url = "https://maven.shedaniel.me/", "me.shedaniel", "dev.architectury")
mavenCentral()
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
compilerOptions.optIn.add("kotlin.time.ExperimentalTime")
compilerOptions.freeCompilerArgs.addAll(
"-Xcontext-parameters",
"-Xcontext-sensitive-resolution",
"-Xnullability-annotations=@org.jspecify.annotations:warn"
)
}

evaluationDependsOn(":annotations")

dependencies {
minecraft(versionedCatalog["minecraft"])
mappings(loom.layered {
officialMojangMappings()
parchment(variantOf(versionedCatalog["parchment"]) {
artifactType("zip")
})
})
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.language.kotlin)
modImplementation(versionedCatalog["fabric.api"])

modRuntimeOnly(versionedCatalog["placeholders"])
modCompileOnly(versionedCatalog["scoreboard.overhaul"])

api(libs.skyblockapi) {
capabilities { requireCapability("tech.thatgravyboat:skyblock-api-${stonecutter.current.version}") }
}
include(libs.skyblockapi) {
capabilities { requireCapability("tech.thatgravyboat:skyblock-api-${stonecutter.current.version}-remapped") }
}
api(libs.meowdding.lib) {
capabilities { requireCapability("me.owdding.meowdding-lib:meowdding-lib-${stonecutter.current.version}") }
}
include(libs.meowdding.lib) {
capabilities { requireCapability("me.owdding.meowdding-lib:meowdding-lib-${stonecutter.current.version}-remapped") }
}
compileOnly(project(":annotations"))
ksp(project(":annotations"))

compileOnly(libs.meowdding.ktmodules)
ksp(libs.meowdding.ktmodules)

modImplementation(libs.hypixelapi)
modImplementation(libs.mixinconstraints)

includeImplementation(versionedCatalog["resourceful.lib"])
includeImplementation(versionedCatalog["resourceful.config"])
includeImplementation(versionedCatalog["olympus"])
includeImplementation(libs.resourcefulkt.config)
}

fun DependencyHandler.includeImplementation(dep: Any) {
include(dep)
modImplementation(dep)
}


val mcVersion = stonecutter.current.version.replace(".", "")
val accessWidenerFile = rootProject.file("src/customscoreboard.accesswidener")
loom {
runConfigs["client"].apply {
ideConfigGenerated(true)
runDir = "../../run"
vmArg("-Dfabric.modsFolder=" + '"' + rootProject.projectDir.resolve("run/${mcVersion}Mods").absolutePath + '"')
}

if (accessWidenerFile.exists()) {
accessWidenerPath.set(accessWidenerFile)
}

mixin {
defaultRefmapName = "customscoreboard-refmap.json"
}
}

ksp {
arg("meowdding.project_name", "CustomScoreboard")
arg("meowdding.package", "me.owdding.customscoreboard.generated")
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
withSourcesJar()
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
compilerOptions.optIn.add("kotlin.time.ExperimentalTime")
compilerOptions.freeCompilerArgs.add(
"-Xnullability-annotations=@org.jspecify.annotations:warn"
)
}

tasks.processResources {
val replacements = mapOf(
"version" to version,
"minecraft_start" to versionedCatalog.versions.getOrFallback("minecraft.start", "minecraft"),
"minecraft_end" to versionedCatalog.versions.getOrFallback("minecraft.end", "minecraft"),
"fabric_lang_kotlin" to libs.versions.fabric.language.kotlin.get(),
"rlib" to versionedCatalog.versions["resourceful-lib"],
"olympus" to versionedCatalog.versions["olympus"],
"sbapi" to libs.versions.skyblockapi.get(),
"mlib" to libs.versions.meowdding.lib.get(),
"rconfigkt" to libs.versions.rconfigkt.get(),
"rconfig" to versionedCatalog.versions["resourceful-config"],
)
inputs.properties(replacements)

filesMatching("fabric.mod.json") {
expand(replacements)
}
}

autoMixins {
mixinPackage = "me.owdding.customscoreboard.mixins"
projectName = "customscoreboard"
plugin = "com.moulberry.mixinconstraints.ConstraintsMixinPlugin"
}

idea {
module {
isDownloadJavadoc = true
isDownloadSources = true

excludeDirs.add(file("run"))
}
}

tasks.withType<ProcessResources>().configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filesMatching(listOf("**/*.fsh", "**/*.vsh")) {
filter { if (it.startsWith("//!moj_import")) "#${it.substring(3)}" else it }
}
with(copySpec {
from(rootProject.file("src/lang")).include("*.json").into("assets/customscoreboard/lang")
})
with(copySpec {
from(accessWidenerFile)
})
}

val archiveName = "CustomScoreboard"

base {
archivesName.set("$archiveName-${archivesName.get()}")
}

tasks.named("build") {
doLast {
val sourceFile = rootProject.projectDir.resolve("versions/${project.name}/build/libs/${archiveName}-${stonecutter.current.version}-$version.jar")
val targetFile = rootProject.projectDir.resolve("build/libs/${archiveName}-$version-${stonecutter.current.version}.jar")
targetFile.parentFile.mkdirs()
targetFile.writeBytes(sourceFile.readBytes())
}
}

tasks.withType<ValidateAccessWidenerTask> { enabled = false }
13 changes: 13 additions & 0 deletions build.obf.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
id("net.fabricmc.fabric-loom-remap")
`cs-setup`
}

dependencies {
mappings(loom.layered {
officialMojangMappings()
parchment(variantOf(versionedCatalog["parchment"]) {
artifactType("zip")
})
})
}
12 changes: 12 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ repositories {
maven("https://maven.teamresourceful.com/repository/maven-public/")
}

fun plugin(provider: Provider<PluginDependency>): Provider<String> = provider.map {
"${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}"
}

dependencies {
implementation("net.peanuuutz.tomlkt:tomlkt:0.5.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
implementation(libs.kotlin.stdlib)
implementation(libs.kotlin.gradle.plugin)
implementation(libs.kotlin.gradle.plugin.api)
implementation(plugin(libs.plugins.kotlin.symbol.processor))
implementation(plugin(libs.plugins.meowdding.auto.mixins))
implementation(plugin(libs.plugins.fabric.loom.asProvider()))
implementation(plugin(libs.plugins.fabric.loom.remap))
implementation("dev.kikugie.stonecutter:dev.kikugie.stonecutter.gradle.plugin:0.8.3")
}
Loading
Loading