Skip to content

Commit

Permalink
Print warning log for using local bal-distribution in depedencies block
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Aug 6, 2024
1 parent 56c535c commit 55570ed
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class BallerinaPlugin implements Plugin<Project> {

project.dependencies {
if (ballerinaExtension.isConnector) {
println("[Warning] skip downloading jBallerinaTools dependency: project uses locally installed Ballerina distribution to build the module")
return
}

Expand All @@ -105,10 +106,6 @@ class BallerinaPlugin implements Plugin<Project> {
}
}

if (ballerinaExtension.isConnector) {
return
}

doLast {
project.configurations.jbalTools.resolvedConfiguration.resolvedArtifacts.each { artifact ->
project.copy {
Expand All @@ -132,10 +129,6 @@ class BallerinaPlugin implements Plugin<Project> {
project.tasks.register('unpackStdLibs') {
dependsOn(project.unpackJballerinaTools)

if (ballerinaExtension.isConnector) {
return
}

doLast {
project.configurations.ballerinaStdLibs.resolvedConfiguration.resolvedArtifacts.each { artifact ->
project.copy {
Expand All @@ -149,11 +142,6 @@ class BallerinaPlugin implements Plugin<Project> {
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 ->
Expand Down Expand Up @@ -374,18 +362,18 @@ class BallerinaPlugin implements Plugin<Project> {
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"
}
}
}
}
Expand Down

0 comments on commit 55570ed

Please sign in to comment.