Skip to content

Commit

Permalink
Merge pull request #1300 from ayeshLK/master
Browse files Browse the repository at this point in the history
Fix issues with Ballerina lang dead-code-elimination
  • Loading branch information
ayeshLK authored Nov 13, 2024
2 parents 75d120d + f28c5c7 commit 17f7188
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
12 changes: 6 additions & 6 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.7.0"
authors = ["Ballerina"]
keywords = ["io", "json", "xml", "csv", "file"]
repository = "https://github.com/ballerina-platform/module-ballerina-io"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.8.0"
distribution = "2201.11.0"

[platform.java17]
graalvmCompatible = true

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "io-native"
path = "../native/build/libs/io-native-1.6.1.jar"
version = "1.6.1"
path = "../native/build/libs/io-native-1.7.0-SNAPSHOT.jar"
version = "1.7.0"


[[platform.java17.dependency]]
path = "../test-utils/build/libs/io-test-utils-1.6.1.jar"
path = "../test-utils/build/libs/io-test-utils-1.7.0-SNAPSHOT.jar"
scope = "testOnly"
version = "1.6.1"
version = "1.7.0-SNAPSHOT"
31 changes: 29 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.8.0"
distribution-version = "2201.11.0-20241111-172200-095db58f"

[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.7.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.float"},
Expand All @@ -31,6 +31,26 @@ modules = [
{org = "ballerina", packageName = "jballerina.java", moduleName = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.__internal"
version = "0.0.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.object"}
]

[[package]]
org = "ballerina"
name = "lang.array"
version = "0.0.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.__internal"}
]

[[package]]
org = "ballerina"
name = "lang.error"
Expand All @@ -52,6 +72,12 @@ modules = [
{org = "ballerina", packageName = "lang.float", moduleName = "lang.float"}
]

[[package]]
org = "ballerina"
name = "lang.object"
version = "0.0.0"
scope = "testOnly"

[[package]]
org = "ballerina"
name = "lang.regexp"
Expand Down Expand Up @@ -104,6 +130,7 @@ version = "0.0.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.array"},
{org = "ballerina", name = "lang.error"}
]
modules = [
Expand Down
4 changes: 4 additions & 0 deletions ballerina/io_error.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@
// specific language governing permissions and limitations
// under the License.

import ballerina/jballerina.java;

# Represents IO module related errors.
public type Error distinct error;

# This will return when connection timed out happen when try to connect to a remote host.
public type ConnectionTimedOutError distinct Error;

# Represents generic IO error. The detail record contains the information related to the error.
@java:ExternalDependency
public type GenericError distinct Error;

# This will get returned due to file permission issues.
@java:ExternalDependency
public type AccessDeniedError distinct Error;

# This will get returned if the file is not available in the given file path.
Expand Down
2 changes: 1 addition & 1 deletion ballerina/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import ballerina/jballerina.java;

# The iterator for the stream returned in `readFileCsvAsStream` function.

@java:ExternalDependency
public class CsvIterator {
private boolean isClosed = false;
public isolated function next() returns record {|anydata value;|}|error? {
Expand Down
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["io", "json", "xml", "csv", "file"]
repository = "https://github.com/ballerina-platform/module-ballerina-io"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.8.0"
distribution = "2201.11.0"

[platform.java17]
graalvmCompatible = true
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.6.2-SNAPSHOT
ballerinaLangVersion=2201.8.0
version=1.7.0-SNAPSHOT
ballerinaLangVersion=2201.11.0-20241111-172200-095db58f
puppycrawlCheckstyleVersion=10.12.0
testngVersion=7.6.1
slf4jVersion=1.7.30
Expand Down

0 comments on commit 17f7188

Please sign in to comment.