Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/pull-request-build-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java-25-migration
secrets: inherit
2 changes: 1 addition & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ keywords = ["edi"]
repository = "https://github.com/ballerina-platform/module-ballerina-edi"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.12.0"
distribution = "2201.14.0-20260527-050400-74f7e6bf"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.12.0"
distribution-version = "2201.14.0-20260527-050400-74f7e6bf"

[[package]]
org = "ballerina"
Expand Down
55 changes: 54 additions & 1 deletion ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,51 @@
*
*/
import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.process.ExecOperations
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.jvm.toolchain.JavaToolchainService
import javax.inject.Inject

abstract class BallerinaExecHelper {
@Inject abstract ExecOperations getExecOperations()
}

abstract class PatchBallerinaScriptsTask extends DefaultTask {
@Inject abstract JavaToolchainService getJavaToolchainService()
@Input abstract Property<String> getJballerinaToolsBinPath()
@Input abstract Property<String> getBallerinaRuntimeBinPath()

@TaskAction
void patch() {
def launcher = javaToolchainService.launcherFor { spec ->
spec.languageVersion.set(JavaLanguageVersion.of(25))
}.get()
def java25Home = launcher.executablePath.asFile.parentFile.parentFile.absolutePath

[new File(jballerinaToolsBinPath.get()), new File(ballerinaRuntimeBinPath.get())].each { binDir ->
if (binDir.exists()) {
binDir.eachFile { file ->
file.setExecutable(true)
Comment on lines +41 to +42

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Add isDirectory guard to prevent IOException on subdirectories.

binDir.eachFile iterates over both files and directories. If a subdirectory exists in bin/, file.text at line 44 will throw an IOException.

🛡️ Proposed fix
         binDir.eachFile { file ->
+            if (file.isDirectory()) return
             file.setExecutable(true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
binDir.eachFile { file ->
file.setExecutable(true)
binDir.eachFile { file ->
if (file.isDirectory()) return
file.setExecutable(true)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ballerina/build.gradle` around lines 41 - 42, The bin directory iteration in
the build script can hit subdirectories and later fail when reading file
contents, so add an isDirectory guard inside the binDir.eachFile block before
any file.text or executable handling. Update the logic around the file iteration
in the build.gradle script so only regular files are processed, leaving
directories untouched and preventing IOException during the rewrite step.

if (!file.name.endsWith('.bat') && !file.name.endsWith('.cmd')) {
def original = file.text
def lines = original.split('\n').toList()
lines = lines.collect { it.replace('--sun-misc-unsafe-memory-access=allow', '').trim() }.findAll { !it.isEmpty() }
def shebangIdx = lines.findIndexOf { it.startsWith('#!') }
if (shebangIdx >= 0 && !lines.any { it.startsWith('export JAVA_HOME=') }) {
lines.add(shebangIdx + 1, "export JAVA_HOME='${java25Home}'")
}
def patched = lines.join('\n') + '\n'
if (patched != original) { file.text = patched }
}
}
}
}
}
}

buildscript {
repositories {
mavenLocal()
maven {
url = 'https://maven.pkg.github.com/ballerina-platform/plugin-gradle'
credentials {
Expand Down Expand Up @@ -72,8 +114,9 @@ task updateTomlFiles {
}

task commitTomlFiles {
def execHelper = project.objects.newInstance(BallerinaExecHelper)
doLast {
project.exec {
execHelper.execOperations.exec {
ignoreExitValue true
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the native jar versions\" Ballerina.toml Dependencies.toml"
Expand All @@ -84,6 +127,16 @@ task commitTomlFiles {
}
}

task patchBallerinaScripts(type: PatchBallerinaScriptsTask) {
dependsOn 'unpackJballerinaTools'
outputs.upToDateWhen { !tasks.named('unpackJballerinaTools').get().didWork }
jballerinaToolsBinPath = layout.buildDirectory.dir("jballerina-tools-${project.ballerinaLangVersion}/bin").get().asFile.absolutePath
ballerinaRuntimeBinPath = "${rootProject.projectDir.absolutePath}/target/ballerina-runtime/bin"
}

build.dependsOn patchBallerinaScripts
test.dependsOn patchBallerinaScripts

publishing {
publications {
maven(MavenPublication) {
Expand Down
6 changes: 3 additions & 3 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ task downloadCheckstyleRuleFiles(type: Download) {
])
overwrite false
onlyIfNewer true
dest buildDir
dest layout.buildDirectory.get().asFile
}

jar {
Expand All @@ -39,10 +39,10 @@ clean {
enabled = false
}

artifacts.add('default', file("$project.buildDir/checkstyle.xml")) {
artifacts.add('default', layout.buildDirectory.file("checkstyle.xml")) {
builtBy('downloadCheckstyleRuleFiles')
}

artifacts.add('default', file("$project.buildDir/suppressions.xml")) {
artifacts.add('default', layout.buildDirectory.file("suppressions.xml")) {
builtBy('downloadCheckstyleRuleFiles')
}
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ keywords = ["edi"]
repository = "https://github.com/ballerina-platform/module-ballerina-edi"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.12.0"
distribution = "2201.14.0-20260527-050400-74f7e6bf"
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ allprojects {
version = project.version

apply plugin: 'jacoco'
jacoco {
toolVersion = jacocoVersion
}
apply plugin: 'maven-publish'

repositories {
Expand Down Expand Up @@ -67,6 +70,14 @@ subprojects {
jbalTools
}

plugins.withId('java') {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
}

dependencies {
/* JBallerina Tools */
jbalTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") {
Expand Down Expand Up @@ -102,6 +113,6 @@ release {
}
}

task build {
tasks.named('build') {
dependsOn('edi-ballerina:build')
}
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ group=io.ballerina.stdlib
version=1.6.0-SNAPSHOT

checkstylePluginVersion=10.12.0
spotbugsPluginVersion=6.0.18
spotbugsPluginVersion=6.5.1
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
ballerinaGradlePluginVersion=2.3.0
releasePluginVersion=3.1.0
ballerinaGradlePluginVersion=4.0.0

ballerinaLangVersion=2201.12.0
ballerinaLangVersion=2201.14.0-20260527-050400-74f7e6bf

#stdlib dependencies
stdlibIoVersion=1.8.0
Expand All @@ -21,3 +21,4 @@ stdlibOsVersion=1.10.0
stdlibTimeVersion=2.7.0
observeVersion=1.5.0
observeInternalVersion=1.5.0
jacocoVersion=0.8.14
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f
11 changes: 7 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/

pluginManagement {
repositories {
gradlePluginPortal()
}
Comment on lines +11 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the latest version of the Gradle Develocity plugin (com.gradle.develocity)?

💡 Result:

The latest version of the Develocity Gradle plugin (com.gradle.develocity) is 4.5.0, released on June 30, 2026 [1][2][3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate Develocity plugin references and the settings file context.
git ls-files | rg '(^|/)(settings\.gradle|settings\.gradle\.kts|build\.gradle(\.kts)?)$|develocity|gradle\.enterprise'

printf '\n--- settings.gradle ---\n'
if [ -f settings.gradle ]; then
  cat -n settings.gradle | sed -n '1,120p'
fi

printf '\n--- search for com.gradle.develocity / com.gradle.enterprise / 3.19.2 ---\n'
rg -n 'com\.gradle\.(develocity|enterprise)|3\.19\.2|develocity\s*\{' -S .

Repository: ballerina-platform/module-ballerina-edi

Length of output: 1943


Update the Develocity plugin version settings.gradle:23 — the migration is correct, but com.gradle.develocity is still pinned to 3.19.2; bump it to the current stable 4.5.0.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@settings.gradle` around lines 11 - 13, The Develocity plugin is still pinned
to the old version in the plugin management setup, so update the
`com.gradle.develocity` version in `settings.gradle` from `3.19.2` to `4.5.0`
while keeping the existing migration and repository configuration intact. Use
the plugin declaration in the `settings.gradle` plugin resolution block to make
sure the build applies the current stable release.

plugins {
id "com.github.spotbugs-base" version "${spotbugsPluginVersion}"
id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}"
Expand All @@ -17,7 +20,7 @@ pluginManagement {
}

plugins {
id "com.gradle.enterprise" version "3.13.2"
id "com.gradle.develocity" version "3.19.2"
}

include ':checkstyle'
Expand All @@ -28,9 +31,9 @@ project(':checkstyle').projectDir = file("build-config${File.separator}checkstyl
project(':edi-ballerina').projectDir = file('ballerina')
project(':edi-examples').projectDir = file('examples')

gradleEnterprise {
develocity {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
termsOfUseUrl = 'https://gradle.com/terms-of-service'
termsOfUseAgree = 'yes'
}
}
11 changes: 11 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@
-->
<FindBugsFilter>

<!-- Pre-existing issues surfaced by SpotBugs 4.9.x (bundled in plugin >= 6.2.0) -->
<Match>
<BugCode name="THROWS"/>
</Match>
<Match>
<BugCode name="AT"/>
</Match>
<Match>
<BugCode name="USELESS_STRING"/>
</Match>
Comment on lines +20 to +29

</FindBugsFilter>
Loading