Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync package build with centralized workflow update #243

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
call_workflow_template:
name: Run Workflow Template
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@10.x-workflow-update
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
call_workflow:
name: Run Connector Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/build-connector-template.yml@10.x-workflow-update
secrets: inherit
with:
repo-name: module-ballerinax-azure-service-bus
2 changes: 1 addition & 1 deletion .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
call_workflow:
name: Run Daily Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/daily-build-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/daily-build-connector-template.yml@10.x-workflow-update
secrets: inherit
with:
repo-name: module-ballerinax-azure-service-bus
2 changes: 1 addition & 1 deletion .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
call_workflow:
name: Run Dev\Stage Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/dev-stage-central-publish-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/dev-stage-central-publish-connector-template.yml@10.x-workflow-update
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@10.x-workflow-update
secrets: inherit
with:
additional-test-flags: ${{ github.event.pull_request.head.repo.full_name != github.repository && '-x test' || ''}}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-connector-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-connector-template.yml@10.x-workflow-update
secrets: inherit
with:
package-name: asb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-connector-template.yml@10.x-workflow-update
secrets: inherit
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
distribution = "2201.8.0"
org = "ballerinax"
name = "asb"
version = "3.8.2"
version = "3.8.3-SNAPSHOT"
license= ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["IT Operations/Message Brokers", "Cost/Paid", "Vendor/Microsoft"]
Expand All @@ -19,8 +19,8 @@ graalvmCompatible = true
groupId = "org.ballerinax"
artifactId = "asb-native"
module = "asb-native"
version = "3.8.2"
path = "../native/build/libs/asb-native-3.8.2.jar"
version = "3.8.3-SNAPSHOT"
path = "../native/build/libs/asb-native-3.8.3-SNAPSHOT.jar"

[[platform.java17.dependency]]
groupId = "com.fasterxml.jackson.core"
Expand Down
4 changes: 2 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.8.0"
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand Down Expand Up @@ -127,7 +127,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "asb"
version = "3.8.2"
version = "3.8.3-SNAPSHOT"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.runtime"},
Expand Down
29 changes: 25 additions & 4 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,57 @@
* under the License.
*/

apply plugin: 'java-library'
import org.apache.tools.ant.taskdefs.condition.Os

apply plugin: 'java'

description = 'Ballerina - Azure Service Bus Examples'

def packageName = "asb"
def filePath = project.fileTree("${project.projectDir}")
def examples = filePath.matching {
include("**/*.bal")
exclude("**/deprecated/**/*.bal")
}

def executeBalCommand(String command, String dir) {
try {
exec {
workingDir dir
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "bal.bat ${command} && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "bal ${command}"
}
}
} catch (Exception e) {
println("bal command failed. " + e.message)
throw e
}
}

task testExamples {
dependsOn ":${project.packageName}-ballerina:build"
dependsOn ":${packageName}-ballerina:build"

doLast {
examples.each { example -> executeBalCommand ("run ${example}", "${project.rootDir}") }
}
}

task buildExamples {
dependsOn ":${project.packageName}-ballerina:build"
dependsOn ":${packageName}-ballerina:build"

gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(":${project.packageName}-examples:test")) {
if (graph.hasTask(":${packageName}-examples:test")) {
buildExamples.enabled = false
} else {
testExamples.enabled = false
}
}
doLast {
// TODO: Enabled --offline due to a bug in pulling incorrect versions from the central repository.
executeBalCommand ("pack", "${project.rootDir}/ballerina")
executeBalCommand ("push --repository=local", "${project.rootDir}/ballerina")
examples.each { example -> executeBalCommand ("build --offline ${example}", "${project.rootDir}") }
}
}
Expand Down
32 changes: 14 additions & 18 deletions examples/listner/create_listner.bal
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,23 @@ import ballerinax/asb;

configurable string connectionString = ?;

// Listner Configurations
asb:ListenerConfig configuration = {
connectionString: connectionString
};
listener asb:Listener asbListener = check new ({
connectionString,
entityConfig: {
queueName: "test-queue"
},
prefetchCount: 10,
autoComplete: false
});

listener asb:Listener asbListener = new (configuration);
service asb:Service on asbListener {

@asb:ServiceConfig {
queueName: "test-queue",
peekLockModeEnabled: true,
maxConcurrency: 1,
prefetchCount: 10,
maxAutoLockRenewDuration: 300
}
service asb:MessageService on asbListener {
isolated remote function onMessage(asb:Message message, asb:Caller caller) returns asb:Error? {
isolated remote function onMessage(asb:Message message, asb:Caller caller) returns error? {
log:printInfo("Message received from queue: " + message.toBalString());
_ = check caller.complete(message);
return caller->complete();
}

isolated remote function onError(asb:ErrorContext context, error 'error) returns asb:Error? {
log:printInfo("Error received from queue: " + context.toBalString());
isolated remote function onError(asb:MessageRetrievalError 'error) returns error? {
log:printError("Error occurred while retrieving messages from the queue", 'error);
}
};
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spotbugsPluginVersion=5.0.14
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
ballerinaGradlePluginVersion=2.2.4
ballerinaGradlePluginVersion=3.0.0

ballerinaLangVersion=2201.8.0
azureServiceBusVersion=7.14.3
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ rootProject.name = "ballerinax-${projectName}"
include ":checkstyle"
include ":${projectName}-native"
include ":${projectName}-ballerina"
include ":${projectName}-examples"

project(':checkstyle').projectDir = file("build-config${File.separator}checkstyle")
project(":${projectName}-native").projectDir = file('native')
project(":${projectName}-ballerina").projectDir = file('ballerina')
project(":${projectName}-examples").projectDir = file('examples')

gradleEnterprise {
buildScan {
Expand Down
Loading