Skip to content

Commit 0af6d01

Browse files
committed
Merge branch 'dev' for release 0.91.0-RC1
# Conflicts: # README.md
2 parents f9389da + aa608c5 commit 0af6d01

File tree

141 files changed

+4995
-2735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+4995
-2735
lines changed

Changelog.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
# 0.91.0-RC1-SNAPSHOT
2+
3+
Features:
4+
- Add a core-io and serialization-io modules that support using kotlinx.io
5+
- Add inline function shortcuts for encodeToString/decodeFromString with
6+
prefix/qname parameter that also take their serializer from the type
7+
parameter instead of as explicit parameter.
8+
- Support both the default polymorphic serializer and handling unknown
9+
elements broadly, in particular inside value items (as list). #256.
10+
For handling unknown values the implementation now attempts to detect
11+
the unknown element handler not consuming the element and will in such
12+
case parse the remaining elements (This uses input.location so the
13+
reader must support that).
14+
- (Finally) support running in node (falling back to the generic
15+
implementation rather than the dom implementation). Note that this
16+
does not inject a DOM implementation, so DOM handling will not work
17+
unless an alternative compatible implementation is already present.
18+
- The cache feature has been improved: it is now a proper LRU cache;
19+
it has better key matching (more matches)
20+
- Add further inline shortcuts for encodeToString that take
21+
tagname/prefix parameters.
22+
- Implement handling of whitespace preservation, including handling
23+
the attribute cascading to child tags. Types can now specify their
24+
own defaults.
25+
26+
Changes:
27+
- Build with Kotlin 2.1.10
28+
- Fix smart attribute writing to not use the null prefix for a
29+
non-null namespace (even when bound to the null-namespace).
30+
Attributes with null prefix are always in the null namespace.
31+
- Build with Kotlin 2.1.0. This means that except for `core-android`
32+
the other `-android` artefacts are now deprecated. They are separate
33+
synthetic configurations that only forward dependencies.
34+
- `encodeToWriter` will now flush the writer. This is particularly
35+
relevant in the context of `OutputStreamWriter` that doesn't write
36+
content until flushed or closed.
37+
- Serialization no longer loads jdk/android specific modules for
38+
parsing (when loaded they will be used in creating serializers/parsers)
39+
- getElementsByTagName(Ns) now supports wildcards (*)
40+
41+
Fixes:
42+
- Make getElementsByTagName(Ns) return all descendents (not only children)
43+
per the DOM standard #265.
44+
- Don't detect end of cdata (incorrectly) inside a string #266.
45+
- Make recovery work more broadly, including handling text/cdata #253.
46+
- Make defaultSerializer work #256.
47+
- Fixed cache keys (this caused inefficiency and memory leaks #264). The
48+
memory leaks are also addressed using an LRU cache.
49+
- When parsing text with entity content don't mark initial/trailing
50+
whitespace as ignorable, even when the result is parsed as
51+
separate events. Fixes #241.
52+
- When creating a default cache doesn't work, fall back to not
53+
caching (#255).
54+
- Some work to handle the misconfiguration of multiple types with
55+
equal `SerialName` in the same context leading to invalid cache
56+
hits (#254)
57+
- Various fixes to handling of `xml:space` and `@XmlIgnoreWhitespace`. Note
58+
that xml:space="preserve" in a document overrides handling for all
59+
children. xml:space="default" gets back to default handling. Types
60+
by default inherit their whitespace handling from their owners. When
61+
the `@XmlIgnoreWhitespace` annotation is presented, this will change
62+
the default for that type/element and its members.
63+
- Fix automatic prefix generation for attributes (was an infinite
64+
loop: #251). Make it reuse existing prefixes if present rather than
65+
write a new prefix. If reuse is not desirable, explicitly declare
66+
the prefixes on the element using `@XmlNamespaceDeclSpec`
67+
- Fix (make consistent) the handling of `@XmlChildrenName` when the
68+
namespace attribute is left out/default (#252). It would use the
69+
empty/null namespace rather than the behaviour of `XmlSerialName`
70+
which defaults to the namespace of the parent tag. The behaviour
71+
is now consistent. For those cases where the original behaviour
72+
is needed, just specify the namespace explitly to be the empty
73+
string.
74+
175
# 0.90.3
276
Changes:
377
- In pedantic mode check that xml/xmlns are not used as names (they

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ package. The `JVM` and `Android` packages provide the native
8585
implementations and depend on (publishing) the `jvmCommon` package.
8686
#### multiplatform (will default to multiplatform implementation for JVM/Android)
8787
```
88-
implementation("io.github.pdvrieze.xmlutil:core:0.90.3")
88+
implementation("io.github.pdvrieze.xmlutil:core:0.91.0-RC1")
8989
```
9090
#### **Optional** JVM – uses the stax API _not available_ on Android
9191
```
92-
implementation("io.github.pdvrieze.xmlutil:core-jdk:0.90.3")
92+
implementation("io.github.pdvrieze.xmlutil:core-jdk:0.91.0-RC1")
9393
```
9494
#### **Optional** Android – Uses the android streaming library
9595
```
96-
implementation("io.github.pdvrieze.xmlutil:core-android:0.90.3")
96+
implementation("io.github.pdvrieze.xmlutil:core-android:0.91.0-RC1")
9797
```
9898
#### JS – Wraps DOM
9999
```
100-
implementation("io.github.pdvrieze.xmlutil:core-js:0.90.3")
100+
implementation("io.github.pdvrieze.xmlutil:core-js:0.91.0-RC1")
101101
```
102102

103103
#### Native
@@ -108,19 +108,24 @@ that mirrors the Java API)
108108
### Serialization
109109
#### multiplatform
110110
```
111-
implementation("io.github.pdvrieze.xmlutil:serialization:0.90.3")
111+
implementation("io.github.pdvrieze.xmlutil:serialization:0.91.0-RC1")
112112
```
113113
#### JVM
114114
```
115-
implementation("io.github.pdvrieze.xmlutil:serialization-jvm:0.90.3")
115+
implementation("io.github.pdvrieze.xmlutil:serialization-jvm:0.91.0-RC1")
116116
```
117-
#### Android
117+
#### -Android- (Deprecated - this is dependency only - it has no code)
118+
** Deprecated **
118119
```
119-
implementation("io.github.pdvrieze.xmlutil:serialization-android:0.90.3")
120+
implementation("io.github.pdvrieze.xmlutil:serialization-android:0.91.0-RC1")
120121
```
122+
123+
This version is merely a dependency to the main module that no longer has the android
124+
specific artefact as this is not supported by kotlin (and has resolution issues).
125+
121126
#### js
122127
```
123-
implementation("io.github.pdvrieze.xmlutil:serialization-js:0.90.3")
128+
implementation("io.github.pdvrieze.xmlutil:serialization-js:0.91.0-RC1")
124129
```
125130

126131
### -Ktor- (Deprecated)

benchmark/src/jvmMain/kotlin/nl/adaptivity/xmlutil/benchmark/Deserialization.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ open class Deserialization {
4040

4141
val suites: List<Pair<URL, URL>> = testXmlSchemaUrls(XML { recommended_0_87_0() })
4242

43-
val readers: List<Pair<URL, XmlBufferReader>> by lazy {
43+
val readers: List<Pair<URL, XmlBufferReader>> by lazy(LazyThreadSafetyMode.NONE) {
4444
suites
4545
.map { (_, u) ->
4646
u.openStream().use { input ->

benchmark/src/jvmMain/kotlin/nl/adaptivity/xmlutil/benchmark/Parsing.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ open class Parsing {
4545
recommended_0_87_0()
4646
}
4747

48-
val suites: List<Pair<URL, URL>> by lazy {
48+
val suites: List<Pair<URL, URL>> by lazy(LazyThreadSafetyMode.NONE) {
4949
testXmlSchemaUrls(xml)
5050
}
5151

benchmark/src/jvmMain/kotlin/nl/adaptivity/xmlutil/benchmark/Serialization.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ open class Serialization {
4343

4444
val suites: List<Pair<URL, URL>> = testXmlSchemaUrls(XML { recommended_0_87_0() })
4545

46-
val schemas: List<Pair<URL, XSSchema>> by lazy {
46+
val schemas: List<Pair<URL, XSSchema>> by lazy(LazyThreadSafetyMode.PUBLICATION) {
4747
val xml = XML { recommended_0_90_2() }
4848
suites
4949
.map { (_, u) ->

build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
2222
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
23+
import org.jetbrains.dokka.gradle.DokkaTask
2324
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
2425
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
2526
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
@@ -105,5 +106,14 @@ idea {
105106
}
106107
}
107108

108-
tasks.withType<DokkaMultiModuleTask>().configureEach {
109+
dependencies {
110+
dokka(projects.core)
111+
dokka(projects.coreJdk)
112+
dokka(projects.coreAndroid)
113+
dokka(projects.serialization)
114+
dokka(projects.serialutil)
115+
}
116+
117+
tasks.dokkaHtml {
118+
val x: DokkaTask? = this
109119
}

core/android/src/main/kotlin/nl/adaptivity/xmlutil/core/AndroidStreamingFactory.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ public class AndroidStreamingFactory : XmlStreamingFactory {
4949
}
5050

5151
@Throws(XmlException::class)
52+
@Deprecated("Usage of results only works on the JVM", level = DeprecationLevel.ERROR)
5253
override fun newWriter(result: Result, repairNamespaces: Boolean, xmlDeclMode: XmlDeclMode): XmlWriter {
5354
throw UnsupportedOperationException("Results are not supported on Android")
5455
}
5556

57+
@Deprecated("Usage of sources only works on the JVM", level = DeprecationLevel.ERROR)
5658
@Throws(XmlException::class)
5759
override fun newReader(source: Source): XmlReader {
5860
throw UnsupportedOperationException("Sources are not supported on Android")

core/base/api/core.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ public final class nl/adaptivity/xmlutil/XmlReader$DefaultImpls {
559559

560560
public final class nl/adaptivity/xmlutil/XmlReader$ExtLocationInfo : nl/adaptivity/xmlutil/XmlReader$LocationInfo {
561561
public fun <init> (III)V
562+
public fun equals (Ljava/lang/Object;)Z
563+
public fun hashCode ()I
562564
public fun toString ()Ljava/lang/String;
563565
}
564566

@@ -567,6 +569,8 @@ public abstract interface class nl/adaptivity/xmlutil/XmlReader$LocationInfo {
567569

568570
public final class nl/adaptivity/xmlutil/XmlReader$StringLocationInfo : nl/adaptivity/xmlutil/XmlReader$LocationInfo {
569571
public fun <init> (Ljava/lang/String;)V
572+
public fun equals (Ljava/lang/Object;)Z
573+
public fun hashCode ()I
570574
public fun toString ()Ljava/lang/String;
571575
}
572576

core/base/api/core.klib.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,12 +673,16 @@ abstract interface nl.adaptivity.xmlutil/XmlReader : kotlin.collections/Iterator
673673
final class ExtLocationInfo : nl.adaptivity.xmlutil/XmlReader.LocationInfo { // nl.adaptivity.xmlutil/XmlReader.ExtLocationInfo|null[0]
674674
constructor <init>(kotlin/Int, kotlin/Int, kotlin/Int) // nl.adaptivity.xmlutil/XmlReader.ExtLocationInfo.<init>|<init>(kotlin.Int;kotlin.Int;kotlin.Int){}[0]
675675

676+
final fun equals(kotlin/Any?): kotlin/Boolean // nl.adaptivity.xmlutil/XmlReader.ExtLocationInfo.equals|equals(kotlin.Any?){}[0]
677+
final fun hashCode(): kotlin/Int // nl.adaptivity.xmlutil/XmlReader.ExtLocationInfo.hashCode|hashCode(){}[0]
676678
final fun toString(): kotlin/String // nl.adaptivity.xmlutil/XmlReader.ExtLocationInfo.toString|toString(){}[0]
677679
}
678680

679681
final class StringLocationInfo : nl.adaptivity.xmlutil/XmlReader.LocationInfo { // nl.adaptivity.xmlutil/XmlReader.StringLocationInfo|null[0]
680682
constructor <init>(kotlin/String) // nl.adaptivity.xmlutil/XmlReader.StringLocationInfo.<init>|<init>(kotlin.String){}[0]
681683

684+
final fun equals(kotlin/Any?): kotlin/Boolean // nl.adaptivity.xmlutil/XmlReader.StringLocationInfo.equals|equals(kotlin.Any?){}[0]
685+
final fun hashCode(): kotlin/Int // nl.adaptivity.xmlutil/XmlReader.StringLocationInfo.hashCode|hashCode(){}[0]
682686
final fun toString(): kotlin/String // nl.adaptivity.xmlutil/XmlReader.StringLocationInfo.toString|toString(){}[0]
683687
}
684688
}

core/base/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.gradle.dsl.HasConfigurableKotlinCompilerOptions
2727
import org.jetbrains.kotlin.gradle.dsl.JsMainFunctionExecutionMode
2828
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind
2929
import org.jetbrains.kotlin.gradle.dsl.JsSourceMapEmbedMode
30-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
30+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
3131

3232
plugins {
3333
alias(libs.plugins.dokka)
@@ -92,6 +92,7 @@ kotlin {
9292
main = JsMainFunctionExecutionMode.CALL
9393
}
9494
browser()
95+
nodejs()
9596
}
9697

9798
@OptIn(ExperimentalWasmDsl::class)

0 commit comments

Comments
 (0)