Thought I’d offer this tip for Java users.
As you know Java doesn’t support conditional defines, so I use comments:
Note that the “[IFDEF:SMARTINSPECT]” is meaningless and you can use any string here, this just helps make it self explanatory.
And in an Ant build target I use a section like this:
<filterset begintoken="//[IFDEF:" endtoken="]">
<filter token="SMARTINSPECT" value=""/>
This copies all the source to a separate directory while stripping “//[IFDEF:SMARTINSPECT]” and leaving the remainder of the line. Then that directory gets compiled into a debug version of the application.
Doing it this way means we don’t have to ship SmartInspect.jar with the normal version of our app.
Hope this may help someone!