From f6e12de95a702e97b0f01bb9e517f83ef657e43d Mon Sep 17 00:00:00 2001 From: Exlll Date: Sun, 21 Aug 2022 16:30:19 +0200 Subject: [PATCH] Update version to 4.2.0 **Support for polymorphic serialization** This release adds the Polymorphic and PolymorphicTypes annotations that can be used on types. Serializers for polymorphic types are not selected based on the compile-time types of configuration elements, but instead are chosen at runtime based on the actual types of their values. This enables adding instances of subclasses / implementations of a polymorphic type to collections. **Add SerializeWith annotation** This annotation enforces the use of the specified serializer for a configuration element or type. It can be applied to configuration elements (i.e. class fields and record components), to types, and to other annotations. **Add SerializerContext interface** Instances of this interface contain information about the context in which a serializer was selected. They are passed to the constructors of custom serializers if the serializers are instantiated by this library, or can alternatively be accessed through the new `addSerializerFactory` method of `ConfigurationProperties` objects. --- README.md | 12 ++++++------ build.gradle.kts | 2 +- buildSrc/src/main/kotlin/core-config.gradle.kts | 14 +++++++------- configlib-core/build.gradle.kts | 4 ---- .../java/de/exlll/configlib/PolymorphicTypes.java | 7 +++---- configlib-paper/src/main/resources/plugin.yml | 2 +- .../main/java/de/exlll/configlib/ConfigLib.java | 2 +- configlib-waterfall/src/main/resources/plugin.yml | 2 +- 8 files changed, 20 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3e2ff7d..2d3d68c 100644 --- a/README.md +++ b/README.md @@ -862,7 +862,7 @@ with `configlib-paper` (see [here](#support-for-bukkit-classes-like-itemstack)). com.github.Exlll.ConfigLib configlib-yaml - v4.1.0 + v4.2.0 ``` @@ -871,13 +871,13 @@ with `configlib-paper` (see [here](#support-for-bukkit-classes-like-itemstack)). ```groovy repositories { maven { url 'https://jitpack.io' } } -dependencies { implementation 'com.github.Exlll.ConfigLib:configlib-yaml:v4.1.0' } +dependencies { implementation 'com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0' } ``` ```kotlin repositories { maven { url = uri("https://jitpack.io") } } -dependencies { implementation("com.github.Exlll.ConfigLib:configlib-yaml:v4.1.0") } +dependencies { implementation("com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0") } ``` @@ -901,7 +901,7 @@ this [issue](https://github.com/Exlll/ConfigLib/issues/12) if you have any troub de.exlll configlib-yaml - 4.1.0 + 4.2.0 ``` @@ -910,13 +910,13 @@ this [issue](https://github.com/Exlll/ConfigLib/issues/12) if you have any troub ```groovy repositories { maven { url 'https://maven.pkg.github.com/Exlll/ConfigLib' } } -dependencies { implementation 'de.exlll:configlib-yaml:4.1.0' } +dependencies { implementation 'de.exlll:configlib-yaml:4.2.0' } ``` ```kotlin repositories { maven { url = uri("https://maven.pkg.github.com/Exlll/ConfigLib") } } -dependencies { implementation("de.exlll:configlib-yaml:4.1.0") } +dependencies { implementation("de.exlll:configlib-yaml:4.2.0") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 3a46f06..e8e63fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "de.exlll" - version = "4.1.0" + version = "4.2.0" } diff --git a/buildSrc/src/main/kotlin/core-config.gradle.kts b/buildSrc/src/main/kotlin/core-config.gradle.kts index eb05b34..a6ef1ce 100644 --- a/buildSrc/src/main/kotlin/core-config.gradle.kts +++ b/buildSrc/src/main/kotlin/core-config.gradle.kts @@ -23,13 +23,13 @@ repositories { } dependencies { - testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") - testFixturesApi("org.junit.jupiter:junit-jupiter-params:5.8.2") - testFixturesApi("org.junit.jupiter:junit-jupiter-engine:5.8.2") - testFixturesApi("org.junit.platform:junit-platform-runner:1.8.2") - testFixturesApi("org.junit.platform:junit-platform-suite-api:1.8.2") - testFixturesApi("org.mockito:mockito-inline:4.2.0") - testFixturesApi("org.mockito:mockito-junit-jupiter:4.2.0") + testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.9.0") + testFixturesApi("org.junit.jupiter:junit-jupiter-params:5.9.0") + testFixturesApi("org.junit.jupiter:junit-jupiter-engine:5.9.0") + testFixturesApi("org.junit.platform:junit-platform-runner:1.9.0") + testFixturesApi("org.junit.platform:junit-platform-suite-api:1.9.0") + testFixturesApi("org.mockito:mockito-inline:4.7.0") + testFixturesApi("org.mockito:mockito-junit-jupiter:4.7.0") testFixturesApi("org.hamcrest:hamcrest-all:1.3") testFixturesApi("com.google.jimfs:jimfs:1.2") } diff --git a/configlib-core/build.gradle.kts b/configlib-core/build.gradle.kts index 71ff8c2..b2e16f5 100644 --- a/configlib-core/build.gradle.kts +++ b/configlib-core/build.gradle.kts @@ -1,7 +1,3 @@ plugins { `core-config` -} - -dependencies { - implementation("org.snakeyaml:snakeyaml-engine:2.3") } \ No newline at end of file diff --git a/configlib-core/src/main/java/de/exlll/configlib/PolymorphicTypes.java b/configlib-core/src/main/java/de/exlll/configlib/PolymorphicTypes.java index 1a59186..ddf86f9 100644 --- a/configlib-core/src/main/java/de/exlll/configlib/PolymorphicTypes.java +++ b/configlib-core/src/main/java/de/exlll/configlib/PolymorphicTypes.java @@ -12,12 +12,11 @@ import java.lang.annotation.Target; *
  * {@code
  * @Polymorphic
- * @PolymorphicTypes({
+ * @PolymorphicTypes( {
  *         @PolymorphicTypes.Type(type = Impl1.class, alias = "IMPL_1"),
  *         @PolymorphicTypes.Type(type = Impl2.class, alias = "IMPL_2")
- * }
- * })
- * {@code
+ * })
+ *
  * interface A { ... }
  *
  * record Impl1(...) implements A { ... }
diff --git a/configlib-paper/src/main/resources/plugin.yml b/configlib-paper/src/main/resources/plugin.yml
index a49d799..7aca02d 100644
--- a/configlib-paper/src/main/resources/plugin.yml
+++ b/configlib-paper/src/main/resources/plugin.yml
@@ -1,5 +1,5 @@
 name: ConfigLib
-version: 4.1.0
+version: 4.2.0
 website: https://github.com/Exlll/ConfigLib
 description: A library for working with YAML configurations.
 author: Exlll
diff --git a/configlib-velocity/src/main/java/de/exlll/configlib/ConfigLib.java b/configlib-velocity/src/main/java/de/exlll/configlib/ConfigLib.java
index 1c3d502..a96f86e 100644
--- a/configlib-velocity/src/main/java/de/exlll/configlib/ConfigLib.java
+++ b/configlib-velocity/src/main/java/de/exlll/configlib/ConfigLib.java
@@ -8,7 +8,7 @@ import com.velocitypowered.api.plugin.Plugin;
 @Plugin(
         id = "configlib",
         name = "ConfigLib",
-        version = "4.1.0",
+        version = "4.2.0",
         url = "https://github.com/Exlll/ConfigLib",
         description = "A library for working with YAML configurations.",
         authors = {"Exlll"}
diff --git a/configlib-waterfall/src/main/resources/plugin.yml b/configlib-waterfall/src/main/resources/plugin.yml
index 74aaba4..1e8aae6 100644
--- a/configlib-waterfall/src/main/resources/plugin.yml
+++ b/configlib-waterfall/src/main/resources/plugin.yml
@@ -1,5 +1,5 @@
 name: ConfigLib
-version: 4.1.0
+version: 4.2.0
 website: https://github.com/Exlll/ConfigLib
 description: A library for working with YAML configurations.
 author: Exlll