Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package md as the readme file #20

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ballerina-tests/user-config-tests/tests/user_configs.bal
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ csv:ParseOption option4 = {nilValue: "", header: 4, skipLines: "1-5"};
csv:ParseOption option5 = {nilValue: "", header: 4, skipLines: "1-1"};
csv:ParseOption option6 = {nilValue: "()", header: false, skipLines: [1, 2]};

csv:parseToRecordOption ptOption1 = {nilValue: "", header: 1, skipLines: [2, 4]};
csv:parseToRecordOption ptOption2 = {nilValue: "", header: 1, skipLines: "2-4"};
csv:parseToRecordOption ptOption3 = {nilValue: "", header: 4, skipLines: "1-5"};
csv:parseToRecordOption ptOption4 = {nilValue: "", header: 4, skipLines: [-1, -2, 4, 2]};
csv:parseToRecordOption ptOption5 = {header: false, skipLines: [-1, -2, 5, 3]};
csv:ParseToRecordOption ptOption1 = {nilValue: "", header: 1, skipLines: [2, 4]};
csv:ParseToRecordOption ptOption2 = {nilValue: "", header: 1, skipLines: "2-4"};
csv:ParseToRecordOption ptOption3 = {nilValue: "", header: 4, skipLines: "1-5"};
csv:ParseToRecordOption ptOption4 = {nilValue: "", header: 4, skipLines: [-1, -2, 4, 2]};
csv:ParseToRecordOption ptOption5 = {header: false, skipLines: [-1, -2, 5, 3]};

// Invalid parser options
csv:ParseOption invalidParserOptions1 = {header: 4};
Expand Down
6 changes: 3 additions & 3 deletions ballerina/csv_api.bal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ballerina/jballerina.java;
# + options - Options to be used for filtering in the projection
# + t - Target type
# + return - On success, value belonging to the given target type, else returns an `csv:Error` value.
public isolated function parseStringToRecord(string s, parseToRecordOption options = {}, typedesc<record{}[]> t = <>)
public isolated function parseStringToRecord(string s, ParseToRecordOption options = {}, typedesc<record{}[]> t = <>)
returns t|Error = @java:Method {'class: "io.ballerina.lib.data.csvdata.csv.Native"} external;

# Converts byte[] to subtype of record array.
Expand All @@ -31,7 +31,7 @@ public isolated function parseStringToRecord(string s, parseToRecordOption optio
# + options - Options to be used for filtering in the projection
# + t - Target type
# + return - On success, value belonging to the given target type, else returns an `csv:Error` value.
public isolated function parseBytesToRecord(byte[] s, parseToRecordOption options = {}, typedesc<record{}[]> t = <>)
public isolated function parseBytesToRecord(byte[] s, ParseToRecordOption options = {}, typedesc<record{}[]> t = <>)
returns t|Error = @java:Method {'class: "io.ballerina.lib.data.csvdata.csv.Native"} external;

# Converts CSV byte-block-stream to subtype of record array.
Expand All @@ -41,7 +41,7 @@ public isolated function parseBytesToRecord(byte[] s, parseToRecordOption option
# + t - Target type
# + return - On success, value belonging to the given target type, else returns an `csv:Error` value.
public isolated function parseStreamToRecord(stream<byte[], error?> s,
parseToRecordOption options = {}, typedesc<record{}[]> t = <>)
ParseToRecordOption options = {}, typedesc<record{}[]> t = <>)
returns t|Error = @java:Method {'class: "io.ballerina.lib.data.csvdata.csv.Native"} external;

# Converts CSV string to subtype of anydata[][].
Expand Down
2 changes: 1 addition & 1 deletion ballerina/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public type ParseOption record {|
|};

# Represents options for parsing data into records.
public type parseToRecordOption record {|
public type ParseToRecordOption record {|
*ParseOption;
# Custom headers for the data, if any.
string[]? customHeaders = ();
Expand Down
22 changes: 22 additions & 0 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ spotbugsTest {
enabled = false
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId "data.csv-native"
version = project.version
artifact jar
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ballerina-platform/module-ballerina-data.csv")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}

compileJava {
doFirst {
options.compilerArgs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class DiagnosticLog {
private static final String ERROR_PREFIX = "error";
private static final String CSV_CONVERSION_ERROR = "Error";
private static final String UNSUPPORTED_OPERATION_ERROR = "Error";
private static final ResourceBundle MESSAGES = ResourceBundle.getBundle("error", Locale.getDefault());
private static final ResourceBundle MESSAGES = ResourceBundle.getBundle("csv_error", Locale.getDefault());

private DiagnosticLog() {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"bundles":[{
"name":"error",
"name":"csv_error",
"locales":[""]
}]
}
Loading