Skip to content

Commit

Permalink
Target netstandard2.0 instead of net46 (#7028)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource authored Apr 25, 2023
1 parent 35ab0c9 commit 6a345b9
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 1,445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
</frameworkAssemblies>
</metadata>
<files>
<file src="bin\Release\net46\SonarAnalyzer.CFG.dll" target="lib\net46" />
<file src="bin\Release\netstandard2.0\SonarAnalyzer.CFG.dll" target="lib\netstandard2.0" />
</files>
</package>
3 changes: 1 addition & 2 deletions analyzers/src/SonarAnalyzer.CFG/SonarAnalyzer.CFG.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>SonarAnalyzer.CFG</AssemblyName>
<RootNamespace>SonarAnalyzer</RootNamespace>
<!-- CFG needs netstandard2.0 for NuGet package -->
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(MSBuildProjectDirectory)\Lightup\.generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
Expand Down
327 changes: 0 additions & 327 deletions analyzers/src/SonarAnalyzer.CFG/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,333 +1,6 @@
{
"version": 1,
"dependencies": {
".NETFramework,Version=v4.6": {
"Microsoft.CodeAnalysis.CSharp.Workspaces": {
"type": "Direct",
"requested": "[1.3.2, )",
"resolved": "1.3.2",
"contentHash": "MwGmrrPx3okEJuCogSn4TM3yTtJUDdmTt8RXpnjVo0dPund0YSAq4bHQQ9bxgArbrrapcopJmkb7UOLAvanXkg==",
"dependencies": {
"Microsoft.CodeAnalysis.CSharp": "[1.3.2]",
"Microsoft.CodeAnalysis.Workspaces.Common": "[1.3.2]"
}
},
"Microsoft.Composition": {
"type": "Direct",
"requested": "[1.0.27, )",
"resolved": "1.0.27",
"contentHash": "pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"System.Collections.Immutable": {
"type": "Direct",
"requested": "[1.1.37, )",
"resolved": "1.1.37",
"contentHash": "fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==",
"dependencies": {
"System.Collections": "4.0.0",
"System.Diagnostics.Debug": "4.0.0",
"System.Globalization": "4.0.0",
"System.Linq": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.0",
"System.Runtime.Extensions": "4.0.0",
"System.Threading": "4.0.0"
}
},
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg=="
},
"Microsoft.CodeAnalysis.Common": {
"type": "Transitive",
"resolved": "1.3.2",
"contentHash": "lOinFNbjpCvkeYQHutjKi+CfsjoKu88wAFT6hAumSR/XJSJmmVGvmnbzCWW8kUJnDVrw1RrcqS8BzgPMj263og==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "1.1.0",
"System.AppContext": "4.1.0",
"System.Collections": "4.0.11",
"System.Collections.Concurrent": "4.0.12",
"System.Collections.Immutable": "1.2.0",
"System.Console": "4.0.0",
"System.Diagnostics.Debug": "4.0.11",
"System.Diagnostics.FileVersionInfo": "4.0.0",
"System.Diagnostics.StackTrace": "4.0.1",
"System.Diagnostics.Tools": "4.0.1",
"System.Dynamic.Runtime": "4.0.11",
"System.Globalization": "4.0.11",
"System.IO.FileSystem": "4.0.1",
"System.IO.FileSystem.Primitives": "4.0.1",
"System.Linq": "4.1.0",
"System.Linq.Expressions": "4.1.0",
"System.Reflection": "4.1.0",
"System.Reflection.Metadata": "1.3.0",
"System.Reflection.Primitives": "4.0.1",
"System.Resources.ResourceManager": "4.0.1",
"System.Runtime": "4.1.0",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.Handles": "4.0.1",
"System.Runtime.InteropServices": "4.1.0",
"System.Runtime.Numerics": "4.0.1",
"System.Security.Cryptography.Algorithms": "4.2.0",
"System.Security.Cryptography.Encoding": "4.0.0",
"System.Security.Cryptography.X509Certificates": "4.1.0",
"System.Text.Encoding": "4.0.11",
"System.Text.Encoding.CodePages": "4.0.1",
"System.Text.Encoding.Extensions": "4.0.11",
"System.Threading": "4.0.11",
"System.Threading.Tasks": "4.0.11",
"System.Threading.Tasks.Parallel": "4.0.1",
"System.Threading.Thread": "4.0.0",
"System.Xml.ReaderWriter": "4.0.11",
"System.Xml.XDocument": "4.0.11",
"System.Xml.XPath.XDocument": "4.0.1",
"System.Xml.XmlDocument": "4.0.1"
}
},
"Microsoft.CodeAnalysis.CSharp": {
"type": "Transitive",
"resolved": "1.3.2",
"contentHash": "GrYMp6ScZDOMR0fNn/Ce6SegNVFw1G/QRT/8FiKv7lAP+V6lEZx9e42n0FvFUgjjcKgcEJOI4muU6i+3LSvOBA==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[1.3.2]"
}
},
"Microsoft.CodeAnalysis.Workspaces.Common": {
"type": "Transitive",
"resolved": "1.3.2",
"contentHash": "kvdo+rkImlx5MuBgkayl4OV3Mg8/qirUdYgCIfQ9EqN15QasJFlQXmDAtCGqpkK9sYLLO/VK+y+4mvKjfh/FOA==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[1.3.2]",
"Microsoft.Composition": "1.0.27"
}
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.AppContext": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow=="
},
"System.Collections": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg=="
},
"System.Collections.Concurrent": {
"type": "Transitive",
"resolved": "4.0.12",
"contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ=="
},
"System.Console": {
"type": "Transitive",
"resolved": "4.0.0",
"contentHash": "qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A=="
},
"System.Diagnostics.Debug": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw=="
},
"System.Diagnostics.FileVersionInfo": {
"type": "Transitive",
"resolved": "4.0.0",
"contentHash": "qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg=="
},
"System.Diagnostics.StackTrace": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "6i2EbRq0lgGfiZ+FDf0gVaw9qeEU+7IS2+wbZJmFVpvVzVOgZEt0ScZtyenuBvs6iDYbGiF51bMAa0oDP/tujQ=="
},
"System.Diagnostics.Tools": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g=="
},
"System.Dynamic.Runtime": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "db34f6LHYM0U0JpE+sOmjar27BnqTVkbLJhgfwMpTdgTigG/Hna3m2MYVwnFzGGKnEJk2UXFuoVTr8WUbU91/A=="
},
"System.Globalization": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg=="
},
"System.IO.FileSystem": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==",
"dependencies": {
"System.IO.FileSystem.Primitives": "4.0.1"
}
},
"System.IO.FileSystem.Primitives": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ=="
},
"System.Linq": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g=="
},
"System.Linq.Expressions": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw=="
},
"System.Reflection": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng=="
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "1.3.0",
"contentHash": "jMSCxA4LSyKBGRDm/WtfkO03FkcgRzHxwvQRib1bm2GZ8ifKM1MX1al6breGCEQK280mdl9uQS7JNPXRYk90jw==",
"dependencies": {
"System.Collections.Immutable": "1.2.0"
}
},
"System.Reflection.Primitives": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ=="
},
"System.Resources.ResourceManager": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA=="
},
"System.Runtime": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g=="
},
"System.Runtime.Extensions": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ=="
},
"System.Runtime.Handles": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g=="
},
"System.Runtime.InteropServices": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ=="
},
"System.Runtime.Numerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg=="
},
"System.Security.Cryptography.Algorithms": {
"type": "Transitive",
"resolved": "4.2.0",
"contentHash": "8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==",
"dependencies": {
"System.Security.Cryptography.Primitives": "4.0.0"
}
},
"System.Security.Cryptography.Encoding": {
"type": "Transitive",
"resolved": "4.0.0",
"contentHash": "FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ=="
},
"System.Security.Cryptography.Primitives": {
"type": "Transitive",
"resolved": "4.0.0",
"contentHash": "Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA=="
},
"System.Security.Cryptography.X509Certificates": {
"type": "Transitive",
"resolved": "4.1.0",
"contentHash": "4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==",
"dependencies": {
"System.Security.Cryptography.Algorithms": "4.2.0",
"System.Security.Cryptography.Encoding": "4.0.0"
}
},
"System.Text.Encoding": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "h4z6rrA/hxWf4655D18IIZ0eaLRa3tQC/j+e26W+VinIHY0l07iEXaAvO0YSYq3MvCjMYy8Zs5AdC1sxNQOB7Q=="
},
"System.Text.Encoding.Extensions": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ=="
},
"System.Threading": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ=="
},
"System.Threading.Tasks": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ=="
},
"System.Threading.Tasks.Parallel": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "7Pc9t25bcynT9FpMvkUw4ZjYwUiGup/5cJFW72/5MgCG+np2cfVUMdh29u8d7onxX7d8PS3J+wL73zQRqkdrSA=="
},
"System.Threading.Thread": {
"type": "Transitive",
"resolved": "4.0.0",
"contentHash": "gIdJqDXlOr5W9zeqFErLw3dsOsiShSCYtF9SEHitACycmvNvY8odf9kiKvp6V7aibc8C4HzzNBkWXjyfn7plbQ=="
},
"System.Xml.ReaderWriter": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg=="
},
"System.Xml.XDocument": {
"type": "Transitive",
"resolved": "4.0.11",
"contentHash": "Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg=="
},
"System.Xml.XmlDocument": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ=="
},
"System.Xml.XPath": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA=="
},
"System.Xml.XPath.XDocument": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==",
"dependencies": {
"System.Xml.XPath": "4.0.1"
}
}
},
".NETStandard,Version=v2.0": {
"Microsoft.CodeAnalysis.CSharp.Workspaces": {
"type": "Direct",
Expand Down
20 changes: 10 additions & 10 deletions analyzers/src/SonarAnalyzer.CSharp/SonarAnalyzer.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<AssemblyName>SonarAnalyzer.CSharp</AssemblyName>
<RootNamespace>SonarAnalyzer</RootNamespace>
<!-- See SonarAnalyzer.Common.csproj for more details-->
<TargetFrameworks Condition="$(BuildOnlyNet46) != 'true'">net46;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(BuildOnlyNet46) == 'true'">net46</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<!-- .NET Standard target does not copy referenced DLLs into bin folder, so we need to enable it explicitly. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<DefineConstants>TRACE;CS</DefineConstants>
</PropertyGroup>

<!-- Warning: when adding a package reference, we must make sure this package is available on oldest supported .NET version (currently net46) or packaged with the analyzer.
<!-- Warning: when adding a package reference, we must make sure this package is available on oldest supported .NET version (currently netstandard2.0) or packaged with the analyzer.
For instance, System.ValueTuple is not available in 4.6.1 and must be added to the final packaging if we add it here -->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="1.3.2" />
Expand Down Expand Up @@ -54,17 +54,17 @@
</Content>
</ItemGroup>

<Target Name="SignDlls" Condition="'$(SignAssembly)' == 'true' And '$(TargetFramework)' == 'NET46' ">
<Target Name="SignDlls" Condition="'$(SignAssembly)' == 'true'">
<Message Importance="high" Text="Signing analyzer assemblies from $(OutputPath)" />
<Exec WorkingDirectory="$(OutputPath)" Command="&quot;$(SIGNTOOL_PATH)&quot; sign /fd SHA256 /f $(PFX_PATH) /p $(PFX_PASSWORD) /du https://www.sonarsource.com/ /d &quot;Roslyn analyzers that spot Bugs, Vulnerabilities and Code Smells in your code.&quot; /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp SonarAnalyzer*.dll" />
</Target>

<Target Name="CopyBinaries" AfterTargets="Build" DependsOnTargets="SignDlls" Condition=" '$(TargetFramework)' == 'NET46' ">
<Target Name="CopyBinaries" AfterTargets="Build" DependsOnTargets="SignDlls">
<ItemGroup>
<BinariesToCopy Include="$(OutputPath)\Google.Protobuf.dll" />
<BinariesToCopy Include="$(OutputPath)\SonarAnalyzer.dll" />
<BinariesToCopy Include="$(OutputPath)\SonarAnalyzer.CFG.dll" />
<BinariesToCopy Include="$(OutputPath)\SonarAnalyzer.CSharp.dll" />
<BinariesToCopy Include="$(OutputPath)Google.Protobuf.dll" />
<BinariesToCopy Include="$(OutputPath)SonarAnalyzer.dll" />
<BinariesToCopy Include="$(OutputPath)SonarAnalyzer.CFG.dll" />
<BinariesToCopy Include="$(OutputPath)SonarAnalyzer.CSharp.dll" />
</ItemGroup>
<Copy SourceFiles="@(BinariesToCopy)" DestinationFolder="$(BinariesFolder)" />
</Target>
Expand Down
Loading

0 comments on commit 6a345b9

Please sign in to comment.