Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
pdvrieze committed Feb 19, 2023
2 parents 6d03794 + ae77315 commit 55235eb
Show file tree
Hide file tree
Showing 75 changed files with 2,324 additions and 391 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-to-packages.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/create-nexus-staging-repo@v1.1
uses: nexus-actions/create-nexus-staging-repo@v1.2
with:
username: ${{ secrets.OSSRH_USERNAME }}
password: ${{ secrets.OSSRH_PASSWORD }}
Expand All @@ -34,21 +34,21 @@ jobs:
os: [ macOs-latest, windows-latest, ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.3.0
- name: Cached konan
uses: actions/cache@v2
uses: actions/cache@v3.2.5
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v3.10.0
with:
java-version: '11'
distribution: 'adopt'
- id: cache-gradle-windows
name: Set up gradle
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v2.3.3
- name: Check (macos / windows)
if: matrix.os != 'ubuntu-latest'
run: ./gradlew nativeTest --stacktrace
Expand Down
51 changes: 44 additions & 7 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions Changelog.md
@@ -1,10 +1,46 @@
# 0.85.0 – Tying things up
*(Feb 19, 2023)<br />*
Features:
- Implement serialization of maps. The outer container will be eluded as with
lists. If the key type can be an attribute (and doesn't overlap with an
attribute in the value) it will be written on the value, otherwise an entry
will be written with the key written on it (as attribute or tag). Note that
as this point keys must precede values due to the implementation of map
serialization. The behaviour can be customized through the policy.
- Add the possibility to specify namespace declarations that are ensured on
tags (note that this does not yet participate in the namespace collating code)
- Fix polymorphic usage of value classes as children of a sealed interface.
- Add a `defaultPolicy` configurator to `XmlConfig.Builder` that allows more elegant
configuration of the default policy. Some of the properties that can
be specified on the `XmlConfig.Builder` have been deprecated in place of this
new (more robust) mechanism.
- Within the default policy builder add support for configuring the unknown
child handling with some defaults: `ignoreUnknownChildren` and
`ignoreUnknownNamespace`. Note that these are shortcuts to setting an explicit
handler.
- Now when a tag is marked to not preserve space (preserving is the default),
but when the value starts or ends with whitespace this will result the
xml:space="preserve" attribute to be emitted. The decoder will also honour
this attribute over default behaviour for that type.
- Support custom delimiters by allowing a list of delimiters to be specified
the policy.

Fixes:
- Make actual serialization of maps (that are not attributes) work
- Fix an infinite recursion bug in the namespace collection code that writes
namespace declarations on the top level.
- Fix writing codepoints > 0x10000 that require surrogate pairs.
- Fix whitespace handling #120
- Remove stale logging code: #119

# 0.84.3
*(Sep 25, 2022)<br />*
Features:
- Add the ability to have polymorphic root tags (#98). Note that for
a non-transparent approach it is strongly advised to explicitly
provide the tagname polymorphic types do not support annotations on
the type.

Fixes:
- Fix reading of entity references. #88
- Fix NamedNodeMap iterator (an issue for dom based apis)
Expand All @@ -22,6 +58,7 @@ Fixes:
Features:
- Add `@XmlIgnoreWhitespace` annotation to allow not retaining whitespace with
an `@XmlValue` field of type `List<CompactFragment>`

Fixes:
- Fix storing comment events
- Don't defer serializing inline values as that is not valid. This
Expand Down
28 changes: 25 additions & 3 deletions core/build.gradle.kts
Expand Up @@ -68,7 +68,7 @@ kotlin {
attribute(androidAttribute, false)
}
compilations.all {
compileKotlinTaskProvider.configure {
compileTaskProvider.configure {
kotlinOptions {
jvmTarget = "1.8"
// freeCompilerArgs += argJvmDefault
Expand All @@ -85,6 +85,13 @@ kotlin {
}
}
}
tasks.withType<Jar>().named(artifactsTaskName) {
from(project.file("src/$defaultConfigurationName/proguard.pro")) {
rename { "xmlutil-proguard.pro" }
into("META-INF/proguard")
}
}

}
jvm("android") {
attributes {
Expand All @@ -99,6 +106,21 @@ kotlin {
}
cleanTestTask.dependsOn(tasks.named("clean${target.name[0].toUpperCase()}${target.name.substring(1)}Test"))
}

tasks.withType<Jar>().named(artifactsTaskName) {
from(project.file("src/r8-workaround.pro")) {
rename { "xmlutil-r8-workaround.pro" }
into("META-INF/com.android.tools/r8")
}
from(project.file("src/$defaultConfigurationName/proguard.pro")) {
rename { "xmlutil-proguard.pro" }
into("META-INF/com.android.tools/r8")
}
from(project.file("src/$defaultConfigurationName/proguard.pro")) {
rename { "xmlutil-proguard.pro" }
into("META-INF/com.android.tools/proguard")
}
}
}
js(BOTH) {
browser()
Expand Down Expand Up @@ -214,8 +236,8 @@ kotlin {
sourceSets.all {
languageSettings.apply {
progressiveMode = true
apiVersion = "1.6"
languageVersion = "1.6"
apiVersion = "1.7"
languageVersion = "1.7"

optIn("kotlin.RequiresOptIn")
optIn("nl.adaptivity.xmlutil.XmlUtilInternal")
Expand Down
2 changes: 2 additions & 0 deletions core/src/androidMain/proguard.pro
@@ -0,0 +1,2 @@
-keep class nl.adaptivity.xmlutil.AndroidStreamingFactory
-keep class nl.adaptivity.xmlutil.util.DefaultSerializationProvider
2 changes: 0 additions & 2 deletions core/src/commonMain/kotlin/nl/adaptivity/xmlutil/DomWriter.kt
Expand Up @@ -123,7 +123,6 @@ public class DomWriter constructor(
private set

override fun namespaceAttr(namespacePrefix: String, namespaceUri: String) {
println("DEBUG - namespaceAttribute - {$namespacePrefix}=$namespaceUri")
val cur = requireCurrent("Namespace attribute")
when {

Expand Down Expand Up @@ -242,7 +241,6 @@ public class DomWriter constructor(
}

override fun attribute(namespace: String?, name: String, prefix: String?, value: String) {
println("DEBUG - attribute - {$namespace}$prefix:$name=$value")
val cur = requireCurrent("attribute")
when {
prefix.isNullOrEmpty() -> cur.setAttribute(name, value)
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/nl/adaptivity/xmlutil/QName.kt
Expand Up @@ -38,7 +38,7 @@ public expect class QName {
public fun getNamespaceURI(): String
}

public fun QName.isEquivalent(other: QName): Boolean {
public infix fun QName.isEquivalent(other: QName): Boolean {
return getLocalPart() == other.getLocalPart() &&
getNamespaceURI() == other.getNamespaceURI()
}
Expand Down

0 comments on commit 55235eb

Please sign in to comment.