Skip to content

Commit c7c6af9

Browse files
SCAN4NET-955 Remove the embedded scanner-cli.jar (#2875)
Co-authored-by: Tim Pohlmann <tim.pohlmann@sonarsource.com>
1 parent 6d3533a commit c7c6af9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

scripts/package-artifacts.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
Copy-Item -Path "$PSScriptRoot\..\LICENSE.txt" -Destination $DestinationLicenses
3131
Copy-Item -Path "$PSScriptRoot\..\Licenses\THIRD_PARTY_LICENSES\*" -Destination $DestinationThirdPartyLicenses
3232

33-
Expand-Archive -Path "$scannerCliDownloadDir\$scannerCliArtifact" -DestinationPath $Destination -Force
33+
if ($scannerCliEmbed) {
34+
Expand-Archive -Path "$scannerCliDownloadDir\$scannerCliArtifact" -DestinationPath $Destination -Force
35+
}
3436

3537
if ($SignAssemblies) {
3638
Sign-Assemblies -Pattern "$Destination\Sonar*" -TargetName ".NET Framework assemblies"
@@ -75,7 +77,9 @@ function Package-NetScanner {
7577
Copy-Item -Path "$PSScriptRoot\..\Licenses\THIRD_PARTY_LICENSES\Newtonsoft.Json-LICENSE.txt" -Destination $DestinationThirdPartyLicenses
7678
Copy-Item -Path "$PSScriptRoot\..\Licenses\THIRD_PARTY_LICENSES\SharpZipLib-LICENSE.txt" -Destination $DestinationThirdPartyLicenses
7779

78-
Expand-Archive -Path "$scannerCliDownloadDir\$scannerCliArtifact" -DestinationPath $Destination -Force
80+
if ($scannerCliEmbed) {
81+
Expand-Archive -Path "$scannerCliDownloadDir\$scannerCliArtifact" -DestinationPath $Destination -Force
82+
}
7983

8084
if ($SignAssemblies) {
8185
Sign-Assemblies -Pattern "$Destination\Sonar*" -TargetName ".NET assemblies"

scripts/variables.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$fullBuildOutputDir = "$PSScriptRoot\..\build"
2+
$scannerCliEmbed = $false
23
$scannerCliVersion = "5.0.2.4997"
34
$scannerCliAssemblyName = "sonar-scanner-cli-$ScannerCliVersion"
45
$scannerCliArtifact = "$scannerCliAssemblyName.zip"

templates/unix-qa-stage.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ stages:
4949
- powershell: $(Build.SourcesDirectory)/scripts/ci-self-signed-certificate.ps1
5050
displayName: "Create self-signed certificate"
5151
# On Linux/MacOS we need to update the execution permissions for the ScannerCLI
52-
- script: chmod -R +x $(Build.SourcesDirectory)/build/sonarscanner-net/sonar-scanner-*/bin
52+
- script: |
53+
chmod -R +x $(Build.SourcesDirectory)/build/sonarscanner-net/sonar-scanner-*/bin
54+
exit 0 # Always return 0; chmod fails when the scanner-cli is not present.
5355
name: scannerPermissions
5456
displayName: "Update Scanner permissions"
5557
matrix:

0 commit comments

Comments
 (0)