diff --git a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy index 5415bef..c1f25c4 100644 --- a/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy +++ b/src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy @@ -88,6 +88,7 @@ class BallerinaPlugin implements Plugin { project.dependencies { if (ballerinaExtension.isConnector) { + println("[Warning] skip downloading jBallerinaTools dependency: project uses locally installed Ballerina distribution to build the module") return } @@ -105,10 +106,6 @@ class BallerinaPlugin implements Plugin { } } - if (ballerinaExtension.isConnector) { - return - } - doLast { project.configurations.jbalTools.resolvedConfiguration.resolvedArtifacts.each { artifact -> project.copy { @@ -132,10 +129,6 @@ class BallerinaPlugin implements Plugin { project.tasks.register('unpackStdLibs') { dependsOn(project.unpackJballerinaTools) - if (ballerinaExtension.isConnector) { - return - } - doLast { project.configurations.ballerinaStdLibs.resolvedConfiguration.resolvedArtifacts.each { artifact -> project.copy { @@ -149,11 +142,6 @@ class BallerinaPlugin implements Plugin { project.tasks.register('copyStdlibs') { dependsOn(project.unpackStdLibs) - if (ballerinaExtension.isConnector) { - println("[Warning] skip downloading jBallerinaTools dependency: project uses locally installed Ballerina distribution to build the module") - return - } - doLast { /* Standard Libraries */ project.configurations.ballerinaStdLibs.resolvedConfiguration.resolvedArtifacts.each { artifact -> @@ -374,18 +362,18 @@ class BallerinaPlugin implements Plugin { project.exec { workingDir project.projectDir environment 'JAVA_OPTS', '-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true' - if (!ballerinaExtension.isConnector) { + if (ballerinaExtension.isConnector) { if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "$distributionBinPath/bal.bat push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local && exit %%ERRORLEVEL%%" + commandLine 'cmd', '/c', "bal.bat push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local && exit %%ERRORLEVEL%%" } else { - commandLine 'sh', '-c', "$distributionBinPath/bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local" + commandLine 'sh', '-c', "bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local" } } else { if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "bal.bat push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local && exit %%ERRORLEVEL%%" + commandLine 'cmd', '/c', "$distributionBinPath/bal.bat push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local && exit %%ERRORLEVEL%%" } else { - commandLine 'sh', '-c', "bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local" - } + commandLine 'sh', '-c', "$distributionBinPath/bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala --repository=local" + } } } }