sonarqube-roslyn-sdk
sonarqube-roslyn-sdk copied to clipboard
Zip file in jar file not compatible with non-Windows OS
When I create a plugin for custom C# analyzers, the static folder within the jar file contains a zip file with all dlls.
However the zip file is not OS independent and contains backslashes. This causes problem, when the plugin is downloaded on build agents running e.g. on Linux.
It can be easily solved by enhancing one line in https://github.com/SonarSource/sonarqube-roslyn-sdk/blob/master/RoslynPluginGenerator/ZipExtensions.cs
Old
archive.CreateEntryFromFile(file, file.Substring(pathPrefixLength).Replace('\\', '/'), CompressionLevel.Optimal);
Fix proposal
archive.CreateEntryFromFile(file.Replace('\\', '/'), file.Substring(pathPrefixLength).Replace('\\', '/'), CompressionLevel.Optimal);