diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 8f505c8..ad4a937 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -36,7 +36,7 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew build + run: ./gradlew build --scan - name: Ballerina Central Dev Push if: ${{ inputs.environment == 'DEV CENTRAL' }} diff --git a/.github/workflows/full_build.yml b/.github/workflows/full_build.yml index 36ed9e8..5c0ec12 100644 --- a/.github/workflows/full_build.yml +++ b/.github/workflows/full_build.yml @@ -66,7 +66,7 @@ jobs: - name: Set Up Ballerina uses: ballerina-platform/setup-ballerina@v1.1.1 with: - version: '2201.10.0' + version: latest - name: Build with Gradle env: diff --git a/gradle.properties b/gradle.properties index 2695d7c..5f6a820 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,13 +5,14 @@ version=0.1.0 spotbugsPluginVersion=5.0.14 downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 +enterprisePluginVersion=3.18.1 # Dependency versions picoCLIVersion=4.7.5 gsonVersion=2.10.1 -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.10.1 puppycrawlCheckstyleVersion=10.12.1 apacheCommonsLang3Version=3.0 commonsIoVersion=2.15.1 -testngVersion=7.6.1 +testngVersion=7.7.0 jacocoVersion=0.8.10 diff --git a/scan-command/build.gradle b/scan-command/build.gradle index 94d7713..1be5a0b 100644 --- a/scan-command/build.gradle +++ b/scan-command/build.gradle @@ -103,7 +103,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -124,8 +124,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -141,8 +141,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -151,21 +151,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy scan tool def packageOrg = "ballerina" def packageName = "tool_scan" @@ -288,7 +273,7 @@ tasks.test { } // Codecove configurations -def execFile = new File("${buildDir}/jacoco/test.exec"); +def execFile = new File("${buildDir}/jacoco/test.exec") def classFileArray = [] tasks.register('copyExecFilesAndJavaClassFiles') { if (execFile.exists()) { diff --git a/scan-command/tool-scan/Ballerina.toml b/scan-command/tool-scan/Ballerina.toml index e0ef03a..190051a 100644 --- a/scan-command/tool-scan/Ballerina.toml +++ b/scan-command/tool-scan/Ballerina.toml @@ -2,7 +2,7 @@ org = "ballerina" name = "tool_scan" version = "0.1.0" -distribution = "2201.10.0" +distribution = "2201.10.1" authors = ["Ballerina"] keywords = ["scan", "static code analysis"] license = ["Apache-2.0"] diff --git a/scan-command/tool-scan/Dependencies.toml b/scan-command/tool-scan/Dependencies.toml index da6f24c..b9ab987 100644 --- a/scan-command/tool-scan/Dependencies.toml +++ b/scan-command/tool-scan/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.10.1" [[package]] org = "ballerina" diff --git a/settings.gradle b/settings.gradle index 388dae6..7f7194a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,6 +25,7 @@ pluginManagement { id 'com.github.spotbugs' version "${spotbugsPluginVersion}" id 'de.undercouch.download' version "${downloadPluginVersion}" id "net.researchgate.release" version "${releasePluginVersion}" + id "com.gradle.enterprise" version "${enterprisePluginVersion}" } } @@ -38,3 +39,12 @@ include 'test-compiler-plugins:invalid-rules-plugin' include 'test-compiler-plugins:invalid-ruleformat-plugin' include 'test-compiler-plugins:invalid-rulekind-plugin' include 'test-static-code-analysis-platform-plugins:exampleOrg-static-code-analysis-platform-plugin' + +if (gradle.startParameter.buildScan) { + gradleEnterprise { + buildScan { + termsOfServiceUrl = 'https://gradle.com/terms-of-service' + termsOfServiceAgree = 'yes' + } + } +} diff --git a/test-compiler-plugins/ballerina-plugin/build.gradle b/test-compiler-plugins/ballerina-plugin/build.gradle index 8f22bf7..1b139df 100644 --- a/test-compiler-plugins/ballerina-plugin/build.gradle +++ b/test-compiler-plugins/ballerina-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "ballerina" def packageName = "example_module_static_code_analyzer" diff --git a/test-compiler-plugins/ballerinax-plugin/build.gradle b/test-compiler-plugins/ballerinax-plugin/build.gradle index 111d4b7..bf78ce7 100644 --- a/test-compiler-plugins/ballerinax-plugin/build.gradle +++ b/test-compiler-plugins/ballerinax-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "ballerinax" def packageName = "example_module_static_code_analyzer" diff --git a/test-compiler-plugins/exampleOrg-plugin/build.gradle b/test-compiler-plugins/exampleOrg-plugin/build.gradle index 9a06eff..8bb1c32 100644 --- a/test-compiler-plugins/exampleOrg-plugin/build.gradle +++ b/test-compiler-plugins/exampleOrg-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "exampleOrg" def packageName = "example_module_static_code_analyzer" diff --git a/test-compiler-plugins/invalid-ruleformat-plugin/build.gradle b/test-compiler-plugins/invalid-ruleformat-plugin/build.gradle index 5c4eba7..555c79d 100644 --- a/test-compiler-plugins/invalid-ruleformat-plugin/build.gradle +++ b/test-compiler-plugins/invalid-ruleformat-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "invalid" def packageName = "invalid_module_ruleformat_static_code_analyzer" diff --git a/test-compiler-plugins/invalid-rulekind-plugin/build.gradle b/test-compiler-plugins/invalid-rulekind-plugin/build.gradle index d652560..8564b00 100644 --- a/test-compiler-plugins/invalid-rulekind-plugin/build.gradle +++ b/test-compiler-plugins/invalid-rulekind-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "invalid" def packageName = "invalid_module_rulekind_static_code_analyzer" diff --git a/test-compiler-plugins/invalid-rules-plugin/build.gradle b/test-compiler-plugins/invalid-rules-plugin/build.gradle index a87d3e9..22debc1 100644 --- a/test-compiler-plugins/invalid-rules-plugin/build.gradle +++ b/test-compiler-plugins/invalid-rules-plugin/build.gradle @@ -85,7 +85,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -106,8 +106,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -123,8 +123,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -133,21 +133,6 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - // Configurations to automatically build and deploy custom static code analyzer compiler plugin def packageOrg = "invalid" def packageName = "invalid_module_rules_static_code_analyzer" diff --git a/test-static-code-analysis-platform-plugins/exampleOrg-static-code-analysis-platform-plugin/build.gradle b/test-static-code-analysis-platform-plugins/exampleOrg-static-code-analysis-platform-plugin/build.gradle index 1e0e5f6..d8f7d12 100644 --- a/test-static-code-analysis-platform-plugins/exampleOrg-static-code-analysis-platform-plugin/build.gradle +++ b/test-static-code-analysis-platform-plugins/exampleOrg-static-code-analysis-platform-plugin/build.gradle @@ -72,7 +72,7 @@ artifacts.add('default', file("${project.buildDir}/suppressions.xml")) { } def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { exclude excludePattern } @@ -93,8 +93,8 @@ spotbugsMain { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -110,8 +110,8 @@ spotbugsTest { reportsDir = file("$project.buildDir/reports/spotbugs") reports { - html.enabled true - text.enabled = true + html.required.set(true) + text.required.set(true) } def excludeFile = file("${projectDir}/spotbugs-exclude.xml") @@ -120,19 +120,4 @@ spotbugsTest { } } -tasks.register('validateSpotbugs') { - doLast { - if (spotbugsMain.reports.size() > 0 && spotbugsMain.reports[0].destination.exists() && - spotbugsMain.reports[0].destination.text.readLines().size() > 0) { - spotbugsMain.reports[0].destination?.eachLine { - println 'Failure: ' + it - } - } else { - throw new GradleException("Spotbugs rule violations were found."); - } - } -} - -spotbugsMain.finalizedBy validateSpotbugs - -jar.archiveFileName = "${project.name}.jar"; \ No newline at end of file +jar.archiveFileName = "${project.name}.jar" \ No newline at end of file