Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix ETO-325: Add sonarqube properties #399

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Build
name: Sonar Build
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- develop
jobs:
build:
name: Build
name: Sonar Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -28,4 +32,4 @@ jobs:
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
40 changes: 38 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id 'java'
id 'maven-publish'
id "org.sonarqube" version "2.6"
id "org.sonarqube" version "5.0.0.4638"
id 'war'
id 'idea'
id 'groovy'
id 'jacoco'
id 'com.etendoerp.gradleplugin' version '1.3.3'
id 'org.kordamp.gradle.jandex' version '0.11.0'
}
Expand Down Expand Up @@ -112,12 +113,48 @@ publishing {
}
}

jacoco {
toolVersion = "0.8.10"
}

jacocoTestReport {
executionData fileTree(dir: "$buildDir/jacoco", include: "**/*.exec")
reports {
xml.required = true
html.required = true
}
}

task exportProjectVersion doLast {
ant.propertyfile(file: "version.properties") {
entry(key: "version.tag", value: project.version)
}
}

/**
* Configuration for running static code analysis with SonarQube and generating code quality reports.
*/
sonarqube {
properties {
property "sonar.host.url", "$sonarHostUrl"
property "sonar.login", "$sonarToken"
property "sonar.projectBaseDir", "$sonarProjectBaseDir"
property "sonar.projectName", "$sonarProjectName"
property "sonar.projectKey", "$sonarProjectKey"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "$sonarSources"
property "sonar.tests", "src-test/src"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "$buildDir"+"/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.projectVersion", "$sonarVersion"
property "sonar.branch.name", "$sonarBranchName"
property "sonar.scm.disabled", "true"
property "sonar.exclusions", "src-gen"
}
}

tasks['sonarqube'].dependsOn jacocoTestReport

task upgradeCoreVersion {
final String RELEASE = 'release'
final String HOTFIX = 'hotfix'
Expand Down Expand Up @@ -311,4 +348,3 @@ task call_sass(type: Exec) {}
task deploySkin (dependsOn: ["cssCompile", "deploy.skin"]) doLast {

}

9 changes: 9 additions & 0 deletions gradle.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ bbdd.user=tad
bbdd.password=tad

org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

sonarHostUrl=
sonarToken=
sonarProjectBaseDir=
sonarProjectName=
sonarProjectKey=
sonarSources=
sonarBranchName=
sonarVersion=
Loading