Hello! I released AutoKonfig, a Kotlin library for...
# feed
m
Hello! I released AutoKonfig, a Kotlin library for configuration files (and command line arguments) with many features I hope are useful and a goal to make it "just work" while being very simple to use. Zero lines of code required for setup, get values from your config file right away. https://autokonfig.nohus.dev/
👍 5
d
m
@doker In Konfig, you have explicitely specify the key name when creating a key object
val port = Key("port", intType)
, then create a Configuration object, then access your value from the Configuration object using the key object you created. With AutoKonfig you don't need any of that, just
val port by IntSetting()
is working by itself, while still allowing you to do all of that customization if needed, but covering most cases without requiring the user to do anything (create key objects and configuration objects). Notice how in AutoKonfig the
port
variable is already containing the value from your config file, not a key object than you have to use to retrieve it with proceeding code. Similarly in Konf, you are creating keys which you then use to access values from Config objects, which is extra effort I wanted to avoid. It was also a goal for me to have 100% unit test coverage, which both of these libraries lack. Both of these libraries work great and I tried them (and more) and thought about their API's before designing AutoKonfig. I wanted something which requires the least effort possible for the majority of use cases (and allow more advanced usage, which would be the usual usage for other libraries).
👍 3
d
Thanks for the explanation. Looks superior, I'll definitely give it a try
x
Looks very well done, with also a clean and simple documentation. Congrats @Marcin Wisniowski! Will give it a try
a
What about multiplatform support? Like https://github.com/yshrsmz/BuildKonfig
m
I only target the JVM for now so if you need Kotlin/Native or Kotlin/JS, you would need to look elsewhere. PR's welcome though. : )
m
Property source tracing is nice as well, I will try that