Skip to content

Commit

Permalink
Merge pull request #25 from gayaldassanayake/fix-gradle-scan-report
Browse files Browse the repository at this point in the history
Fix gradle scan report to get the gradle scan report
  • Loading branch information
gayaldassanayake authored Oct 9, 2024
2 parents 9c4821c + d4bf3f7 commit 5453af9
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/full_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: '2201.10.0'
version: latest

- name: Build with Gradle
env:
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 6 additions & 21 deletions scan-command/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"
Expand Down Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion scan-command/tool-scan/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion scan-command/tool-scan/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.10.0"
distribution-version = "2201.10.1"

[[package]]
org = "ballerina"
Expand Down
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}

Expand All @@ -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'
}
}
}
25 changes: 5 additions & 20 deletions test-compiler-plugins/ballerina-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"
Expand Down
25 changes: 5 additions & 20 deletions test-compiler-plugins/ballerinax-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"
Expand Down
25 changes: 5 additions & 20 deletions test-compiler-plugins/exampleOrg-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"
Expand Down
25 changes: 5 additions & 20 deletions test-compiler-plugins/invalid-ruleformat-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 5453af9

Please sign in to comment.