Archived
1
0
Fork
You've already forked kittyconfig
2
generated from sery/template_mod
dumb kotlin config library you shouldn't use
This repository has been archived on 2026年03月20日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Kotlin 100%
Find a file
2025年08月26日 19:36:30 +02:00
buildSrc quoip 2025年08月26日 19:18:41 +02:00
core commit 2025年08月26日 19:36:30 +02:00
gradle/wrapper wowwowo 2025年03月25日 17:36:03 +01:00
gradle-plugin commit 2025年08月26日 19:36:30 +02:00
json5 commit 2025年08月26日 19:36:30 +02:00
minecraft commit 2025年08月26日 19:36:30 +02:00
processor commit 2025年08月26日 19:36:30 +02:00
test commit 2025年08月26日 19:36:30 +02:00
toml commit 2025年08月26日 19:36:30 +02:00
.gitignore loots of stuf 2025年03月23日 02:56:15 +01:00
build.gradle.kts quoip 2025年08月26日 19:18:41 +02:00
gradle.properties commit 2025年08月26日 19:36:30 +02:00
gradlew commit 1 2025年03月20日 03:47:51 +01:00
gradlew.bat commit 1 2025年03月20日 03:47:51 +01:00
libs.versions.toml commit 2025年08月26日 19:36:30 +02:00
LICENSE uhhh 2025年07月31日 18:28:11 +02:00
README.md Update README.md 2025年08月02日 23:26:23 +02:00
settings.gradle.kts meow 2025年08月10日 03:26:15 +02:00

kittyconfigg :3

A silly kotlin config library heavily integrated with kotlinx.serialization.

Gradle

settings.gradle.kts

pluginManagement {
 repositories {
 maven(url = "https://maven.is-immensely.gay/nightly")
 }
}

build.gradle.kts

plugins {
 // Apply the kitty config gradle plugin in addition to any others u may use
 id("uwu.serenity.kittyconfig") version "<version>"
}
repositories {
 // Once kitty config is stable change this to releases
 // If using json5 u will additionally need the releases repo for json5k
 maven(url = "https://maven.is-immensely.gay/nightly")
 mavenCentral()
}
dependencies {
 // should pull in kotlinx.serialization transitively
 implementation("uwu.serenity.kittyconfig:kittyconfig:<version>")
 // If you also want a bundled formt (json5 or toml)
 implementation("uwu.serenity.kittyconfig:kittyconfig-<format>:<version>")
 
 // If you are making a minecraft mod, you wanna depend on kittyconfig-mc instead
 // Example: fabric loom
 modImplementation("uwu.serenity.kittyconfig:kittyconfig-mc:<version>") {
 // Extensions proviced by the gradle plugin :3
 loader = "<loader>"
 version = "<version>"
 }
}

Usage

@Config(
 id = "<id>",
 format = MyFormat::class, // Optional, will use default format provided by plguins (if available) when none is specified
 implicitContextual = true // Optional, defaults to true
)
// If using kittyconfig-mc we can also specify our config to be synced to client
/* @SyncToClient */
object MyConfig {
 
 @Comment("This is a silly comment")
 var mySillyField: Boolean = true
 
 @Comment("""
 Multiple lines of dumb
 words
 """)
 var mySillyCollectionField: List<String> = listOf("awawa", "awaww")
 
 var mySerializableField: MySerializableClass = MySerializableClass()
 
 var customSerializerField: @Serializable(SomeClassSerializer::class) SomeClass = Uwu()
 
 @Comment("Categories can also have comments")
 object Category {
 
 @Comment("An int field with range")
 var intFieldWithRange: @Range(0, 5) Int = 3
 
 var stringWIthPattern: @Pattern("[0-9a-z/]+") String = "meow"
 }
}

To load a config, do

fun main() {
 loadConfig(MyConfig, /* optionally provide a directory */)
}