Correct usage of SQAnalysisFileItemTypes - sonarqube-msbuild-runner

I want to analyze a C++ project created with Qt. But all header files that have a QtMoc tag in the .vcxproj file are ignored.
For example:
<ItemGroup>
<QtMoc Include="SOMECLASS.h">
</QtMoc>
</ItemGroup>
I think its because this tool only recognize the following tags: Compile; Content; EmbeddedResource; None; ClCompile; ClInclude; Page; TypeScriptCompile
So I wanted to add another tag with the following command:
/d:"sonar.SQAnalysisFileItemTypes=$(SQAnalysisFileItemTypes);QtMoc"
OR
/d:"SQAnalysisFileItemTypes=$(SQAnalysisFileItemTypes);QtMoc"
Both are not working. Can someone give me a hint what the correct syntax must look like? Is it even possible to control this with the command?

This question was cross-posted and answered here.

Related

Xamarin forms: converted PCL to .net standard libraries and now I can't add new XAML pages

I recenty went through the process of converting all PCL's in my solution to .net standard libraries (not sure if its related nor not, just mentioning it in case).
Now, when I try and add a page, It adds the Xaml and the xaml.cs files into the project without any link or connection, so they wont compile:
Googling suggests I can go in and edit the .csproj to add a dependency between the two, but this is a horrible solution long term.
Any way to fix this "properly"?
I've tried dragging and dropping existing files in from windows explorer into VS2017, adding new through the add new dialog, adding existing through add existing and it all exhibits the same behaviour.
Thanks
OK, to answer my own question. Seems like you need to put in a workaround for the time being:
https://forums.xamarin.com/discussion/comment/288205/#Comment_288205
In the .csproj:
<ItemGroup>
<!-- https://bugzilla.xamarin.com/show_bug.cgi?id=55591 -->
<None Remove = "**\*.xaml" />
< Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<EmbeddedResource Include = "**\*.xaml" SubType="Designer" Generator="MSBuild:UpdateDesignTimeXaml" />
</ItemGroup>
And remove all existing XAML Pages referenced in the .csproj file such as EmbeddedResources and Compile directives

Removing Doxygen code fragments/references

