From ba950e3ac9d06abcf445c74ae80adee92431dc4f Mon Sep 17 00:00:00 2001 From: Charuka Tharindu Date: Wed, 28 Jun 2023 10:56:54 +0530 Subject: [PATCH] Update gradle properties --- gradle.properties | 6 +++--- .../java/org/ballerinalang/command/cmd/PullCommand.java | 8 ++++++-- .../java/org/ballerinalang/command/cmd/UpdateCommand.java | 2 +- .../java/org/ballerinalang/command/util/ToolUtil.java | 2 +- .../java/org/ballerinalang/command/ListCommandTest.java | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index e7e1b506..8752da6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,8 +6,8 @@ jreVersion=11.0.18+10 # For test purpose swan-lake-version=2201.2.0 swan-lake-spec-version=2022R3 -swan-lake-latest-version=2201.5.0 -swan-lake-latest-spec-version=2022R4 +swan-lake-latest-version=2201.7.0 +swan-lake-latest-spec-version=2023R1 1-x-channel-version=1.2.0 1-x-channel-spec-version=2020R1 -1-x-channel-latest-version=1.2.38 +1-x-channel-latest-version=1.2.40 diff --git a/src/main/java/org/ballerinalang/command/cmd/PullCommand.java b/src/main/java/org/ballerinalang/command/cmd/PullCommand.java index f6ef4f5d..1fd532c4 100644 --- a/src/main/java/org/ballerinalang/command/cmd/PullCommand.java +++ b/src/main/java/org/ballerinalang/command/cmd/PullCommand.java @@ -17,7 +17,11 @@ package org.ballerinalang.command.cmd; import org.ballerinalang.command.BallerinaCliCommands; -import org.ballerinalang.command.util.*; +import org.ballerinalang.command.util.Channel; +import org.ballerinalang.command.util.Distribution; +import org.ballerinalang.command.util.ErrorUtil; +import org.ballerinalang.command.util.Tool; +import org.ballerinalang.command.util.ToolUtil; import picocli.CommandLine; import java.io.PrintStream; @@ -66,7 +70,7 @@ public void execute() { if (!testFlag) { // Check and update the tool if any latest version available Tool toolDetails = ToolUtil.updateTool(printStream); - if (toolDetails.getCompatibility().equals("false")) { + if (!toolDetails.getCompatibility().equals("true")) { return; } } diff --git a/src/main/java/org/ballerinalang/command/cmd/UpdateCommand.java b/src/main/java/org/ballerinalang/command/cmd/UpdateCommand.java index 00953511..84f46f10 100644 --- a/src/main/java/org/ballerinalang/command/cmd/UpdateCommand.java +++ b/src/main/java/org/ballerinalang/command/cmd/UpdateCommand.java @@ -87,7 +87,7 @@ public static void update(PrintStream printStream) { if (!testFlag) { // Check and update the tool if any latest version available Tool toolDetails = ToolUtil.updateTool(printStream); - if (toolDetails.getCompatibility().equals("false")) { + if (!toolDetails.getCompatibility().equals("true")) { return; } } diff --git a/src/main/java/org/ballerinalang/command/util/ToolUtil.java b/src/main/java/org/ballerinalang/command/util/ToolUtil.java index 300baa7b..66bae6eb 100644 --- a/src/main/java/org/ballerinalang/command/util/ToolUtil.java +++ b/src/main/java/org/ballerinalang/command/util/ToolUtil.java @@ -314,7 +314,7 @@ public static Tool getLatestToolVersion() { tool.setVersion(matcher.group(1)); } - matcher = Pattern.compile("\"compatibility\":\"(.*?)\"").matcher(json); + matcher = Pattern.compile("\"compatibility\":(true|false)").matcher(json); while (matcher.find()) { tool.setCompatibility(matcher.group(1)); } diff --git a/src/test/java/org/ballerinalang/command/ListCommandTest.java b/src/test/java/org/ballerinalang/command/ListCommandTest.java index fe773cb6..cda2ab92 100644 --- a/src/test/java/org/ballerinalang/command/ListCommandTest.java +++ b/src/test/java/org/ballerinalang/command/ListCommandTest.java @@ -42,7 +42,7 @@ public void listCommandTest() { Assert.assertTrue(outContent.toString().contains("Distributions available locally")); Assert.assertTrue(outContent.toString().contains("Distributions available remotely")); Assert.assertTrue(outContent.toString().contains("1.* channel")); - Assert.assertTrue(outContent.toString().contains("1.2.30")); + Assert.assertTrue(outContent.toString().contains("1.2.40")); Assert.assertTrue(outContent.toString().contains("Swan Lake channel")); }