diff --git a/.github/workflows/build-vsix.yml b/.github/workflows/build-vsix.yml index 83aa09f..20c33b5 100644 --- a/.github/workflows/build-vsix.yml +++ b/.github/workflows/build-vsix.yml @@ -48,32 +48,11 @@ jobs: - name: Build VSIX Project run: msbuild JFrogVSExtension.sln /p:Configuration=Release /p:Platform="Any CPU" /p:BuildInParallel=true /m - # Verify that the PDB file is not included in the .vsix file + # Verify that the PDB file is not included in the .vsix file, this will expose unwanted debug information about the development env - name: Check for PDB in VSIX run: | - $vsixPath = "JFrogVSExtension/bin/Release/JfrogVSExtension.vsix" - $pdbExists = $false - - # Check if the .vsix file contains the PDB file - if (Test-Path $vsixPath) { - $zipContent = [System.IO.Compression.ZipFile]::OpenRead($vsixPath) - foreach ($entry in $zipContent.Entries) { - if ($entry.FullName -like "*JfrogVSExtension.pdb") { - $pdbExists = $true - break - } - } - $zipContent.Dispose() - } else { - Write-Host "VSIX file does not exist." - } - - if ($pdbExists) { - Write-Host "PDB file exists in VSIX. Please check your project settings." - exit 1 # Fail the workflow if the PDB file is found - } else { - Write-Host "PDB file not found in VSIX. Build is clean." - } + .\scripts\ValidatePDBFilesAbsenceInReleaseMode.ps1 + shell: pwsh # Upload vsix and unit test as artifacts for other workflows usage - name: Upload vsix artifacts diff --git a/JFrogVSExtension.sln b/JFrogVSExtension.sln index 0828981..8ccce8f 100644 --- a/JFrogVSExtension.sln +++ b/JFrogVSExtension.sln @@ -15,16 +15,16 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|Any CPU.Build.0 = Release|Any CPU + {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|Any CPU.Build.0 = Debug|Any CPU {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|x86.ActiveCfg = Debug|x86 {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Debug|x86.Build.0 = Debug|x86 {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Release|Any CPU.ActiveCfg = Release|Any CPU {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Release|Any CPU.Build.0 = Release|Any CPU {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Release|x86.ActiveCfg = Release|x86 {6443B797-2478-4A1D-BECA-28E24C1F1F41}.Release|x86.Build.0 = Release|x86 - {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|Any CPU.Build.0 = Release|Any CPU + {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|Any CPU.Build.0 = Debug|Any CPU {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|x86.ActiveCfg = Debug|Any CPU {DB770B26-1629-45D0-8526-8902F83731B2}.Debug|x86.Build.0 = Debug|Any CPU {DB770B26-1629-45D0-8526-8902F83731B2}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/JFrogVSExtension/JFrogVSExtension.csproj b/JFrogVSExtension/JFrogVSExtension.csproj index ba47e41..6c669c7 100644 --- a/JFrogVSExtension/JFrogVSExtension.csproj +++ b/JFrogVSExtension/JFrogVSExtension.csproj @@ -59,7 +59,9 @@ prompt 2 - true + false + false + false diff --git a/UnitTestJfrogVSExtension/UnitTestJfrogVSExtension.csproj b/UnitTestJfrogVSExtension/UnitTestJfrogVSExtension.csproj index 45e6894..8a1049b 100644 --- a/UnitTestJfrogVSExtension/UnitTestJfrogVSExtension.csproj +++ b/UnitTestJfrogVSExtension/UnitTestJfrogVSExtension.csproj @@ -33,7 +33,8 @@ pdbonly true bin\Release\ - TRACE + + prompt 4 diff --git a/scripts/ValidatePDBFilesAbsenceInReleaseMode.ps1 b/scripts/ValidatePDBFilesAbsenceInReleaseMode.ps1 new file mode 100644 index 0000000..32940c3 --- /dev/null +++ b/scripts/ValidatePDBFilesAbsenceInReleaseMode.ps1 @@ -0,0 +1,27 @@ +# Define the path to the VSIX file - after building the project in Release mode +$vsixPath = "JfrogVSExtension\bin\Release\JfrogVSExtension.vsix" +$pdbExists = $false +$fileName = "" + +# Check if the .vsix file contains the PDB file +if (Test-Path $vsixPath) { + $zipContent = [System.IO.Compression.ZipFile]::OpenRead($vsixPath) + foreach ($entry in $zipContent.Entries) { + if ($entry.FullName -like "*JfrogVSExtension.pdb") { + $pdbExists = $true + $fileName = $entry.FullName + break + } + } + $zipContent.Dispose() +} else { + Write-Error "VSIX file does not exist in the following path: $vsixPath." + exit 1 # Fail the workflow if the .vsix file is not found +} + +if ($pdbExists) { + Write-Error "PDB file exists in VSIX. file name = $fileName Please check your project settings." + exit 1 # Fail the workflow if the PDB file is found +} else { + Write-Host "PDB file not found in VSIX. Build is clean." +} \ No newline at end of file