Skip to content

Commit

Permalink
Reproducer for pdvrieze/xmlutil#234
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruchanov committed Aug 19, 2024
1 parent 057e403 commit c664794
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,4 @@ iOSInjectionProject/

# End of https://www.toptal.com/developers/gitignore/api/osx,java,swift,xcode,kotlin,android
AppProject/.kotlin
LibsProject/.kotlin
18 changes: 18 additions & 0 deletions LibsProject/appIos/appIos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
F0223CB04EC873CE33CFCCE6 /* Frameworks */,
EAAAE2D362B63F9334C1538C /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -182,6 +183,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
EAAAE2D362B63F9334C1538C /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-appIos/Pods-appIos-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-appIos/Pods-appIos-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-appIos/Pods-appIos-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
8 changes: 8 additions & 0 deletions LibsProject/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ compose = "1.6.11"
compose-compiler = "1.5.4"
compose-material3 = "1.6.11"
androidx-activityCompose = "1.9.1"
xmlutil = "0.90.1"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand All @@ -14,6 +15,10 @@ compose-ui-tooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.r
compose-ui-tooling-preview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose" }
compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose-material3" }
xmlutil-core = { module = "io.github.pdvrieze.xmlutil:core", version.ref = "xmlutil" }
xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xmlutil" }
xmlutil-serialutil = { module = "io.github.pdvrieze.xmlutil:serialutil", version.ref = "xmlutil" }


[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
Expand All @@ -23,3 +28,6 @@ kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref =
kotlinCocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose" }
jetbrainsComposeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[bundles]
xmlutil = ["xmlutil-core", "xmlutil-serialization", "xmlutil-serialutil"]
1 change: 1 addition & 0 deletions LibsProject/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ kotlin {
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.bundles.xmlutil)
}

commonTest.dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.example.libsproject

import nl.adaptivity.xmlutil.serialization.ElementSerializer
import nl.adaptivity.xmlutil.serialization.XML

class XmlExample {
private val xmlParser = XML { autoPolymorphic = true }

fun parseResponse(xml: String) {
val deserialized = xmlParser.decodeFromString(ElementSerializer, xml)
deserialized.childNodes.forEachBfsIndexed { node ->

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.libsproject.ext

import nl.adaptivity.xmlutil.dom2.Node
import nl.adaptivity.xmlutil.core.impl.idom.INodeList

interface BfsContext {
val index: Int
val level: Int
}

internal fun INodeList.forEachBfsIndexed(block: BfsContext.(node: Node) -> Unit) {

}

0 comments on commit c664794

Please sign in to comment.