aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-09-24 18:37:21 +0200
committersonartech <sonartech@sonarsource.com>2024-09-26 20:03:15 +0000
commit021c7d4764e6f4e28b1741de4fdc6961ea82f37f (patch)
treeee0335529c0a41277d0d4967ccf3cf5e4ac74dba
parentb19fa90cfac72cd60436408c8c20a93349776c15 (diff)
downloadsonarqube-021c7d4764e6f4e28b1741de4fdc6961ea82f37f.tar.gz
sonarqube-021c7d4764e6f4e28b1741de4fdc6961ea82f37f.zip
SONAR-23139 Use -D everywhere for consistency
Co-authored-by: Benjamin Raymond <31401273+7PH@users.noreply.github.com>
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap16
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap6
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx10
4 files changed, 19 insertions, 19 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
index f80ef0f9d56..bc5a71eb7fc 100644
--- a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
@@ -184,7 +184,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: C++ Linux: .github/workflows/build.yml 1`] = `
@@ -220,7 +220,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: C++ MacOS: .github/workflows/build.yml 1`] = `
@@ -256,7 +256,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: C++ Windows: .github/workflows/build.yml 1`] = `
@@ -292,7 +292,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: C++: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
@@ -442,7 +442,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: Objective-C Linux: .github/workflows/build.yml 1`] = `
@@ -478,7 +478,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: Objective-C MacOS: .github/workflows/build.yml 1`] = `
@@ -514,7 +514,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: Objective-C Windows: .github/workflows/build.yml 1`] = `
@@ -550,7 +550,7 @@ jobs:
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json""
`;
exports[`should follow and complete all steps: Objective-C: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
index a38cc8b2f65..b4081a07c94 100644
--- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
@@ -56,7 +56,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
} else if (OSs.MacOS === os) {
return `
- name: Install sonar-scanner and build-wrapper
@@ -72,7 +72,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
} else if (OSs.Windows === os) {
return `
- name: Install sonar-scanner and build-wrapper
@@ -88,7 +88,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
run: |
- sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
+ sonar-scanner -Dsonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`;
}
return '';
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
index 9d7f5f44b36..4097c7460d0 100644
--- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
@@ -85,7 +85,7 @@ build:
stage: build-analyze
script:
- build-wrapper/build-wrapper-linux-x86-64 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
- - sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" --define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"
+ - sonar-scanner/bin/sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}" -Dsonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"
cache:
policy: pull
key: "\${CI_COMMIT_SHORT_SHA}"
@@ -153,7 +153,7 @@ sonarqube-check:
paths:
- sonar-scanner/
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
+ script: sonar-scanner/bin/sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}"
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
@@ -384,7 +384,7 @@ sonarqube-check:
stage: sonarqube-check
script:
- - sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
+ - sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}"
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
index 74caf7638bb..e9f208a7161 100644
--- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
@@ -66,16 +66,16 @@ const BUILD_TOOL_SPECIFIC: {
[BuildTools.Cpp]: {
image: 'gcc',
script: (_, autoConfig?: AutoConfig) =>
- `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ` +
+ `sonar-scanner/bin/sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}" ` +
(autoConfig === AutoConfig.Manual
- ? `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`
+ ? `-Dsonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`
: ''),
},
[BuildTools.ObjectiveC]: {
image: 'gcc',
script: (_) =>
- `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ` +
- `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`,
+ `sonar-scanner/bin/sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}" ` +
+ `-Dsonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`,
},
[BuildTools.Dart]: {
image: 'ghcr.io/cirruslabs/flutter:stable',
@@ -88,7 +88,7 @@ const BUILD_TOOL_SPECIFIC: {
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]`,
script: () => `
- - sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"`,
+ - sonar-scanner -Dsonar.host.url="\${SONAR_HOST_URL}"`,
},
};