From 112d12e3d942050fc87693d1a5bbf57bda2368b8 Mon Sep 17 00:00:00 2001 From: ayeshLK Date: Mon, 5 Aug 2024 10:48:21 +0530 Subject: [PATCH] Restructure the code --- .../groovy/io/ballerina/plugin/BallerinaPlugin.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy index 4f7067a..457f3fe 100644 --- a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy +++ b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy @@ -245,11 +245,6 @@ class BallerinaPlugin implements Plugin { return } - if (ignoreVersionMismatch) { - println("[Warn] Ignoring system-installed and configured Ballerina version mismatch.") - return - } - def output = new ByteArrayOutputStream() def error = new ByteArrayOutputStream() @@ -279,6 +274,10 @@ class BallerinaPlugin implements Plugin { def configuredVersion = getProjectBalVersion(project) if (installedVersion != configuredVersion) { + if (ignoreVersionMismatch) { + println("[Warn] Ignoring Ballerina version mismatch. Expected: $configuredVersion, but found: $installedVersion.") + return + } throw new GradleException("Ballerina version mismatch. Expected: $configuredVersion, but found: $installedVersion, hence exiting") }