From 20199497371100e73203c42f667c46b6d6b78cef Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:16:25 +0530 Subject: [PATCH 1/4] Fix github workflow failures --- .gitattributes | 2 ++ .github/workflows/build-with-bal-test-graalvm.yml | 3 --- ballerina/Dependencies.toml | 13 +++++++++++++ ballerina/build.gradle | 3 ++- ballerina/tests/stream_namespace_test.bal | 11 +++++------ build.gradle | 7 +------ gradle.properties | 2 +- 7 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d13affe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Ensure all Java files use LF. +*.java eol=lf diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 44d147d..2943740 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -35,7 +35,4 @@ jobs: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}' - additional_ubuntu_build_flags: '-x :graphql-compiler-plugin-tests:test' - # TODO : Enable after fixing this issue : https://github.com/ballerina-platform/ballerina-lang/issues/38882 - # additional_windows_build_flags: '-x :graphql-compiler-plugin-tests:test' additional_windows_build_flags: '-x test' diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index eb35607..4142d61 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -14,6 +14,7 @@ version = "0.1.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "test"} ] modules = [ @@ -50,6 +51,18 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "lang.regexp", moduleName = "lang.regexp"} +] + [[package]] org = "ballerina" name = "lang.value" diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 840f09b..0fdef33 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -115,7 +115,8 @@ task deleteDependencyTomlFiles { } -updateTomlFiles.dependsOn unpackStdLibs +updateTomlFiles.dependsOn copyStdlibs + build.dependsOn "generatePomFileForMavenPublication" build.dependsOn ":${packageName}-native:build" build.dependsOn ":${packageName}-compiler-plugin:build" diff --git a/ballerina/tests/stream_namespace_test.bal b/ballerina/tests/stream_namespace_test.bal index 7594188..3369e9e 100644 --- a/ballerina/tests/stream_namespace_test.bal +++ b/ballerina/tests/stream_namespace_test.bal @@ -16,6 +16,7 @@ import ballerina/io; import ballerina/test; +import ballerina/lang.regexp; @Namespace { uri: "http://www.example.com/products", @@ -199,9 +200,8 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[0].description, "\n"), + "This is the description for\n Product 1.\n "); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -210,9 +210,8 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[1].description, "\n"), + "This is the description for\n Product 2.\n "); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/build.gradle b/build.gradle index 7740987..a3939ce 100644 --- a/build.gradle +++ b/build.gradle @@ -63,16 +63,11 @@ subprojects { configurations { ballerinaStdLibs - jbalTools } dependencies { - jbalTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") { - transitive = false - } - /* Standard libraries */ - ballerinaStdLibs "io.ballerina.stdlib:io-ballerina:${stdlibIOVersion}" + ballerinaStdLibs "io.ballerina.stdlib:io-ballerina:${stdlibIoVersion}" } } diff --git a/gradle.properties b/gradle.properties index 1faa8f5..538c62a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,4 @@ githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=4.0.4 researchgateReleaseVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 -stdlibIOVersion=1.6.0 +stdlibIoVersion=1.6.0 From 68dc4de7c5f963992542af16b8c9c9b76313f942 Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:21:33 +0530 Subject: [PATCH 2/4] Add configuration for graalvm compatibility --- .github/workflows/build-with-bal-test-graalvm.yml | 1 - .../data-native/resource-config.json | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 2943740..fc149e3 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -35,4 +35,3 @@ jobs: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}' - additional_windows_build_flags: '-x test' diff --git a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json new file mode 100644 index 0000000..6cfd723 --- /dev/null +++ b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json @@ -0,0 +1,12 @@ +{ + "resources":{ + "includes":[ { + "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLInputFactory\\E" + }, { + "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLOutputFactory\\E" + }]}, + "bundles":[{ + "name":"error", + "locales":[""] + }] +} From ce72f337d550ad111c52b617292ed432c6c009a0 Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:13:38 +0530 Subject: [PATCH 3/4] Fix test failures in windows --- ballerina/Dependencies.toml | 13 ------------- .../resources/default_namespaced_invoice.xml | 8 ++------ ballerina/tests/stream_default_namspace_test.bal | 16 ++++------------ ballerina/tests/stream_namespace_test.bal | 7 ++----- .../data-native/resource-config.json | 6 ------ 5 files changed, 8 insertions(+), 42 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 4142d61..eb35607 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -14,7 +14,6 @@ version = "0.1.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "test"} ] modules = [ @@ -51,18 +50,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] -[[package]] -org = "ballerina" -name = "lang.regexp" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "lang.regexp", moduleName = "lang.regexp"} -] - [[package]] org = "ballerina" name = "lang.value" diff --git a/ballerina/tests/resources/default_namespaced_invoice.xml b/ballerina/tests/resources/default_namespaced_invoice.xml index 62e237f..86f0bc6 100644 --- a/ballerina/tests/resources/default_namespaced_invoice.xml +++ b/ballerina/tests/resources/default_namespaced_invoice.xml @@ -1,16 +1,12 @@ - This is the description for - Product 1. - + This is the description for Product 1. 57.70 Home and Garden - This is the description for - Product 2. - + This is the description for Product 2. 6312.36 Books diff --git a/ballerina/tests/stream_default_namspace_test.bal b/ballerina/tests/stream_default_namspace_test.bal index ec0c9f2..62afc17 100644 --- a/ballerina/tests/stream_default_namspace_test.bal +++ b/ballerina/tests/stream_default_namspace_test.bal @@ -128,9 +128,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -139,9 +137,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); @@ -228,9 +224,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -239,9 +233,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/ballerina/tests/stream_namespace_test.bal b/ballerina/tests/stream_namespace_test.bal index 3369e9e..54336fd 100644 --- a/ballerina/tests/stream_namespace_test.bal +++ b/ballerina/tests/stream_namespace_test.bal @@ -16,7 +16,6 @@ import ballerina/io; import ballerina/test; -import ballerina/lang.regexp; @Namespace { uri: "http://www.example.com/products", @@ -200,8 +199,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[0].description, "\n"), - "This is the description for\n Product 1.\n "); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -210,8 +208,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[1].description, "\n"), - "This is the description for\n Product 2.\n "); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json index 6cfd723..befe09e 100644 --- a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json +++ b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json @@ -1,10 +1,4 @@ { - "resources":{ - "includes":[ { - "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLInputFactory\\E" - }, { - "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLOutputFactory\\E" - }]}, "bundles":[{ "name":"error", "locales":[""] From e7a9b6485e1a6cff45f92bbea59b0307448e51dd Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:20:52 +0530 Subject: [PATCH 4/4] Fix native code path structure --- ballerina/init.bal | 2 +- ballerina/xml_api.bal | 6 +++--- .../stdlib/data/{ => xmldata}/FromString.java | 6 +++--- .../stdlib/data/{ => xmldata}/utils/Constants.java | 4 ++-- .../stdlib/data/{ => xmldata}/utils/DataUtils.java | 6 +++--- .../{ => xmldata}/utils/DiagnosticErrorCode.java | 2 +- .../data/{ => xmldata}/utils/DiagnosticLog.java | 2 +- .../stdlib/data/{ => xmldata}/utils/ModuleUtils.java | 2 +- .../xml/BallerinaByteBlockInputStream.java | 6 +++--- .../stdlib/data/{ => xmldata}/xml/Native.java | 6 +++--- .../stdlib/data/{ => xmldata}/xml/QualifiedName.java | 2 +- .../stdlib/data/{ => xmldata}/xml/XmlParser.java | 12 ++++++------ .../stdlib/data/{ => xmldata}/xml/XmlTraversal.java | 12 ++++++------ native/src/main/java/module-info.java | 2 +- .../xmldata-native}/resource-config.json | 0 15 files changed, 35 insertions(+), 35 deletions(-) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/FromString.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/Constants.java (95%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DataUtils.java (99%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DiagnosticErrorCode.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DiagnosticLog.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/ModuleUtils.java (96%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/BallerinaByteBlockInputStream.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/Native.java (96%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/QualifiedName.java (98%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/XmlParser.java (99%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/XmlTraversal.java (98%) rename native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/{data-native => data/xmldata-native}/resource-config.json (100%) diff --git a/ballerina/init.bal b/ballerina/init.bal index e9c4322..de1aead 100644 --- a/ballerina/init.bal +++ b/ballerina/init.bal @@ -21,5 +21,5 @@ isolated function init() { } isolated function setModule() = @java:Method { - 'class: "io.ballerina.stdlib.data.utils.ModuleUtils" + 'class: "io.ballerina.stdlib.data.xmldata.utils.ModuleUtils" } external; diff --git a/ballerina/xml_api.bal b/ballerina/xml_api.bal index 1ff3f2d..f1c41c0 100644 --- a/ballerina/xml_api.bal +++ b/ballerina/xml_api.bal @@ -72,7 +72,7 @@ public type Error distinct error; # + t - Target type to be used for filtering in the projection # + return - On success, returns the given target type value, else returns an `xmldata:Error` public isolated function fromXmlWithType(xml v, Options options = {}, typedesc t = <>) - returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xml.Native"} external; + returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.xml.Native"} external; # Converts XML string, byte[] or byte-stream to record type with projection # @@ -81,7 +81,7 @@ public isolated function fromXmlWithType(xml v, Options options = {}, typedesc s, Options options = {}, typedesc t = <>) - returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xml.Native"} external; + returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.xml.Native"} external; # Converts a `Map` or `Record` representation to its XML representation. @@ -120,7 +120,7 @@ isolated function convertMapXml(map|map mapValue) returns xml { } isolated function getModifiedRecord(map mapValue, typedesc<(map|json)> inputType) - returns json|record{}|Error = @java:Method {'class: "io.ballerina.stdlib.data.utils.DataUtils"} external; + returns json|record{}|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.utils.DataUtils"} external; # Provides configurations for converting JSON to XML. # diff --git a/native/src/main/java/io/ballerina/stdlib/data/FromString.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/FromString.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java index d97bdc9..fbf73a3 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/FromString.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data; +package io.ballerina.stdlib.data.xmldata; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -28,8 +28,8 @@ import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.util.Comparator; import java.util.List; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java similarity index 95% rename from native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java index 34d3d15..e860fae 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; @@ -25,7 +25,7 @@ import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BXmlItem; -import io.ballerina.stdlib.data.xml.QualifiedName; +import io.ballerina.stdlib.data.xmldata.xml.QualifiedName; /** * Constants used in Ballerina XmlData library. diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java similarity index 99% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java index 3ca6ab2..b8946ac 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -36,8 +36,8 @@ import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; -import io.ballerina.stdlib.data.FromString; -import io.ballerina.stdlib.data.xml.QualifiedName; +import io.ballerina.stdlib.data.xmldata.FromString; +import io.ballerina.stdlib.data.xmldata.xml.QualifiedName; import java.util.ArrayList; import java.util.HashMap; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java index 214be3b..ff1ee55 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; /** * Represents a diagnostic error code. diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java index 5c35cca..559019e 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.utils.StringUtils; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java similarity index 96% rename from native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java index ac21111..28df455 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Module; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java index 6d55537..638f238 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.async.Callback; @@ -28,8 +28,8 @@ import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BObject; import io.ballerina.runtime.api.values.BString; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.IOException; import java.io.InputStream; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/Native.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java similarity index 96% rename from native/src/main/java/io/ballerina/stdlib/data/xml/Native.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java index a9c716a..2d2b101 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/Native.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Future; @@ -30,8 +30,8 @@ import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; import io.ballerina.runtime.api.values.BXml; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java similarity index 98% rename from native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java index a193828..c0b26e2 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; /** * Represents a qualified name. diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java similarity index 99% rename from native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java index 1dc746c..3a29c03 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -34,11 +34,11 @@ import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; -import io.ballerina.stdlib.data.FromString; -import io.ballerina.stdlib.data.utils.Constants; -import io.ballerina.stdlib.data.utils.DataUtils; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.FromString; +import io.ballerina.stdlib.data.xmldata.utils.Constants; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.Reader; import java.util.HashMap; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java similarity index 98% rename from native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java index 236b485..0d6afbd 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -37,11 +37,11 @@ import io.ballerina.runtime.api.values.BXml; import io.ballerina.runtime.api.values.BXmlItem; import io.ballerina.runtime.api.values.BXmlSequence; -import io.ballerina.stdlib.data.utils.Constants; -import io.ballerina.stdlib.data.utils.DataUtils; -import io.ballerina.stdlib.data.utils.DataUtils.XmlAnalyzerData; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.Constants; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils.XmlAnalyzerData; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.util.ArrayList; import java.util.HashMap; diff --git a/native/src/main/java/module-info.java b/native/src/main/java/module-info.java index ce7a862..9477b21 100644 --- a/native/src/main/java/module-info.java +++ b/native/src/main/java/module-info.java @@ -22,5 +22,5 @@ requires java.xml; requires junit; requires org.apache.commons.lang3; - exports io.ballerina.stdlib.data.xml; + exports io.ballerina.stdlib.data.xmldata.xml; } diff --git a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data/xmldata-native/resource-config.json similarity index 100% rename from native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json rename to native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data/xmldata-native/resource-config.json