Skip to content

Commit 6615ba1

Browse files
committed
Prepare 0.91.3 release.
2 parents 997ced2 + 4cf560e commit 6615ba1

File tree

55 files changed

+1243
-661
lines changed

Some content is hidden

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

55 files changed

+1243
-661
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish snapshot
2+
on:
3+
push:
4+
branches:
5+
- 'dev'
6+
workflow_dispatch:
7+
jobs:
8+
build-and-publish:
9+
runs-on: macos-latest
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
GPG_PRIV_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
13+
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4.2.2
17+
- name: Cached konan
18+
uses: actions/cache@v4.2.3
19+
with:
20+
path: ~/.konan
21+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
22+
restore-keys: ${{ runner.os }}-konan-
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '11'
27+
distribution: 'temurin'
28+
- id: cache-gradle-windows
29+
name: Set up gradle
30+
uses: gradle/actions/setup-gradle@v4
31+
- name: Check
32+
run: ./gradlew -PexcludeSchema nativeTest --stacktrace
33+
shell: bash
34+
- name: Store reports
35+
if: failure()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: reports
39+
path: |
40+
**/build/reports/
41+
**/build/test-results/
42+
- name: Assemble
43+
run: ./gradlew assemble -PexcludeSchema -Pnative.deploy=all --stacktrace
44+
- name: Javadoc jar
45+
run: ./gradlew javadocJar -PexcludeSchema -Pnative.deploy=all --stacktrace
46+
- name: Sources Jar
47+
run: ./gradlew kotlinSourcesJar -PexcludeSchema -Pnative.deploy=all --stacktrace
48+
- name: Upload
49+
run: ./gradlew publishAllPublicationsToMavenSnapshotRepository -PexcludeSchema -Possrh.username='${{ secrets.OSSRH_USERNAME }}' -Possrh.password='${{ secrets.OSSRH_PASSWORD }}' -Pnative.deploy=all --stacktrace
50+
shell: bash
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: Create and publish a package
1+
name: Upload release
22
on:
33
push:
4-
branches:
5-
- 'dev'
64
tags:
75
- 'v[0-9]*'
86
workflow_dispatch:

