diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8234a6c..47662b5 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,5 @@ 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@2201.10.x + uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main secrets: inherit diff --git a/README.md b/README.md index fd7ff4c..56bd7c0 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ bal run ### Setting up the prerequisites -1. Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources: +1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources: * [Oracle JDK](https://www.oracle.com/java/technologies/downloads/) * [OpenJDK](https://adoptium.net/) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index ac886fd..f5af10d 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,5 +1,5 @@ [package] -distribution = "2201.9.2" +distribution = "2201.11.0-20241117-133400-a3054b77" org = "ballerinax" name = "aws.marketplace.mpe" version = "0.1.1" @@ -9,10 +9,10 @@ keywords = ["AWS", "Marketplace", "Cloud/Subscriptions", "Entitlement Management icon = "icon.png" repository = "https://github.com/ballerina-platform/module-ballerinax-aws.marketplace.mpe" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.lib" artifactId = "aws.marketplace.mpe-native" version = "0.1.1" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index c2d59b2..5cfd9ea 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.9.2" +distribution-version = "2201.11.0-20241117-133400-a3054b77" [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -29,7 +29,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index b6eaa12..42c454d 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -1,5 +1,5 @@ [package] -distribution = "2201.9.2" +distribution = "2201.11.0-20241117-133400-a3054b77" org = "ballerinax" name = "aws.marketplace.mpe" version = "@toml.version@" @@ -9,10 +9,10 @@ keywords = ["AWS", "Marketplace", "Cloud/Subscriptions", "Entitlement Management icon = "icon.png" repository = "https://github.com/ballerina-platform/module-ballerinax-aws.marketplace.mpe" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.lib" artifactId = "aws.marketplace.mpe-native" version = "@project.version@" diff --git a/gradle.properties b/gradle.properties index 4e9b216..eb60c5d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ group=io.ballerina.lib version=0.1.2-SNAPSHOT checkstylePluginVersion=10.12.0 -spotbugsPluginVersion=5.0.14 +spotbugsPluginVersion=6.0.18 shadowJarPluginVersion=8.1.1 downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 testngVersion=7.6.1 eclipseLsp4jVersion=0.12.0 ballerinaGradlePluginVersion=2.2.4 -ballerinaLangVersion=2201.9.2 +ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77 -stdlibTimeVersion=2.4.0 +stdlibTimeVersion=2.6.0-20241113-073800-201b904 awsMpEntitlementSdkVersion=2.27.6 diff --git a/native/build.gradle b/native/build.gradle index 683bfad..a2b3de7 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -62,8 +62,11 @@ test { } spotbugsMain { - effort = "max" - reportLevel = "low" + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW reportsDir = file("$project.buildDir/reports/spotbugs") def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml") if (excludeFile.exists()) { diff --git a/native/src/main/java/io/ballerina/lib/aws/mpe/NativeClientAdaptor.java b/native/src/main/java/io/ballerina/lib/aws/mpe/NativeClientAdaptor.java index 5e5af63..ca5b4d6 100644 --- a/native/src/main/java/io/ballerina/lib/aws/mpe/NativeClientAdaptor.java +++ b/native/src/main/java/io/ballerina/lib/aws/mpe/NativeClientAdaptor.java @@ -19,7 +19,6 @@ package io.ballerina.lib.aws.mpe; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BObject; @@ -93,20 +92,18 @@ public static Object getEntitlements(Environment env, BObject bAwsMpeClient, BMa MarketplaceEntitlementClient nativeClient = (MarketplaceEntitlementClient) bAwsMpeClient .getNativeData(NATIVE_CLIENT); GetEntitlementsRequest entitlementsRequest = CommonUtils.getNativeRequest(request); - Future future = env.markAsync(); - EXECUTOR_SERVICE.execute(() -> { + return env.yieldAndRun(() -> { try { GetEntitlementsResponse entitlementsResponse = nativeClient.getEntitlements(entitlementsRequest); BMap bResponse = CommonUtils.getBallerinaResponse(entitlementsResponse); - future.complete(bResponse); + return bResponse; } catch (Exception e) { String errorMsg = String.format("Error occurred while retrieving entitlements for the product: %s", e.getMessage()); BError bError = CommonUtils.createError(errorMsg, e); - future.complete(bError); + return bError; } }); - return null; } /**