Skip to content

Commit

Permalink
Use env var for MSVC path
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaskos-sonar committed Jan 9, 2025
1 parent bc8bbfd commit 2589d6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .cirrus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ env:
CIRRUS_SHELL: bash
USERPROFILE: C:\sonar-ci # Fixes error MSB3073 and path too long issue with restored packages
TMP_DIR: C:\sonar-ci\temp
MSVC: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe

ec2_instance_definition: &INSTANCE_DEFINITION
region: eu-central-1
type: c6i.xlarge
image: sonarlint-visualstudio-v*
image: pr-39-sonarlint-visualstudio-v20250107121045
platform: windows

calculate_version_script_definition: &CALCULATE_VERSION_SCRIPT_DEFINITION |
Expand Down
3 changes: 2 additions & 1 deletion src/SLCore.IntegrationTests/SimpleAnalysisTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public Task DefaultRuleConfig_ContentFromRpc_TypeScriptAnalysisProducesExpectedI
[TestMethod]
public Task DefaultRuleConfig_ContentFromDisk_CFamilyAnalysisProducesExpectedIssues()
{
var compilerPath = @"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.42.34433\\bin\\Hostx64\\x64\\cl.exe";

var compilerPath = Environment.GetEnvironmentVariable("MSVC").Replace(@"\", @"\\");
var cFamilyIssuesFileAbsolutePath = FileAnalysisTestsRunner.CFamilyIssues.GetFullPath().Replace(@"\", @"\\");
var analysisDirectory = cFamilyIssuesFileAbsolutePath.Substring(0, cFamilyIssuesFileAbsolutePath.LastIndexOf('\\') + 1);
var jsonContent = $$"""
Expand Down

0 comments on commit 2589d6a

Please sign in to comment.