Example external tool configurations

Comments

14 comments

  • Avatar
    Richard Webb

    Thanks for the hint. Now I can launch vim and use the One True Editor on my code!

    0
    Comment actions Permalink
  • Avatar
    Chris

    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>&amp;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>
          &quot;C:/Windows/notepad.exe&quot; &quot;$(InputPath)&quot;
        </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!

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    External tools are presented in the Open With menu on the right-click of a project node.

    0
    Comment actions Permalink
  • Avatar
    Chris

    Thanks for the quick reply!  OK, so now using information in the Crossworks Help listing, I added this entry:

      <item name="Tool.cpplint">
        <menu>&amp;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>
          &quot;$(LINTDIR)lint-nt&quot; &quot;$(LINTDIR)/lnt/co-gcc.lnt&quot;
          $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros -w2 -e537 +fie +ffn &quot;-width(0,4)&quot; -hF1
          &quot;-format=%f:%l:%C:s%t:s%m&quot; &quot;$(InputPath)&quot;
        </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!

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    So, did you set the LINTDIR macro? Project > Macros?

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    ..also notice this:

    $(LINTDIR)lint-nt $(LINTDIR)/lnt/co-gcc.lnt

    Surely a slash is mssing?

    0
    Comment actions Permalink
  • Avatar
    Chris

    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!

    0
    Comment actions Permalink
  • Avatar
    Chris

    Refinement: I just found the errors on the "Tasks" dropdown and that's where I can navigate, correct?

    0
    Comment actions Permalink
  • Avatar
    Chris

    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)?

    0
    Comment actions Permalink
  • Avatar
    Eric Singer

    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>&amp;BBEdit</menu>
        <text>BBEdit</text>
        <tip>BBEdit</tip>
        <key>Ctrl+Shift+E</key>
        <message>Opening with BBEdit</message>
        <commands>
          open -a &quot;BBEdit&quot; &quot;$(InputPath)&quot;
        </<commands>
      </item>
    </tools>

    0
    Comment actions Permalink
  • Avatar
    Richard Webb

    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>&amp;gvim</menu>
    <text>gvim</text>
    <tip>Open the selected item with gvim</tip>
    <key>Ctrl+L, Ctrl+G</key>
    <message>launching gvim</message>
    <commands>
    &quot;$(VIM)/gvim.exe&quot; &quot;$(InputPath)&quot;
    </commands>
    </item>
    </if>

    </tools>

     

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Eric Singer

    Even if the command section was wrong, I'd expect some sign of the tool showing up in CrossWorks (then failing on execution). But, nothing.

    0
    Comment actions Permalink
  • Avatar
    Paul Curtis

    The tool output will show up in the Output Window in a new log.

    0
    Comment actions Permalink
  • Avatar
    Eric Singer

    How do I invoke the tool? I see no evidence of it within CrossWorks.

    0
    Comment actions Permalink

Please sign in to leave a comment.