Skip to content

Releases: jdiazcano/cfg4k

Symbolic links

17 Mar 13:15
Compare
Choose a tag to compare

This version is just a bugfix to follow symbolic links when reloading a file (#65) and update versions for the various libraries (like kotlin to 1.3.70)

0.9.41

30 Apr 18:31
Compare
Choose a tag to compare

Fixed a bad merge

Bugfixes and test rework

26 Apr 20:21
Compare
Choose a tag to compare

This one is composed mostly by bugfixes and rework on how the tests are done and finally getting rid of Spek 1 which caused a lot of pain when trying to debug things, IDE exceptions etc...

Bugfixes:

  • Fixed #57
  • Fixed a bug where the equality of ConfigObjects wouldn't be true at some point
  • Now values aren't going to be overridden when a property has a root and children at the same time, a warning will be shown (it was already showing a warning if the root was direct)
  • Now nulls won't be cached in getOrNull inside a CachedConfigProvider
  • Added support for lists inside properties objects. (CATCH: The order of the items in the list will be unpredictable, so don't rely on this if you need a sorted list)

Rework

Now instead of Spek 1, Kotlintest is being used (latest version). With this rework I had to think better how to test and increase the test coverage. Also every file has its test file equivalent which was not true before, basically everything was a Functional test!

More complex types and rework

05 Mar 17:15
Compare
Choose a tag to compare

In this release a huge rework of the source code has been done. Some methods have been removed and some have been added from the API.

  1. Now it supports all kind of complex objects and maps. Everything will be transformed for you (not supported in properties, system properties or environment variables as the process to parse that into a root ConfigObject can be different in each case, you can always implement your own loader to do this). Some examples:
    1. List<List<Int>>
    2. Map<String, Map<Int, List<String>>>
  2. The signature for the Parser has changed: context: ConfigContext, value: ConfigObject, typeStructure: TypeStructure.
    Now it will receive an object which is the context (similar to Gson for example), where you will be able to parse a subtype or a property from your complex object. A new object has been introduced which is the TypeStructure this will hold the structure of the generic type of your object, for example from List<List<Int>>, the type structure will be this:
    1. type: List<List> and generics: List
    2. type: List and generics: Int
  3. Removed methods from the ConfigProvider interface:
    1. get(name: String, type: Class<T>, default: T?): T
    2. getOrNull(name: String, type: Class<T>, default: T?): T?
  4. Added data class support, now data classes will be instantiated like if they were interfaces but not giving back a proxy but an actual instance of the class.

Those two methods have been removed in favor of the same method with the change of type, type: Type. These methods should be better used with the extension functions get<List<String>>() as they will hide for you the work of transforming a generic into a Type object.

S3, System and Environment as DCL

18 Aug 18:16
Compare
Choose a tag to compare

Now SystemPropertyConfigLoader and EnvironmentConfigLoader extends DefaultConfigLoader so merges and binding will work with them.

There is one caveat, that is the SystemProperty actually has something like:

a=1
a.b=2

Which is perfectly viable in properties. But when translating that to an object it cannot be represented (for example you cannot do that in JSON). If that happens a warning will be emitted and it will only happen with a java property in the SystemPropertyConfigLoader (or if you do the wrong thing in a properties file)

More sources!

07 Mar 20:43
Compare
Choose a tag to compare
More sources! Pre-release
Pre-release
  • Added sources for:
    • Bitbucket
    • Github
    • String
    • StringRotation (list of strings that will be rotated on reload)
  • Revamped ByteBuddyBinder and now it holds a cache so classes won't be recompiled everytime
  • Added merge to ConfigLoader so you can merge before adding it to a provider.
  • Reusable TimedReloadStrategy
  • Auth in URLConfigSource
  • Code cleaning up

Complex lists

05 Aug 23:15
Compare
Choose a tag to compare
Complex lists Pre-release
Pre-release
  • Nos lists can contain complex objects and the library will handle them all
  • Bugfixes and code improvements

Default binder and Override provider

07 Feb 22:59
Compare
Choose a tag to compare
Pre-release
  • Now the default binder will be the ProxyBinder
  • Now the OverrideConfigProvider takes a vararg of config providers instead of loaders. This makes the binding and reloadstrategy be separated in each provider so you can have a different streategy for each one. The problem was that you only had one reload strategy and for example a classpath resource file won't change so there is no need to reload them!
  • Now the provider has a new method of "contains" to check if there is instead of checking null later on

Git, default values and parsers

06 Feb 18:40
Compare
Choose a tag to compare
Pre-release
  • Added Git config loader
  • Added parsers to deal with time and date
  • Now the settings can be used with a default value, if there is no setting and no default value, an exception will be thrown.
  • Minor code updates

YAML, Environment and System settings

28 Jan 00:38
Compare
Choose a tag to compare
Pre-release
  • Added Support environment variables
  • Added Create SystemSettingConfigLoader
  • Fixed Bytebuddy binding is not working properly
  • Added YAML config loader