From ae19a152a4d6e0c834b5649e1fd98f5b42147d04 Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 31 Jan 2025 16:25:31 +0530 Subject: [PATCH 1/6] Update the Ballerina Gradle Plugin version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 35f39913..303a1e33 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ underCouchDownloadVersion=5.4.0 researchgateReleaseVersion=2.8.0 testngVersion=7.6.1 gsonVersion=2.10.1 -ballerinaGradlePluginVersion=2.0.1 +ballerinaGradlePluginVersion=2.3.0 ballerinaLangVersion=2201.11.0-20250127-101700-a4b67fe5 From f31de902f73078110eff5bab036bffabedbd648e Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 31 Jan 2025 16:48:07 +0530 Subject: [PATCH 2/6] Fix build scripts --- ballerina/build.gradle | 17 ++--------------- build.gradle | 18 ++++++++++++------ compiler-plugin-test/build.gradle | 4 ++-- compiler-plugin/build.gradle | 4 ++-- gradle.properties | 11 +++++------ native/build.gradle | 2 +- settings.gradle | 21 +++++++++++++++++++++ 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index a1cd9cb1..49cf86a3 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -17,19 +17,8 @@ import org.apache.tools.ant.taskdefs.condition.Os -buildscript { - repositories { - maven { - url = 'https://maven.pkg.github.com/ballerina-platform/plugin-gradle' - credentials { - username System.getenv('packageUser') - password System.getenv('packagePAT') - } - } - } - dependencies { - classpath "io.ballerina:plugin-gradle:${project.ballerinaGradlePluginVersion}" - } +plugins { + id 'io.ballerina.plugin' } description = 'Ballerina - Persist Ballerina Generator' @@ -57,8 +46,6 @@ def stripBallerinaExtensionVersion(String extVersion) { } } -apply plugin: 'io.ballerina.plugin' - ballerina { packageOrganization = packageOrg module = packageName diff --git a/build.gradle b/build.gradle index a71e9eef..ed252f26 100644 --- a/build.gradle +++ b/build.gradle @@ -16,10 +16,10 @@ */ plugins { - id "com.github.spotbugs" version "${githubSpotbugsVersion}" - id "com.github.johnrengelman.shadow" version "${githubJohnrengelmanShadowVersion}" - id "de.undercouch.download" version "${underCouchDownloadVersion}" - id "net.researchgate.release" version "${researchgateReleaseVersion}" + id "com.github.spotbugs" + id "com.github.johnrengelman.shadow" + id "de.undercouch.download" + id "net.researchgate.release" } description = 'Ballerina - Persist' @@ -67,8 +67,14 @@ allprojects { subprojects { configurations { - externalJars - ballerinaStdLibs + jbalTools + } + + dependencies { + /* JBallerina Tools */ + jbalTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") { + transitive = false + } } } diff --git a/compiler-plugin-test/build.gradle b/compiler-plugin-test/build.gradle index 6f2ad6b2..79a84fb1 100644 --- a/compiler-plugin-test/build.gradle +++ b/compiler-plugin-test/build.gradle @@ -33,7 +33,7 @@ def ballerinaDist = "${project.rootDir}/target/ballerina-runtime" dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${checkstylePluginVersion}" implementation project(":persist-compiler-plugin") testImplementation group: 'org.ballerinalang', name: 'ballerina-lang', version: "${ballerinaLangVersion}" testImplementation group: 'org.ballerinalang', name: 'ballerina-tools-api', version: "${ballerinaLangVersion}" @@ -118,7 +118,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "${project.puppycrawlCheckstyleVersion}" + toolVersion "${project.checkstylePluginVersion}" configFile rootProject.file("build-config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile": file("${rootDir}/build-config/checkstyle/build/suppressions.xml")] } diff --git a/compiler-plugin/build.gradle b/compiler-plugin/build.gradle index 9ebc4fb6..35d81970 100644 --- a/compiler-plugin/build.gradle +++ b/compiler-plugin/build.gradle @@ -25,7 +25,7 @@ description = 'Ballerina - Persist Compiler Plugin' dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${checkstylePluginVersion}" implementation group: 'org.ballerinalang', name: 'ballerina-lang', version: "${ballerinaLangVersion}" implementation group: 'org.ballerinalang', name: 'ballerina-tools-api', version: "${ballerinaLangVersion}" @@ -41,7 +41,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "${project.puppycrawlCheckstyleVersion}" + toolVersion "${project.checkstylePluginVersion}" configFile rootProject.file("build-config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile": file("${rootDir}/build-config/checkstyle/build/suppressions.xml")] } diff --git a/gradle.properties b/gradle.properties index 303a1e33..3d8ca68a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,11 @@ group=io.ballerina.stdlib version=1.5.0-SNAPSHOT -puppycrawlCheckstyleVersion=10.12.0 -checkstyleToolVersion=7.8.2 -githubSpotbugsVersion=6.0.18 -githubJohnrengelmanShadowVersion=7.1.2 -underCouchDownloadVersion=5.4.0 -researchgateReleaseVersion=2.8.0 +checkstylePluginVersion=10.12.0 +spotbugsPluginVersion=6.0.18 +shadowJarPluginVersion=7.1.2 +downloadPluginVersion=5.4.0 +releasePluginVersion=2.8.0 testngVersion=7.6.1 gsonVersion=2.10.1 ballerinaGradlePluginVersion=2.3.0 diff --git a/native/build.gradle b/native/build.gradle index 8e1c7581..08e31932 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -33,7 +33,7 @@ dependencies { jacocoRuntime "org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime" checkstyle project(":checkstyle") - checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${checkstylePluginVersion}" implementation group: 'org.ballerinalang', name: 'ballerina-lang', version: "${ballerinaLangVersion}" implementation group: 'org.ballerinalang', name: 'ballerina-runtime', version: "${ballerinaLangVersion}" } diff --git a/settings.gradle b/settings.gradle index a5c9992d..bebd3175 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,6 +7,27 @@ * in the user manual at https://docs.gradle.org/6.3/userguide/multi_project_builds.html */ +pluginManagement { + plugins { + 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}" + id "io.ballerina.plugin" version "${ballerinaGradlePluginVersion}" + } + + repositories { + gradlePluginPortal() + maven { + url = 'https://maven.pkg.github.com/ballerina-platform/*' + credentials { + username System.getenv("packageUser") + password System.getenv("packagePAT") + } + } + } +} + plugins { id "com.gradle.enterprise" version "3.13.2" } From 0713d8f945b5f3fec18f7697e5d8bfbcf845d0bd Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 31 Jan 2025 16:51:58 +0530 Subject: [PATCH 3/6] Fix build scripts --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index bebd3175..985ead60 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,7 +9,7 @@ pluginManagement { plugins { - id "com.github.spotbugs-base" version "${spotbugsPluginVersion}" + id "com.github.spotbugs" version "${spotbugsPluginVersion}" id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}" id "de.undercouch.download" version "${downloadPluginVersion}" id "net.researchgate.release" version "${releasePluginVersion}" From 570e6fce3fe11809b15f11b9039c0a73e5016446 Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 31 Jan 2025 16:54:03 +0530 Subject: [PATCH 4/6] Fix build scripts --- native/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/build.gradle b/native/build.gradle index 08e31932..5dfcb28b 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -109,7 +109,7 @@ task validateSpotbugs() { } checkstyle { - toolVersion "${checkstyleToolVersion}" + toolVersion "${checkstylePluginVersion}" configFile file("${rootDir}/build-config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile": file("${rootDir}/build-config/checkstyle/build/suppressions.xml")] } From 9b0345907adae662278160433539fbde0c973452 Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 31 Jan 2025 16:56:23 +0530 Subject: [PATCH 5/6] Fix build scripts --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index ed252f26..e7a61628 100644 --- a/build.gradle +++ b/build.gradle @@ -67,6 +67,7 @@ allprojects { subprojects { configurations { + ballerinaStdLibs jbalTools } From 19edd8187b0a76e643e56e006790cb56847b8e00 Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:20:55 +0530 Subject: [PATCH 6/6] Add native build as test dependency --- ballerina/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 49cf86a3..854dca90 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -96,6 +96,9 @@ publishing { updateTomlFiles.dependsOn copyStdlibs +test.dependsOn ":${packageName}-compiler-plugin:build" +test.dependsOn ":${packageName}-native:build" + build.dependsOn "generatePomFileForMavenPublication" build.dependsOn ":${packageName}-compiler-plugin:build" build.dependsOn ":${packageName}-native:build"