.idea/runConfigurations/xmlutil__check_.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Changelog.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
1+
# 0.91.3
2+
*(Oct 28, 2025)<br />*
3+
4+
Changes:
5+
- Change the behaviour of `defaultPolicy` to inherit the settings of
6+
a previous policy even if it does not inherit `DefaultXmlSerializationPolicy`.
7+
In rare cases this changes the behaviour (where a custom policy was
8+
originally set (with different defaults), it didn't inherit the
9+
default policy, and it is now replaced by a default policy).
10+
- In XmlWriter introduce a `safeCdsect` function that will handle embedded end
11+
of cdata sequences by splitting the CDATA section into two sections. This is
12+
now used in serialization to avoid serialization errors if the value contains
13+
`]]>`.
14+
15+
Fixes:
16+
- Fix serialization of cdata in the generic (and Android) xml writer. The writer
17+
incorrectly escaped entities in cdata (#304), and did not correctly deal with
18+
`]]>` in the cdata content (this is resolved by writing as two separate cdata
19+
sections).
20+
- Make the default instance encodeToString (`XML.encodeToString`) use the
21+
regular behaviour for handling null prefixes. This fixes the default empty
22+
prefix being used if none is manually set (rather than the annotated prefix).
23+
- Fix attributes not being prefixed with a namespace if their namespace prefix
24+
is the default prefix for that namespace. As a workaround leave the prefix
25+
different from its containers.
26+
- In pedantic mode, allow an `XmlSerialName` to use the `xml` prefix as long as
27+
its namespace is left default or maps to the xml namespace. Also force the
28+
prefix used to be the standard prefix (although, depending on the xml writer
29+
this may already be the case effectively).
30+
- For the generic parser / serializer make handling of newline/tabs in attribute
31+
values standard compliant (#300). This means that when writing all will be
32+
written as character entities to allow for preservation of the values. For
33+
reading the entities are just resolved. Actual newline/tab content in
34+
attribute values is normalized as space characters (where CRLF is still
35+
replaced by a single space). As attribute values can be differen types than
36+
CData this does not further normalize the value by collapsing whitespace
37+
sequences.
38+
139
# 0.91.2
2-
*(July 27, 2025)
40+
*(July 27, 2025)<br />*
341

442
Features:
543
- Make `defaultPrimitiveOutputKind` and `defaultObjectOutputKind`
@@ -25,7 +63,7 @@ Fixes:
2563
but equivalent errors.
2664

2765
# 0.91.1
28-
*(May 15, 2025)
66+
*(May 15, 2025)<br />*
2967

3068
Features:
3169
- Add an annotation `@XmlMapEntryName` to force map entries not to be
@@ -50,7 +88,7 @@ Fixes:
5088
- Further fixes on inline serialization with more cases.
5189

5290
# 0.91.0
53-
*(April 1, 2025)
91+
*(April 1, 2025)<br />*
5492
Features:
5593
- Add `XmlKeyName` as annotation to set the name of the key used in
5694
maps. This just adds the capability to the default policy. Supports
@@ -69,7 +107,7 @@ Fixes:
69107
thus resulting in invalid cache keys.
70108

71109
# 0.91.0-RC1
72-
110+
*(March 4, 2025)<br />*
73111
Features:
74112
- Add a core-io and serialization-io modules that support using kotlinx.io
75113
- Add inline function shortcuts for encodeToString/decodeFromString with
@@ -143,6 +181,7 @@ Fixes:
143181
string.
144182

145183
# 0.90.3
184+
*(November 7, 2024)<br />*
146185
Changes:
147186
- In pedantic mode check that xml/xmlns are not used as names (they
148187
are always invalid). Note that namespaces can be specified using
@@ -158,11 +197,13 @@ Fixes:
158197
multithreading issues when reusing the format (recommended for speed)
159198

160199
# 0.90.2 Mooor Rocketpower!
200+
*(October 15, 2024)<br />*
161201
Changes:
162202
- Update to Kotlin 2.0.21 / Kotlinx.serialization 1.7.3
163203
- Add support for Android native targets (@whyoleg in #242)
164204

165205
# 0.90.2-beta1 Rocketpower!
206+
*(July 22, 2024)<br />*
166207
Changes:
167208
- Update to Kotlin 2.0.20 / kotlinx.serialization 1.7.2
168209
- Extensive optimization of decoding (serialization), parsing
@@ -207,10 +248,12 @@ Fixes:
207248
- Fix infinite recursion issue with xmlStreaming.newWriter / newReader
208249

209250
# 0.90.1 Fix Android
251+
*(June 16, 2024)<br />*
252+
Fixes:
210253
- Fix android plugin dependency.
211254

212255
# 0.90.0 2.0 will go
213-
*(June 13, 2024)
256+
*(June 13, 2024)<br />*
214257
Changes:
215258
- The core module no longer automatically includes Android/Jvm "native"
216259
parsers by default, but uses the platform independent implementation.
@@ -222,15 +265,19 @@ Changes:
222265
be removed at 1.0 release.
223266

224267
# 0.90.0-RC3
268+
*(June 11, 2024)<br />*
269+
Fixes:
225270
- Fix issues with dependencies in new layout (#209) - XMPCore now
226271
builds/resolves.
227272

228273
# 0.90.0-RC2
274+
*(June 7, 2024)<br />*
229275
Fixes:
230276
- Fix multithreading initialization on JVM targets, serviceLoaders are
231277
not thread-safe (#211).
232278

233279
# 0.90.0-RC1 – Supporting 2.0
280+
*(May 24, 2024)<br />*
234281
Changes:
235282
- Build with Kotlin 2.0.0
236283
- The core module has been changed to use default implementations for
@@ -276,7 +323,7 @@ Fixes:
276323
attributes.
277324

278325
# 0.86.3
279-
*(December 14, 2023)
326+
*(December 14, 2023)<br />*
280327
Changes:
281328
- The `XmlStreaming` object in core is replaced by an interface `IXmlStreaming`
282329
with an accessor function `xmlStreaming` that provides an appropriate

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ package. The `JVM` and `Android` packages provide the native
7575
implementations and depend on (publishing) the `jvmCommon` package.
7676
#### multiplatform (will default to multiplatform implementation for JVM/Android)
7777
```
78-
implementation("io.github.pdvrieze.xmlutil:core:0.91.2")
78+
implementation("io.github.pdvrieze.xmlutil:core:0.91.3-SNAPSHOT")
7979
```
8080
#### **Optional** JVM – uses the stax API _not available_ on Android
8181
```
82-
implementation("io.github.pdvrieze.xmlutil:core-jdk:0.91.2")
82+
implementation("io.github.pdvrieze.xmlutil:core-jdk:0.91.3-SNAPSHOT")
8383
```
8484
#### **Optional** Android – Uses the android streaming library
8585
```
86-
implementation("io.github.pdvrieze.xmlutil:core-android:0.91.2")
86+
implementation("io.github.pdvrieze.xmlutil:core-android:0.91.3-SNAPSHOT")
8787
```
8888
#### JS – Wraps DOM
8989
```
90-
implementation("io.github.pdvrieze.xmlutil:core-js:0.91.2")
90+
implementation("io.github.pdvrieze.xmlutil:core-js:0.91.3-SNAPSHOT")
9191
```
9292

9393
#### Native
@@ -98,17 +98,17 @@ that mirrors the Java API)
9898
### Serialization
9999
#### multiplatform (this coordinate should be used by default)
100100
```
101-
implementation("io.github.pdvrieze.xmlutil:serialization:0.91.2")
101+
implementation("io.github.pdvrieze.xmlutil:serialization:0.91.3-SNAPSHOT")
102102
```
103103

104104
#### JVM (also works for Android)
105105
```
106-
implementation("io.github.pdvrieze.xmlutil:serialization-jvm:0.91.2")
106+
implementation("io.github.pdvrieze.xmlutil:serialization-jvm:0.91.3-SNAPSHOT")
107107
```
108108

109109
#### js
110110
```
111-
implementation("io.github.pdvrieze.xmlutil:serialization-js:0.91.2")
111+
implementation("io.github.pdvrieze.xmlutil:serialization-js:0.91.3-SNAPSHOT")
112112
```
113113

114114
### -Ktor- (Deprecated)

build.gradle.kts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020

2121
import org.jetbrains.dokka.gradle.tasks.DokkaGenerateTask
22-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
23-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
2422
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
2523

2624
buildscript {
@@ -32,9 +30,7 @@ buildscript {
3230
plugins {
3331
id("projectPlugin")
3432
alias(libs.plugins.kotlinMultiplatform) apply false
35-
// kotlin("multiplatform")/* version "1.7.0"*/ //apply false
3633
idea
37-
// kotlin("multiplatform") apply false
3834
`maven-publish`
3935
signing
4036
alias(libs.plugins.dokka)
@@ -45,32 +41,10 @@ description = "The overall project for cross-platform xml access"
4541
val xmlutil_version: String by project
4642
val kotlin_version: String get() = libs.versions.kotlin.get()
4743

48-
plugins.withType<NodeJsRootPlugin> {
49-
extensions.configure<NodeJsRootExtension> {
50-
// nodeVersion = "21.2.0"
51-
// This version is needed to be able to use/test/run the latest wasm opcodes
52-
// version = "21.0.0-v8-canary202309143a48826a08"
53-
// downloadBaseUrl = "https://nodejs.org/download/v8-canary"
54-
}
55-
}
56-
5744
tasks.withType<KotlinNpmInstallTask>().configureEach {
5845
args.add("--ignore-engines")
5946
}
6047

61-
/*
62-
afterEvaluate {
63-
rootProject.plugins.withType(YarnPlugin::class.java) {
64-
rootProject.the<YarnRootExtension>().apply {
65-
// resolution("minimist", "1.2.6")
66-
// resolution("webpack", "5.76.0")
67-
// resolution("qs", "6.11.0")
68-
// resolution("follow-redirects", "1.14.8")
69-
}
70-
}
71-
}
72-
*/
73-
7448
tasks.register<Copy>("pages") {
7549
group="documentation"
7650
val dokkaTasks = tasks.named<DokkaGenerateTask>("dokkaGeneratePublicationHtml")
@@ -81,13 +55,6 @@ tasks.register<Copy>("pages") {
8155
duplicatesStrategy = DuplicatesStrategy.INCLUDE
8256
}
8357

84-
configurations.all {
85-
resolutionStrategy {
86-
force(libs.httpclient)
87-
force("org.apache.httpcomponents:httpcore:${libs.versions.httpComponents.get()}")
88-
}
89-
}
90-
9158
buildScan {
9259
termsOfServiceUrl = "https://gradle.com/terms-of-service"
9360
termsOfServiceAgree = "yes"

core/base/api/core.api

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ public abstract class nl/adaptivity/xmlutil/XmlDelegatingWriter : nl/adaptivity/
353353
public fun namespaceAttr (Lnl/adaptivity/xmlutil/Namespace;)V
354354
public fun processingInstruction (Ljava/lang/String;)V
355355
public fun processingInstruction (Ljava/lang/String;Ljava/lang/String;)V
356+
public fun safeCdsect (Ljava/lang/String;)V
356357
public fun setIndent (I)V
357358
public fun setIndentString (Ljava/lang/String;)V
358359
public fun setPrefix (Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
@@ -785,6 +786,7 @@ public abstract interface class nl/adaptivity/xmlutil/XmlWriter : java/io/Closea
785786
public fun namespaceAttr (Lnl/adaptivity/xmlutil/Namespace;)V
786787
public abstract fun processingInstruction (Ljava/lang/String;)V
787788
public fun processingInstruction (Ljava/lang/String;Ljava/lang/String;)V
789+
public fun safeCdsect (Ljava/lang/String;)V
788790
public fun setIndent (I)V
789791
public abstract fun setIndentString (Ljava/lang/String;)V
790792
public fun setPrefix (Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
@@ -800,6 +802,7 @@ public final class nl/adaptivity/xmlutil/XmlWriter$DefaultImpls {
800802
public static fun namespaceAttr (Lnl/adaptivity/xmlutil/XmlWriter;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
801803
public static fun namespaceAttr (Lnl/adaptivity/xmlutil/XmlWriter;Lnl/adaptivity/xmlutil/Namespace;)V
802804
public static fun processingInstruction (Lnl/adaptivity/xmlutil/XmlWriter;Ljava/lang/String;Ljava/lang/String;)V
805+
public static fun safeCdsect (Lnl/adaptivity/xmlutil/XmlWriter;Ljava/lang/String;)V
803806
public static fun setIndent (Lnl/adaptivity/xmlutil/XmlWriter;I)V
804807
public static fun setPrefix (Lnl/adaptivity/xmlutil/XmlWriter;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
805808
public static synthetic fun startDocument$default (Lnl/adaptivity/xmlutil/XmlWriter;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;ILjava/lang/Object;)V

core/base/api/core.klib.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ abstract interface nl.adaptivity.xmlutil/XmlWriter : nl.adaptivity.xmlutil.core.
737737
open fun namespaceAttr(kotlin/CharSequence, kotlin/CharSequence) // nl.adaptivity.xmlutil/XmlWriter.namespaceAttr|namespaceAttr(kotlin.CharSequence;kotlin.CharSequence){}[0]
738738
open fun namespaceAttr(nl.adaptivity.xmlutil/Namespace) // nl.adaptivity.xmlutil/XmlWriter.namespaceAttr|namespaceAttr(nl.adaptivity.xmlutil.Namespace){}[0]
739739
open fun processingInstruction(kotlin/String, kotlin/String) // nl.adaptivity.xmlutil/XmlWriter.processingInstruction|processingInstruction(kotlin.String;kotlin.String){}[0]
740+
open fun safeCdsect(kotlin/String) // nl.adaptivity.xmlutil/XmlWriter.safeCdsect|safeCdsect(kotlin.String){}[0]
740741
open fun setPrefix(kotlin/CharSequence, kotlin/CharSequence) // nl.adaptivity.xmlutil/XmlWriter.setPrefix|setPrefix(kotlin.CharSequence;kotlin.CharSequence){}[0]
741742
}
742743

@@ -778,6 +779,7 @@ abstract class nl.adaptivity.xmlutil/XmlDelegatingWriter : nl.adaptivity.xmlutil
778779
open fun namespaceAttr(nl.adaptivity.xmlutil/Namespace) // nl.adaptivity.xmlutil/XmlDelegatingWriter.namespaceAttr|namespaceAttr(nl.adaptivity.xmlutil.Namespace){}[0]
779780
open fun processingInstruction(kotlin/String) // nl.adaptivity.xmlutil/XmlDelegatingWriter.processingInstruction|processingInstruction(kotlin.String){}[0]
780781
open fun processingInstruction(kotlin/String, kotlin/String) // nl.adaptivity.xmlutil/XmlDelegatingWriter.processingInstruction|processingInstruction(kotlin.String;kotlin.String){}[0]
782+
open fun safeCdsect(kotlin/String) // nl.adaptivity.xmlutil/XmlDelegatingWriter.safeCdsect|safeCdsect(kotlin.String){}[0]
781783
open fun setPrefix(kotlin/CharSequence, kotlin/CharSequence) // nl.adaptivity.xmlutil/XmlDelegatingWriter.setPrefix|setPrefix(kotlin.CharSequence;kotlin.CharSequence){}[0]
782784
open fun setPrefix(kotlin/String, kotlin/String) // nl.adaptivity.xmlutil/XmlDelegatingWriter.setPrefix|setPrefix(kotlin.String;kotlin.String){}[0]
783785
open fun startDocument(kotlin/String?, kotlin/String?, kotlin/Boolean?) // nl.adaptivity.xmlutil/XmlDelegatingWriter.startDocument|startDocument(kotlin.String?;kotlin.String?;kotlin.Boolean?){}[0]

core/base/src/commonMain/kotlin/nl/adaptivity/xmlutil/XmlWriter.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ public interface XmlWriter : Closeable {
125125
*/
126126
public fun cdsect(text: String)
127127

128+
/** Safe version of CDSect that writes multiple CD Sections to handle embedded `]]>` */
129+
public fun safeCdsect(text: String) {
130+
var idx = text.indexOf("]]>")
131+
var start = 0
132+
while (idx >= 0) {
133+
cdsect(text.substring(start, idx + 2))
134+
start = idx + 2
135+
idx = text.indexOf("]]>", idx + 3)
136+
}
137+
if (start < text.length) cdsect(text.substring(start))
138+
}
139+
128140
/**
129141
* Write an entity reference
130142
* @param text the name of the reference. Must be a valid reference name.

0 commit comments

Comments
 (0)