Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit f57a69e

Browse files
author
DaRacci
committed
chore: prepare for modrinth and fix compilation
1 parent ac3a62a commit f57a69e

File tree

12 files changed

+59
-28
lines changed

12 files changed

+59
-28
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cog-scripts"]
2+
path = cog-scripts
3+
url = https://github.com/DaRacci/cog-scripts.git

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
[![Servers](https://img.shields.io/bstats/servers/13706?color=purple&style=for-the-badge)](https://bstats.org/plugin/bukkit/Minix/13706)
1717
[![Players](https://img.shields.io/bstats/players/13706?color=purple&style=for-the-badge)](https://bstats.org/plugin/bukkit/Minix/13706)
1818

19-
Minix is library written for purpur based plugins, providing full integration with [KotlinX Coroutines](https://github.com/Kotlin/kotlinx.coroutines) for easy Async integration with the Bukkit API.
19+
Minix is the most advanced and performant framework to build plugins on!</br>
20+
With full in depth support for kotlin coroutines and many useful utilities and quality of life features for developers.</br>
21+
Minix makes developing performant, non-blocking code easy and concise.</br>
2022

21-
</div>
23+
# Minix is currently in a state of heavy development for the upcoming 5.0.0 release, all features are subject to change and may not be fully documented.
24+
# Coming from version 4.x.x to 5.0.0 will require a lot of code changes, please be aware of this before starting development before the release of version 5.0.0.
2225

23-
## Plugin Information
24-
*Supports Paper 1.19.3 (Planned support for more than one NMS Version)
26+
</div>
2527

2628
## Docs
2729
*The docs can be found [here](https://minix.racci.dev)

build.gradle.kts

+26-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import dev.racci.minix.gradle.data.MCTarget
33
import dev.racci.minix.gradle.ex.shadowJar
44
import dev.racci.minix.gradle.ex.whenEvaluated
55
import dev.racci.minix.gradle.ex.withMCTarget
6+
import dev.racci.minix.gradle.extensions.MinixPublishingExtension.PublicationSpec.Version
67
import dev.racci.paperweight.mpp.paperweightDevBundle
78
import dev.racci.paperweight.mpp.reobfJar
89
import dev.racci.slimjar.extensions.slimApi
@@ -25,7 +26,7 @@ val relocatePrefix = "dev.racci.minix.libs"
2526
@Suppress("DSL_SCOPE_VIOLATION")
2627
plugins {
2728
alias(libs.plugins.kotlin.mpp)
28-
id("dev.racci.minix") version "0.3.1"
29+
alias(libs.plugins.minix)
2930
id("dev.racci.paperweight.mpp")
3031
alias(libs.plugins.shadow)
3132
id("dev.racci.slimjar") version "2.0.0-SNAPSHOT"
@@ -40,6 +41,7 @@ plugins {
4041

4142
alias(libs.plugins.minecraft.pluginYML) // TODO: MPP
4243
alias(libs.plugins.minecraft.runPaper)
44+
alias(libs.plugins.minecraft.minotaur)
4345
}
4446

4547
koverMerged {
@@ -304,6 +306,28 @@ kotlin {
304306
}
305307
}
306308

309+
modrinth {
310+
val versionSpec = Version.parse(version.toString())
311+
312+
token.set(properties["modrinth.token"].toString())
313+
projectId.set("OtoWQs96")
314+
versionNumber.set("${versionSpec.major}.${versionSpec.minor}.${versionSpec.patch}")
315+
syncBodyFrom.set(file("README.md").readText())
316+
changelog.set(file("CHANGELOG.md").readText())
317+
versionType.set(
318+
when (versionSpec.snapshotType) {
319+
null -> "release"
320+
"SNAPSHOT" -> "beta"
321+
else -> error("Unknown snapshot type: ${versionSpec.snapshotType}")
322+
}
323+
)
324+
325+
uploadFile.set(kotlin.targets["paper"].reobfJar.get())
326+
327+
gameVersions.add(libs.versions.minecraft.get().substringBefore('-'))
328+
loaders.addAll("paper", "purpur")
329+
}
330+
307331
val reportMerge by tasks.registering<ReportMergeTask> {
308332
output.set(buildDir.resolve("reports/detekt/detekt.sarif"))
309333
}
@@ -322,13 +346,7 @@ tasks {
322346
relocate("org.koin.ksp.generated", "$relocatePrefix.generated.koin")
323347
}
324348

325-
named<Detekt>("detekt") {
326-
// Depend on all other detekt tasks.
327-
// dependsOn(
328-
// withType<Detekt>().filter { it.name != this.name },
329-
// subprojects.flatMap { it.tasks.withType<Detekt>() }
330-
// )
331-
}
349+
modrinth.get().dependsOn(modrinthSyncBody)
332350
}
333351

334352
subprojects {

cog-scripts

Submodule cog-scripts added at d295740

cog.toml

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ pre_bump_hooks = [
44
post_bump_hooks = [
55
"bash -c \"scripts/post-bump.sh {{latest}} {{version}} {{version+patch-SNAPSHOT}}\"",
66
]
7+
pre_bump_hooks = [
8+
"nu -c \"cog-scripts/src/pre-bump.nu {{latest}} {{version}}\"",
9+
]
10+
post_bump_hooks = [
11+
"nu -c \"cog-scripts/src/post-bump.nu Minix {{latest}} {{version}} {{version+patch-SNAPSHOT}} -r -p [.,module-autoscanner,module-common,module-data,module-flowbus,module-integrations,module-jumper,module-ticker]\"",
12+
]
713

814
tag_prefix = "v"
915

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
group=dev.racci
33
version=5.0.0-SNAPSHOT
44
kotlinVersion=1.8.0
5-
minixVersion=1
5+
minixBuild=3
66

77
org.gradle.jvmargs=-Xmx4096m
88
ksp.incremental.intermodule=true

minix-modules/module-data/src/main/kotlin/dev/racci/minix/data/delegates/AccessWatcher.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ public class AccessWatcher private constructor(
7474

7575
/**
7676
* A Variant of [AccessWatcher] that will return true if the property is accessed twice within 500 Milliseconds.
77+
*
78+
* @param delay The duration of time that if [count] calls are received within will result in a true result.
7779
*/
7880
@Experimental
7981
@AvailableSince("5.0.0")
8082
@Suppress("UnusedReceiverParameter")
81-
public fun Delegates.doubleAccessWatcher(): ReadOnlyProperty<Any?, Boolean> = AccessWatcher.of(500.milliseconds, 2)
83+
public fun Delegates.doubleAccessWatcher(
84+
delay: Duration = 500.milliseconds
85+
): ReadOnlyProperty<Any?, Boolean> = AccessWatcher.of(delay, 2)

minix-plugin/api-paper/src/main/kotlin/dev/racci/minix/api/data/MinixPlayer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import dev.racci.minix.api.extensions.offlinePlayer
66
import dev.racci.minix.api.extensions.reflection.safeCast
77
import dev.racci.minix.api.services.PlayerService
88
import dev.racci.minix.api.wrappers.WrapperCompanion
9-
import dev.racci.minix.data.extensions.doubleAccessWatcher
9+
import dev.racci.minix.data.delegates.doubleAccessWatcher
1010
import net.kyori.adventure.text.Component
1111
import org.bukkit.OfflinePlayer
1212
import org.bukkit.entity.Player

minix-plugin/api-paper/src/main/kotlin/dev/racci/minix/api/plugin/MinixPlugin.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public actual abstract class MinixPlugin :
3737
actual final override val plugin: MinixPlugin get() = this
3838
actual final override val logger: MinixLogger by MinixLoggerFactory.lazy
3939
actual final override val dataFolder: Path get() = this.getDataFolder().toPath()
40-
actual final override val version: Version by lazy { Version(this.description.version) }
40+
actual final override val version: Version by lazy { Version.parseString(this.description.version) }
4141
actual final override val dependencies: ImmutableSet<String> by lazy<ImmutableSet<String>>((this.description.depend + this.description.softDepend)::toImmutableSet)
4242
actual final override val coroutineSession: CoroutineSession by lazy { scope.get() }
4343

minix-plugin/api-paper/src/main/kotlin/dev/racci/minix/api/plugin/PlatformPlugin.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public actual interface PlatformPlugin : Qualifier, Comparable<PlatformPlugin> {
3535

3636
return object : PlatformPlugin {
3737
override val value: String = obj.name
38-
override val version: Version by lazy { Version(obj.description.version) }
38+
override val version: Version by lazy { Version.parseString(obj.description.version) }
3939
override val dataFolder: Path = obj.dataFolder.toPath()
4040
override val dependencies: ImmutableSet<String> by lazy { (obj.description.depend + obj.description.softDepend).toImmutableSet() }
4141
override val platformClassLoader: ClassLoader by suspendBlockingLazy {

paperweight-mpp/settings.gradle.kts

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ dependencyResolutionManagement {
2525

2626
versionCatalogs.create("libs") {
2727
val properties = Properties().apply { load(rootDir.toPath().resolveSibling(Project.GRADLE_PROPERTIES).toFile().inputStream()) }
28-
29-
val minixVersion: String by properties
28+
val minixBuild: String by properties
3029
val kotlinVersion: String by properties
31-
val conventions = kotlinVersion.plus("-").plus(minixVersion.substringAfterLast('.'))
32-
30+
val conventions = kotlinVersion.plus("-").plus(minixBuild)
3331
from("dev.racci:catalog:$conventions")
3432
}
3533
}

settings.gradle.kts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
@file:Suppress("UnstableApiUsage")
2-
31
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
42

3+
rootProject.name = "Minix"
4+
55
pluginManagement {
66
repositories {
77
mavenLocal()
88
mavenCentral()
99
gradlePluginPortal()
1010
maven("https://repo.racci.dev/releases")
11+
maven("https://repo.racci.dev/snapshots")
1112
maven("https://papermc.io/repo/repository/maven-public/")
1213
}
1314
}
1415

16+
@Suppress("UnstableApiUsage")
1517
dependencyResolutionManagement {
1618
repositories {
1719
mavenCentral()
@@ -25,16 +27,13 @@ dependencyResolutionManagement {
2527
}
2628

2729
versionCatalogs.create("libs") {
28-
val minixVersion: String by settings
30+
val minixBuild: String by settings
2931
val kotlinVersion: String by settings
30-
val conventions = kotlinVersion.plus("-").plus(minixVersion.substringAfterLast('.'))
31-
32+
val conventions = kotlinVersion.plus("-").plus(minixBuild)
3233
from("dev.racci:catalog:$conventions")
3334
}
3435
}
3536

36-
rootProject.name = "Minix"
37-
3837
includeBuild("paperweight-mpp")
3938

4039
sequenceOf(

0 commit comments

Comments
 (0)