From f1470f6cba440badd92dd5aca7674b3f4daaaa7d Mon Sep 17 00:00:00 2001 From: Danesh Kuruppu Date: Wed, 27 Nov 2024 18:09:07 +0530 Subject: [PATCH] re organize the gradle plugins --- ballerina/build.gradle | 17 ++--------------- build.gradle | 8 ++++---- compiler-plugin-tests/build.gradle | 4 ++-- compiler-plugin/build.gradle | 4 ++-- gradle.properties | 17 ++++++++--------- native/build.gradle | 4 ++-- settings.gradle | 21 +++++++++++++++++++++ 7 files changed, 41 insertions(+), 34 deletions(-) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 91b1552a..73c235c5 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 - MSSQL 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 00c0a94d..0d010d63 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-base" + id "com.github.johnrengelman.shadow" + id "de.undercouch.download" + id "net.researchgate.release" } description = 'Ballerina - MSSQL' diff --git a/compiler-plugin-tests/build.gradle b/compiler-plugin-tests/build.gradle index bc90e8de..36d2a5d6 100644 --- a/compiler-plugin-tests/build.gradle +++ b/compiler-plugin-tests/build.gradle @@ -31,7 +31,7 @@ configurations { dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${checkstylePluginVersion}" jacocoRuntime "org.jacoco:org.jacoco.agent:0.8.6:runtime" @@ -117,7 +117,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 56689562..50a93a65 100644 --- a/compiler-plugin/build.gradle +++ b/compiler-plugin/build.gradle @@ -26,7 +26,7 @@ description = 'Ballerina - MSSQL 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}" @@ -39,7 +39,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 933acc8a..c2343762 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,16 @@ group=io.ballerina.stdlib version=1.14.0-SNAPSHOT +ballerinaLangVersion=2201.11.0-20241121-075100-c4c87cbc -puppycrawlCheckstyleVersion=10.12.0 -msSQLDriverVersion=12.8.1.jre11 -checkstyleToolVersion=10.12.0 -githubSpotbugsVersion=6.0.18 -githubJohnrengelmanShadowVersion=8.1.0 -underCouchDownloadVersion=5.4.0 -researchgateReleaseVersion=2.8.0 -testngVersion=7.6.1 +checkstylePluginVersion=10.12.1 +spotbugsPluginVersion=6.0.18 +downloadPluginVersion=5.4.0 +shadowJarPluginVersion=8.1.1 +releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 -ballerinaLangVersion=2201.11.0-20241121-075100-c4c87cbc +msSQLDriverVersion=12.8.1.jre11 +testngVersion=7.6.1 stdlibSqlVersion=1.15.0-20241127-162900-c57df5b diff --git a/native/build.gradle b/native/build.gradle index 512b6501..81324daf 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -31,7 +31,7 @@ configurations { 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-runtime', version: "${ballerinaLangVersion}" implementation group: 'io.ballerina.stdlib', name: 'sql-native', version: "${stdlibSqlVersion}" @@ -99,7 +99,7 @@ task validateSpotbugs() { checkstyle { ignoreFailures = false - toolVersion "${checkstyleToolVersion}" + toolVersion "${checkstylePluginVersion}" configFile file("${rootDir}/build-config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile" : file("${rootDir}/build-config/checkstyle/build/suppressions.xml")] } diff --git a/settings.gradle b/settings.gradle index 2f5d5fc2..68b0fc02 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.2" }