Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
fix hotswapping
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Aug 24, 2024
1 parent 0f1c899 commit 7cf777d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class EventProcessor(private val codeGenerator: CodeGenerator, private val logge
override fun process(resolver: Resolver): List<KSAnnotated> {
val symbols = resolver.getSymbolsWithAnnotation(skylperEventPath).filterIsInstance<KSFunctionDeclaration>()

logger.warn("Found ${symbols.toList().size} to process!")
if (!symbols.iterator().hasNext()) return emptyList()

val file = codeGenerator.createNewFile(
Expand All @@ -28,7 +29,7 @@ class EventProcessor(private val codeGenerator: CodeGenerator, private val logge
import dev.nyon.skylper.skyblock.models.Area
object LoadedEvents {
val events = setOf(
val events = setOf(
""".trimIndent()
)
Expand Down
22 changes: 9 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ plugins {
id("com.google.devtools.ksp")

`maven-publish`
signing
}

val beta: Int? = 31 // Pattern is '1.0.0-beta1-1.20.6-pre.2'
val featureVersion = "1.0.0${if (beta != null) "-beta$beta" else ""}"
val beta: Int = 31 // Pattern is '1.0.0-beta1-1.20.6-pre.2'; when beta == 0 beta is null
val featureVersion = "1.0.0${if (beta != 0) "-beta$beta" else ""}"
val mcVersion = property("mcVersion")!!.toString()
val mcVersionRange = property("mcVersionRange")!!.toString()
val awVersion = if (stonecutter.compare(mcVersion, "1.21") >= 0) "1.21" else "1.20"
Expand Down Expand Up @@ -124,7 +123,6 @@ tasks {
}
}


register("releaseMod") {
group = "publishing"

Expand All @@ -137,6 +135,10 @@ tasks {
}

withType<KotlinCompile> {
inputs.files(
(project.file("../../src/main/kotlin/dev/nyon/skylper/extensions/event/").listFiles()?.map { it.path }
?: emptyList()).toTypedArray())

compilerOptions {
jvmTarget = JvmTarget.fromTarget(javaVersion)
}
Expand All @@ -145,8 +147,8 @@ tasks {

val changelogText = buildString {
append("# v${project.version}\n")
if (beta != null) append("### As this is still a beta version, this version can contain bugs. Feel free to report ANY misbehaviours and errors!")
rootProject.file("${if (beta != null) "beta-" else ""}changelog.md").readText().also { append(it) }
if (beta != 0) append("### As this is still a beta version, this version can contain bugs. Feel free to report ANY misbehaviours and errors!")
rootProject.file("${if (beta != 0) "beta-" else ""}changelog.md").readText().also { append(it) }
}

val supportedMcVersions: List<String> =
Expand All @@ -155,7 +157,7 @@ publishMods {
displayName = "v${project.version}"
file = tasks.remapJar.get().archiveFile
changelog = changelogText
type = if (beta != null) BETA else STABLE
type = if (beta != 0) BETA else STABLE
modLoaders.addAll("fabric", "quilt")

modrinth {
Expand Down Expand Up @@ -205,9 +207,3 @@ java {
targetCompatibility = it
}
}

/*
signing {
sign(publishing.publications)
}
*/
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx2G

0 comments on commit 7cf777d

Please sign in to comment.