integrated-application-development / sonar-delphi

Delphi language plugin for SonarQube
GNU Lesser General Public License v3.0
92 stars 13 forks source link

Add support for the library path #254

Closed zedxxx closed 2 months ago

zedxxx commented 3 months ago

The analyzer currently reads only the project search path and ignores the library path.

See #250

Cirras commented 3 months ago

Note - adding support for reading the library path would require us to read Delphi install data from the registry.

For a list of relevant registry keys, see: https://delphidabbler.com/articles/article-27

zedxxx commented 3 months ago

Yes, you need to read:

where 23.0 is for Delphi 12.1 and should be replaced with the corresponding value of the Delphi version.

Cirras commented 3 months ago

Note - adding support for reading the library path would require us to read Delphi install data from the registry.

For a list of relevant registry keys, see: https://delphidabbler.com/articles/article-27

Actually, this is going to be way easier than I initially thought. We shouldn't need to read the registry at all.

CodeGear.Common.Targets reads the (generated) EnvOptions.proj file in AppData, which contains DelphiLibraryPath. Looks like the IDE keeps that file in sync with the registry, much like environment.proj which contains all of the registry environment variables.

Thanks to our existing support for the MSBuild project files, we've basically done the work already. That's great.