Example external tool configurations
Here's a place to add external tool configuration items. This is what I happen to be using...
<tools>
<if host_os="win">
<item name="Tool.Notepad" wait="no">
<menu>&Notepad</menu>
<text>Notepad</text>
<tip>Open the selected item with Notepad</tip>
<key>Ctrl+L, Ctrl+I</key>
<message>Opening with Notepad</message>
<commands>
"C:/Windows/notepad.exe" "$(InputPath)"
</commands>
</item>
</if>
<!-- UltraEdit - http://www.ultraedit.com/ -->
<if host_os="win">
<item name="Tool.UltraEdit" wait="no">
<menu>&UltraEdit</menu>
<text>UltraEdit</text>
<tip>Open the selected item with UltraEdit</tip>
<key>Ctrl+L, Ctrl+U</key>
<message>UltraEditing</message>
<commands>
"$(ULTRAEDITDIR)/Uedit32" "$(InputPath)"
</commands>
</item>
</if>
<!-- Uncrustify - http://uncrustify.sourceforge.net/ -->
<item name="Tool.Uncrustify" wait="yes">
<menu>Uncrustif&y</menu>
<text>Uncrustify</text>
<tip>Format the selected item with Uncrustify</tip>
<key>Ctrl+L, Ctrl+Y</key>
<message>Uncustifying</message>
<commands>
"$(UNCRUSTIFYDIR)/uncrustify" -c "$(UNCRUSTIFYDIR)/gnu-indent.cfg" --replace "$(InputPath)"
</commands>
</item>
<!-- Araxis Merge - http://www.araxis.com/ -->
<if host_os="win">
<item name="Araxis.Compare" wait="yes">
<menu>Ara&xis Compare</menu>
<text>Araxis Compare</text>
<tip>Open the selected item in Araxis Compare</tip>
<key>Ctrl+L, Ctrl+V</key>
<message>Comparing</message>
<commands>
"$(ARAXISMERGEDIR)/Compare" "$(InputPath)"
</commands>
</item>
</if>
</tools>
-
Hi, I am brand new to CrossWorks and am looking to add PC-Lint. To start with I wanted to get familiar with External Tools, so I entered this subset of the above example into my tools.xml file:
<tools>
<item name="Tool.Notepad" wait="no">
<menu>&Notepad</menu>
<text>Notepad</text>
<tip>Open the selected item with Notepad</tip>
<key>Ctrl+L, Ctrl+I</key>
<message>Opening with Notepad</message>
<commands>
"C:/Windows/notepad.exe" "$(InputPath)"
</commands>
</item>
</tools>I closed, then restarted CrossWorks but I cannot find Notepad on any menu! The CTRL-L+CTRL-I shortcut works so it appears the tools.xml file is being read, but what am I missing to see the entry on a menu? And I assume it will go on the Tools menu? This is the Crossworks 2.3 ARM download under the 30-day eval. Thanks!
-
Thanks for the quick reply! OK, so now using information in the Crossworks Help listing, I added this entry:
<item name="Tool.cpplint">
<menu>&C++lint (Unit Check)</menu>
<text>C++lint</text>
<tip>The best in static analysis!</tip>
<key>Ctrl+L, Ctrl+L</key>
<message>Analyzing...</message>
<match>*.c;*.cpp</match>
<commands>
"$(LINTDIR)lint-nt" "$(LINTDIR)/lnt/co-gcc.lnt"
$(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros -w2 -e537 +fie +ffn "-width(0,4)" -hF1
"-format=%f:%l:%C:s%t:s%m" "$(InputPath)"
</commands>
</item>When I run this, I don't get any analysis output. In the output window with "Output" selected in the dropdown, there is this text:
Analyzing...
Analyzing... benchmark.c
Command line: $(LINTDIR)lint-nt $(LINTDIR)/lnt/co-gcc.lnt
-D__THUMB -D__RAM_BUILD -DDEBUG -I. -D__GNUC__ -u -b +macros -w2 -e537 +fie +ffn -width(0,4) -hF1
-format=%f:%l:%C:s%t:s%m C:/temp/cfiles/benchmark.c
Finished Analyzing...Note that there are no quotes despite the HTML codes in tools.cfg. Is that significant?
For completeness, by switching to Tasks in the dropdown, there are 2 entries:
Analyzing...
Completed
Finished Analyzing...
Completed
Any hints? Thanks!
-
It was the missing backslash _and_ the fact I misread the help listing, which had the command spread over three lines; I assumed carriage returns were not significant in the XML, but it seems they are. When I deleted the carriage returns and had just one long command I started getting output! Two minor, final questions:
1. I can use the Forward/Back buttons to navigate to an error, but I can't double-click on the error message text in the output window to jump to the corresponding line, nor does the output window scroll automatically to keep the error output line in sync with the error I've navigated to with either the Forward or Back buttons. Am I missing something here?
2. Is there a way to have the IDE re-read tools.xml without exiting/reopening? Thanks!
-
When I run the Lint-NT external tool as per above, I get the following error message:
C:\Program Files\Rowley Associates Limited\CrossWorks for ARM 2.3\include\stdint.h:66:2:sError:s#error unknown target
This appears to be because there's no -D__TARGET_PROCESSOR= macro generated, even though Target="MK10DN512xxx10" appears in my .hzp file.
Shouldn't this be generated by the IDE and sent via $(DEFINES)?
-
Hi,
I'm trying to get an external tool working on OSX. I would like to be able to use BBEdit as my code editor. Ideally, I'd like it to open source files in BBEdit automatically when I double-click them in the Project Explorer. If that's not possible, then any other method of launching/loading files in BBEdit from within CrossStudio for ARM. Below is the config code I'm using. It has no discernible effect on anything in CrossStudio e.g. doesn't appear to be added to any menu, sub-menu, context menu or toolbar, nor invoked using the keystroke I've defined. Anyone?
Thanks,
Eric
<tools>
<item name="Tool.BBEdit" wait="no">
<menu>&BBEdit</menu>
<text>BBEdit</text>
<tip>BBEdit</tip>
<key>Ctrl+Shift+E</key>
<message>Opening with BBEdit</message>
<commands>
open -a "BBEdit" "$(InputPath)"
</<commands>
</item>
</tools> -
Your "command" section doesn't look right. I use this for gvim. Works great.
<tools>
<if host_os="win">
<item name="Tool.gvim" wait="no">
<menu>&gvim</menu>
<text>gvim</text>
<tip>Open the selected item with gvim</tip>
<key>Ctrl+L, Ctrl+G</key>
<message>launching gvim</message>
<commands>
"$(VIM)/gvim.exe" "$(InputPath)"
</commands>
</item>
</if></tools>
Please sign in to leave a comment.
Comments
14 comments