I'm using Doxygen for generating documentation in my programming projects. And while I find it quite easy to configure and use I can't seem to find a way to hide the source references it adds to the HTML output.
I'm using these two directives in the configuration file:
SOURCE_BROWSER = NO
VERBATIM_HEADERS = NO
But it only seems to hide the "Definition at line of file ."
What I want removed is what's in the red rectangle below:
Is there a directive to also hide the source code it references? (Other than doing the hack'ish thing and remove it with CSS or jQuery)
Make sure your setting on INLINE_SOURCES is set to NO.
Description from the manual - it looks like you have this YES
Setting the INLINE_SOURCES tag to YES will include the body of functions, classes and enums directly into the documentation.

Is there a way to change the Doxygen term Modules in the tree and in the right pane pages to something else?

I am using Doxygen groups and therefore see them listed in the Doxygen navigation tree under Modules, as expected. My project is documenting integration using Zend modules and therefore Doxygen Modules and the Zend modules tend to overload the term modules and make it confusing for the readers. My question is: is there a way, preferably an automated way, to change the Doxygen term Modules in the tree and in the right pane pages to something else?
I've sucessfully changed the word 'Modules' in the past, but I've only ever needed to do this for the top-of-page tabs, and not the navigation tree. The method I used than may also work for you:
You need a fresh Layout file.
Generate one with doxygen -l layoutfilename.xml
Locate the line containing type="modules"
Change the title entry from "" to "Your Word" - I used "Index"
Specify the replacement layout file in you doxyfile.
After you did like the suggestion above.
If you want to manually replace it for PDF file that generates from latex you can open refman.tex go to %--- Begin generated contents --- and change to something like this:
(Note that I marked the lines you should edit with <========)
%--- Begin generated contents ---
\chapter{Main Page}
\label{index}\hypertarget{index}{}\input{index}
\chapter{Index Index} <========
\input{index} <========
\chapter{Index Documentation} <========
\input{whatever was here before}
%--- End generated contents ---
After that go to modules.tex and change the filename to index.tex (for this example).

Can't import/include external doxygen configuration file properly

I have a simple doxygen project consisting of Doxyfile and a configuration file, project.txt. In the project.txt file, I have some manually written documentation that uses cross-references to auto generated documentation from my code, and it all works fine.
I am trying to break down my project into subsections, like:
project.txt
disclaimer.txt
readme.txt
So, I've put Doxygen markup code into disclaimer.txt and readme.txt, and I updated the EXAMPLE_PATH in my Doxyfile to be:
EXAMPLE_PATH=./
Finally, in project.txt, I just added the lines:
\include disclaimer.txt
\include readme.txt
I expected disclaimer.txt and readme.txt to be imported into project.txt so they are treated as Doyxgen markup, but instead, they are interpreted as text, and are rendered as-is in a code block, as if wrapped by \code and \endcode tags, making the include operation useless.
Is there some way to include additional Doxygen configuration files and actually have them parsed?
Thank you.
Quoting the docs:
\include This command can be used to include a source file as a block of code.
Which seems to agree with the behaviour you see.
I am not sure if you can include pages into others as you want.
The best solution I can see is to use \subpage instead, which will both create a link to the other pages and make them subpages of the main page (this will show in the html related pages section as a dropdown hierarchy).
Usage inside project.txt would be:
\subpage disclaimer
\subpage readme
Supposing that disclaimer.txt contains a line like \page disclaimer Disclaimer
Also make sure that *.txt is in your FILE_PATTERNS.
I don't think you can include Doxygen config files at arbitrary points in your code like that. I know you could add it to you file list though, etc:
INPUT = ../PATH_TO_SOURCE_CODE_HEADER_1.h \
./project.txt \
./disclaimer.txt \
./readme.txt
Also, make sure each of your .txt files is wrapped with /** and */ if you're using C, for example.

MSBUILD Generate xml documentation file for all projects in solution (without touching the projects)

I'm trying to create the XML documentation for all the projects in the solution even when the option its not checked in the project properties (and this is the key point).
I'm using TFS 2010 SP1 and tried with this "/p:TreatWarningsAsErrors=true /p:GenerateDocumentation=true" in the "MSBuild Arguments" field of my build definition. It doesn't generate anything.
I also tried with /p:DocumentationFile=foo.xml, which it does work but I assuming the file gets overridden by the last compiled project, so I tried using a variable instead but with no luck, I tried with
/p:DocumentationFile=$(Project).xml,
/p:DocumentationFile=$(localProject).xml
/p:DocumentationFile=$(localBuildProjectItem).xml
Is there a way to create the XML documentation for all the projects from within MSBUILD even though the option is not checked in the project?
PS: And yes I already see another thread similar to this but I don't want to modify the projects, that's the whole point of doing it with MSBUILD.
Thanks for your time
I also wanted to achieve this and finally I came up with a solution following these steps:
Create a Directory.Build.props file in the solution root folder.
Set GenerateDocumentationFile property to true.
Set DocumentationFile property.
By default you would use $(OutputPath) and $(AssemblyName) properties to set the documentation file name, like this:
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
But unfortunately this does not work as Directory.Build.props file is processed first hence properties set in .csproj files are unavailable at this point.
Fortunately there is another property that gets the current project name: $(MSBuildProjectName)
The output path by default is the following:
for Web projects: bin\
for other projects: bin\$(Configuration)\, e.g. bin\Debug\
To decide whether a project is a web project or not I used the name of the project which ends either with .Web or .WebApi
So the complete Directory.Build.props file looks like this in my case:
<Project>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- The rest is omitted for clarity. -->
</PropertyGroup>
<PropertyGroup>
<!-- warning CS1591: Missing XML comment for publicly visible type or member -->
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Web')) Or $(MSBuildProjectName.EndsWith('.WebApi'))">
<DocumentationFile>bin\$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="!$(MSBuildProjectName.EndsWith('.Web')) And !$(MSBuildProjectName.EndsWith('.WebApi'))">
<DocumentationFile>bin\$(Configuration)\$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>
</Project>
As you can see there is also a <NoWarn>1591</NoWarn> property set which tells the compiler not to produce warning messages for publicly visible types where XML document is missing.
Hope it helps.
Open your process template (i.e.: $/yourproject/BuildProcessTemplates/DefaultTemplate.xaml)
Scroll down to find the Compile the Project activity.
Add a new variable named DocumentationFile, type=String, scope=Compile the Project
Set its default value to:
String.Format("{0}.XML", System.IO.Path.GetFileNameWithoutExtension(serverBuildProjectItem))
Save changes and scroll down to Run MSBuild for Project activity.
In CommandLineArguments, set the following value:
String.Format("/p:SkipInvalidConfigurations=true {0};DocumentationFile={1}", MSBuildArguments, DocumentationFile)
Check-in the changes and build. This should generate the documentation even if it was not set by the project.