diff --git a/buildspec/sonar-scanner.yml b/buildspec/sonar-scanner.yml index 2925f1ea..16dc47eb 100644 --- a/buildspec/sonar-scanner.yml +++ b/buildspec/sonar-scanner.yml @@ -17,7 +17,7 @@ phases: # Download unit test coverage report(s) - aws s3 cp --recursive "$DSSS3URI/cache/dss-sdk/$GITHUB_RUN_NUMBER/unit/df_out/reports/" df_out/reports/ --only-show-errors # replace the old CODEBUILD_SRC_DIR with the current one in bw-output - - sed -i -r "s|/codebuild/output/src[^/]+/src/github.com/OpenMPDK/dss-sdk|$CODEBUILD_SRC_DIR|g" bw-output/build-wrapper-dump.json + - sed -i -r "s|/codebuild/output/src[^/]+/src/github.com/OpenMPDK/dss-sdk|$CODEBUILD_SRC_DIR|g" bw-output/compile_commands.json # Download the latest sonar-scanner - rm -rf /sonar-scanner* - wget --no-verbose --content-disposition -E -c "https://search.maven.org/remote_content?g=org.sonarsource.scanner.cli&a=sonar-scanner-cli&v=LATEST&c=linux&e=zip" @@ -36,4 +36,5 @@ phases: -Dsonar.pullrequest.key=$(echo $GITHUB_REF | grep -oP "^refs/pull/\K[^/]+") \ -Dsonar.pullrequest.base=$GITHUB_BASE_REF \ -Dsonar.pullrequest.branch=$GITHUB_HEAD_REF \ - -Dsonar.coverageReportPaths=$SONAR_UNIT_TEST_REPORT + -Dsonar.coverageReportPaths=$SONAR_UNIT_TEST_REPORT \ + -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json diff --git a/sonar-project.properties b/sonar-project.properties index d3beb6e0..4176bb6c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,5 @@ sonar.organization=openmpdk sonar.projectKey=OpenMPDK_dss-sdk -sonar.cfamily.build-wrapper-output=bw-output sonar.sources=target/,host/,utils/ sonar.tests=target/,tests/,systemtests/ sonar.exclusions=target/test/**/*,target/oss/**/*,host/src/**/*,**/*.java