diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index aabac0a..5204e57 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -12,11 +12,11 @@ jobs: if: github.repository_owner == 'ballerina-platform' steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - distribution: 'adopt' - java-version: 17.0.7 + distribution: 'temurin' + java-version: 21 - name: Change to Timestamped Version run: | startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00') diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 007ed0f..4763742 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: - distribution: 'adopt' - java-version: 17.0.7 + distribution: 'temurin' + java-version: 21 - name: Set environment variable if: github.event.action == 'check_connector_for_breaking_changes' diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c2c6fb5..4637a77 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -10,11 +10,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: 17.0.7 + distribution: 'temurin' + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f7cc162..169024f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -17,11 +17,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: 17.0.7 + distribution: 'temurin' + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/update-layer.yml b/.github/workflows/update-layer.yml index fbc2d38..cb134da 100644 --- a/.github/workflows/update-layer.yml +++ b/.github/workflows/update-layer.yml @@ -7,7 +7,7 @@ jobs: upload: runs-on: ubuntu-latest env: - LAYER_NAME: "ballerina-jre17" + LAYER_NAME: "ballerina-jre21" TEMP_BUCKET_NAME: "layer-bucket-temp1" strategy: max-parallel: 1 @@ -31,9 +31,9 @@ jobs: run: | bucketName="${TEMP_BUCKET_NAME}-${{ matrix.region }}-${{ GITHUB.RUN_NUMBER }}" cd ballerina-layer - wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jre_x64_linux_hotspot_17.0.7_7.tar.gz -O openjre.tar.gz + wget https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jre_x64_linux_hotspot_21.0.5_11.tar.gz -O openjre.tar.gz tar -xvzf openjre.tar.gz - mv jdk-17.0.7+7-jre jdk + mv jdk-21.0.5+11-jre jdk zip -r layer.zip jdk bootstrap if [[ "${{ matrix.region }}" == "us-east-1" ]]; then aws s3api create-bucket --bucket $bucketName --region ${{ matrix.region }} diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 5a662ab..6773189 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -7,5 +7,5 @@ repository = "https://github.com/ballerina-platform/module-ballerinax-aws.lambda license = ["Apache-2.0"] keywords = ["aws", "lambda", "serverless", "cloud"] -[platform.java17] +[platform.java21] graalvmCompatible = true diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 4953485..3bd679a 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -7,5 +7,5 @@ repository = "https://github.com/ballerina-platform/module-ballerinax-aws.lambda license = ["Apache-2.0"] keywords = ["aws", "lambda", "serverless", "cloud"] -[platform.java17] +[platform.java21] graalvmCompatible = true diff --git a/build-config/resources/BallerinaTest.toml b/build-config/resources/BallerinaTest.toml index df05978..93cd5d8 100644 --- a/build-config/resources/BallerinaTest.toml +++ b/build-config/resources/BallerinaTest.toml @@ -3,5 +3,5 @@ org = "ballerinax" name = "aws.lambda.tests" version = "@toml.version@" -[platform.java17] +[platform.java21] graalvmCompatible = true diff --git a/build.gradle b/build.gradle index 8768151..f719ac4 100644 --- a/build.gradle +++ b/build.gradle @@ -16,10 +16,10 @@ */ plugins { - id "com.github.spotbugs" version "5.0.14" - id "com.github.johnrengelman.shadow" version "8.1.1" - id "de.undercouch.download" version "5.4.0" - id "net.researchgate.release" version "2.8.0" + id "com.github.spotbugs-base" version "${spotbugsPluginVersion}" + id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}" + id "de.undercouch.download" version "${downloadPluginVersion}" + id "net.researchgate.release" version "${releasePluginVersion}" } ext.googleGsonVersion = "2.7" @@ -104,6 +104,7 @@ subprojects { ballerinaStdLibs "io.ballerina.stdlib:http-ballerina:${stdlibHttpVersion}" ballerinaStdLibs "io.ballerina.stdlib:observe-ballerina:${observeVersion}" ballerinaStdLibs "io.ballerina:observe-ballerina:${observeInternalVersion}" + ballerinaStdLibs "io.ballerina.lib:data.jsondata-ballerina:${stdlibDataJsonDataVersion}" } } diff --git a/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/LambdaFunctionHolder.java b/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/LambdaFunctionHolder.java index b06262b..5d261e7 100644 --- a/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/LambdaFunctionHolder.java +++ b/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/LambdaFunctionHolder.java @@ -29,7 +29,7 @@ public class LambdaFunctionHolder { private static LambdaFunctionHolder instance; private final List generatedFunctions; - public LambdaFunctionHolder() { + private LambdaFunctionHolder() { this.generatedFunctions = new ArrayList<>(); } diff --git a/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/tasks/LambdaCodeGeneratedTask.java b/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/tasks/LambdaCodeGeneratedTask.java index 612e1d6..209a7c6 100644 --- a/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/tasks/LambdaCodeGeneratedTask.java +++ b/compiler-plugin/src/main/java/org/ballerinax/aws/lambda/generator/tasks/LambdaCodeGeneratedTask.java @@ -87,7 +87,7 @@ public void perform(CompilerLifecycleEventContext lifecycleEventContext) { String version = getResourceFileAsString("layer-version.txt"); String fileName = executablePath.getFileName().toString(); String balxName = fileName.substring(0, fileName.lastIndexOf('.')); - String layer = " --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre17:" + version; + String layer = " --layers arn:aws:lambda:$REGION_ID:134633749276:layer:ballerina-jre21:" + version; if (isNative) { layer = ""; } diff --git a/gradle.properties b/gradle.properties index 5c2111f..90ee6b0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,23 +3,32 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8' group=org.ballerinax.awslambda version=3.2.1-SNAPSHOT systemProp.org.gradle.internal.publish.checksums.insecure=true -ballerinaLangVersion=2201.8.0 -stdlibConstraintVersion=1.4.0 -stdlibIoVersion=1.6.0 -stdlibLogVersion=2.9.0 -stdlibHttpVersion=2.10.0 -stdlibAuthVersion=2.10.0 -stdlibFileVersion=1.9.0 -stdlibCacheVersion=3.7.0 -stdlibCryptoVersion=2.5.0 -stdlibTimeVersion=2.4.0 -stdlibMimeVersion=2.9.0 -stdlibOsVersion=1.8.0 -stdlibTaskVersion=2.5.0 -stdlibJwtVersion=2.10.0 -stdlibOAuth2Version=2.10.0 -stdlibUuidVersion=1.7.0 -stdlibUrlVersion=2.4.0 -observeVersion=1.2.0 -observeInternalVersion=1.2.0 +spotbugsPluginVersion=6.0.18 +shadowJarPluginVersion=8.1.1 +downloadPluginVersion=5.4.0 +releasePluginVersion=2.8.0 +ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77 +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibLogVersion=2.10.1-20241113-120000-4577868 +stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a +stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibFileVersion=1.10.1-20241113-151700-e1a2e38 +stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf +stdlibCryptoVersion=2.7.3-20241113-081400-d015a39 +stdlibTimeVersion=2.6.0-20241113-073800-201b904 +stdlibMimeVersion=2.10.2-20241113-154200-d953747 +stdlibOsVersion=1.8.1-20241113-122000-cca973b +stdlibTaskVersion=2.5.1-20241113-123500-f905281 +stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa +stdlibGrpcVersion=1.13.0-20241114-195700-5188f60 +stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe +stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739 +stdlibUuidVersion=1.8.1-20241113-154400-443c67b +stdlibGraphqlVersion=1.15.0-20241117-164000-4d95b39 +stdlibUrlVersion=2.4.1-20241113-073900-335ff51 +stdlibWebsubVersion=2.13.0-20241114-233100-73205d6 +stdlibWebsubhubVersion=1.13.0-20241116-124900-2bb76a4 +observeVersion=1.4.0-20241113-092000-b83ae74 +observeInternalVersion=1.3.1-20241113-101700-265054d ballerinaGradlePluginVersion=2.0.1 diff --git a/gradle/javaProject.gradle b/gradle/javaProject.gradle index e5a4b68..720616e 100644 --- a/gradle/javaProject.gradle +++ b/gradle/javaProject.gradle @@ -40,7 +40,7 @@ tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } -sourceCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 jacoco { toolVersion = "0.8.10" @@ -63,8 +63,11 @@ test { spotbugsMain { ignoreFailures = true - 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("spotbugs-exclude.xml") if (excludeFile.exists()) { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85..7101f8e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail