-
Notifications
You must be signed in to change notification settings - Fork 43
/
DevNotes.txt
46 lines (31 loc) · 2.47 KB
/
DevNotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Supported Roslyn version
------------------------
Currently the SDK is built against Microsoft.CodeAnalysis v2.8.2. It ships with a binding redirect file that forwards all of
the earlier versions to v2.8.2, so it should work against analyzers written with any earlier Roslyn version.
The SDK only needs the packages "Microsoft.CodeAnalysis.Analyzers" and "Microsoft.CodeAnalysis.Common". However, we reference
the full "Microsoft.CodeAnalysis" package as it will pull in other packages that might be needed by the third-party analyzers
e.g. the workspaces packages.
If the SDK fails to generate a plugin for a Roslyn analyzer:
1) check that the analyzer is built against v2.8.2 or earlier (e.g. by using ildasm to see which version is referenced), and
2) check that any other dependencies required by the analyzer are available.
The SDK will fetch any NuGet dependencies that are declared in the NuGet analyzer package. However, analyzer packages do
not normally reference the Roslyn packages they required, so they will not be fetched.
Updating the version of Roslyn used by the SDK
----------------------------------------------
1) Use the VS Package Manager to update the version of Microsoft.CodeAnalysis referenced by the following projects:
* RoslynPluginGenerator\SonarQube.Plugins.Roslyn.PluginGenerator.csproj
* Tests\IntegrationTests\IntegrationTests.csproj
* Tests\RoslynPluginGeneratorTests\SonarQube.Plugins.Roslyn.RoslynPluginGeneratorTests.csproj
2) update the app.config file to forward all calls to the new version
File: RoslynPluginGenerator\app.config.
Note: this is the app.config that is shipped with the SDK, and it is shared (linked) to the test
projects so it is the only app.config that needs to be updated.
Expected file layout inside the jar file
----------------------------------------
[root folder]
META-INF/MANIFEST.MF : manifest file containing general plugin property values used by SonarQube
: e.g. plugin name, version, unique key etc
org/sonar/plugins/roslynsdk/configuration.xml : metadata about the analyzer used by the Scanner for MSBuild
: e.g repository key and language
org/sonar/plugins/roslynsdk/rules.xml : XML file containing the new rules (loaded by RulesDefinition.class)
static/[analyzer id].[analyzer version].zip : the zip containing the third party analyzer will be added here