From 7c1d7e0dd16c66b64332655503a3306a9f8e71fa Mon Sep 17 00:00:00 2001 From: ayeshLK Date: Wed, 26 Jun 2024 15:09:02 +0530 Subject: [PATCH] Move error logging into command execution point --- .../groovy/io/ballerina/plugin/BallerinaPlugin.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy index 9a59b7e..8f6d6d2 100644 --- a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy +++ b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy @@ -278,7 +278,7 @@ class BallerinaPlugin implements Plugin { bal pack --target-dir ${balBuildTarget}" """ if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "$balPackWithDocker" + commandLine 'cmd', '/c', "$balPackWithDocker && exit %%ERRORLEVEL%%" } else { commandLine 'sh', '-c', "$balPackWithDocker" } @@ -321,7 +321,7 @@ class BallerinaPlugin implements Plugin { bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala" """ if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "$balPushWithDocker" + commandLine 'cmd', '/c', "$balPushWithDocker && exit %%ERRORLEVEL%%" } else { commandLine 'sh', '-c', "$balPushWithDocker" } @@ -383,10 +383,10 @@ class BallerinaPlugin implements Plugin { -v $projectDirectory:/home/ballerina/$parentDirectory.name/$projectDirectory.name \ ballerina/ballerina:$ballerinaDockerTag \ /bin/sh -c "cd $parentDirectory.name/$projectDirectory.name && \ - $balJavaDebugParam bal test ${graalvmFlag} ${parallelTestFlag} ${testCoverageParams} ${groupParams} ${disableGroups} ${debugParams}&& exit %%ERRORLEVEL%% " + $balJavaDebugParam bal test ${graalvmFlag} ${parallelTestFlag} ${testCoverageParams} ${groupParams} ${disableGroups} ${debugParams}" """ if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "$balTestWithDocker" + commandLine 'cmd', '/c', "$balTestWithDocker && exit %%ERRORLEVEL%%" } else { commandLine 'sh', '-c', "$balTestWithDocker" } @@ -413,7 +413,7 @@ class BallerinaPlugin implements Plugin { /bin/sh -c "find /home/ballerina/$parentDirectory.name -type d -name 'build' -exec rm -rf {} + && find /home/ballerina/$parentDirectory.name -type d -name 'target' -exec rm -rf {} +" """ if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "$deleteUsingDocker" + commandLine 'cmd', '/c', "$deleteUsingDocker && exit %%ERRORLEVEL%%" } else { commandLine 'sh', '-c', "$deleteUsingDocker" }