Non-Microsoft Platforms, Visual Lint and LintProject Professional
Monday 8th June, 2009
Integrating a plug-in product such as Visual Lint into a new development environment is a rather time consuming and difficult operation - even (unfortunately) when the new IDE is just a new version of one we already support (I'm looking at you, Visual Studio 2010!). Even worse, although the big players (notably Visual Studio and Eclipse) have quite comprehensive plug-in models many do not - which effectively makes it impractical for third party vendors to port their tools to those environments.
As a result we have been forced to conclude that in most cases it is not practical for us to develop a Visual Lint plug-in for such development environments. Fortunately, the converse is now (following some recent changes to the way it handles project files) true for LintProject Professional.
Please note that the remainder of this blog post describes functionality introduced in LintProject Professional 2.0.3.11; it is not present in earlier versions.
In fact, adding a new project file format to LintProject Professional is rather easy - in most cases, as we need to do is add a new project file reader implementation and enable it in the build configuration.
As a test, we have just done exactly that for project files for one of the development environments recently requested - namely Texas Instruments Code Composer Studio 3.x. For clarity, I'll refer to this IDE as CC3 for now.
CC3 project (.pjt) files are actually just simple INI files, so this was an ideal test case:
Code Composer Project File, Version 2.0 (do not modify or remove this line)
[Project Settings]
ProjectDir="c:\CCStudio_v3.3\myprojects\CC3Test\"
ProjectType=Executable
CPUFamily=TMS470R2X
Tool="Compiler"
Tool="CustomBuilder"
Tool="Linker"
Config="Debug"
Config="Debug2"
Config="Release"
[Source Files]
Source="Untitled2.c"
["Compiler" Settings: "Debug"]
Options=-g -@"options.txt" -fr"$(Proj_dir)\Debug" -i"projectincsearch" -d"_DEBUG" -d"_HELLO" -u"_UNDEFTHIS" -mv5e --abi=ti_arm9_abi
["Compiler" Settings: "Debug2"]
Options=-g -fr"$(Proj_dir)\Debug2" -d"_DEBUG" -mv5e --abi=ti_arm9_abi
["Compiler" Settings: "Release"]
Options=-o3 -fr"$(Proj_dir)\Release" -mv5e --abi=ti_arm9_abi
["Linker" Settings: "Debug"]
Options=-c -m".\Debug\CC3Test.map" -o".\Debug\CC3Test.out" -w -x
["Linker" Settings: "Debug2"]
Options=-c -m".\Debug2\CC3Test.map" -o".\Debug2\CC3Test.out" -w -x
["Linker" Settings: "Release"]
Options=-c -m".\Release\CC3Test.map" -o".\Release\CC3Test.out" -w -x
["Untitled2.c" Settings: "Debug"]
Options="Compiler" +{-i"cppCC3Testincsearch"}
Once we had written a suitable project file reader implementation, LintProject professional was able to generate the following project indirect file, which it then used to analyse the sample project:
// Generated by LintProject Professional 2.0.2.10a from file: C:\Data\Projects\Applications\LintProjectPro\Test Solutions\CCStudio\CC3Test\CC3Test.pjt
// -dConfiguration=TMS470R2X|Debug
//
-D_DEBUG;_HELLO; // PreprocessorDefinitions = "_DEBUG;_HELLO;"
// AdditionalIncludeDirectories = ""optionsfolder";"projectincsearch" ;"
-ioptionsfolder //
-iprojectincsearch //
Untitled2.c // RelativePath = "Untitled2.c"
Although I have no doubt that we will have to "tweak" the contents of the project.lnt file output as a result of user feedback, this is a pretty good starting point from what I can see.
Ironically, CC3 workspace (.wks) files are binary (they actually look like serialised MFC CArchive files) so they are far as tricky to parse as the project files are easy. hence, for the time being we are only adding support for CC3 project files, and not the workspace files themselves.
While we are in the LintProject Professional code we have also made a minor change to the help screen, which now lists the solution/workspace and project file types supported:

Incidentally, I should clarify that we are certainly not ruling out a Visual Lint plug-in for Eclipse (or any other mainstream IDE with a comprehensive plug-in model for that matter) - it is simply that the steps needed to get support into LintProject Professional are a necessary precursor for a full integration anyway, and this way we also can deliver something useful up front.
