Commandline tool run projectsprout commands

Hello all,
I have intellij 11 and I was trying to set up the the commandline tool so that I can run some generator tools I've made but I can't figure it out.  All my tools are in /usr/bin so I create a new alias and point it there. Now, from what I've read on the webhelp pages I need to somehow register the commands from this folder I was to run in the definiation xml. But this is where I am stuck. I have no idea what format to add these commands in.

Any help would be great!

Thanks,
TJ     

8 comments
Comment actions Permalink

Hello,

as far as i understand, your xml file is already generated in .idea/commandlinetools/<framework name>.xml, with root framework element. It should contain command elements like:
<command>
    <name>hello</name>
    <help>My first task with no parameters.</help>
</command>

See more in tutorial, in Loading and Enabling a Custom Framework part.

Elena

0
Comment actions Permalink

Elena, that is exactly what I am looking for! But I'm still having and issue.
I've added my commands and autocomplete shows them to me. But when I run the command it just sits there and when I try to stop it it just does the same. I'm using 11 on mac.

Thanks,
TJ     

0
Comment actions Permalink

Could you show your configuration file?

0
Comment actions Permalink
<?xml version="1.0" encoding="UTF-8"?>
<framework xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemas/frameworkDescriptionVersion1.1.xsd" name="sprout" invoke="/usr/bin/" alias="sprout" enabled="true" version="1">
    <command>
        <name>rl-view</name>
        <params>classname</params>
    </command>    
</framework>
0
Comment actions Permalink

As far as i see, you want to invoke /usr/bin/rl-view with classname parameter calling sprout. Here is config:

<?xml version="1.0" encoding="UTF-8"?>
<framework xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="schemas/frameworkDescriptionVersion1.1.xsd" name="sprout"
           invoke="/usr/bin/rl-view" alias="sprout"
           enabled="true" version="1">
    <command>
        <name></name>
        <params>classname</params>
    </command>
</framework>
    

You need empty name to avoid extra space between /usr/bin and rl-view.
By the way, command line tool takes an xml description for each executable, so, having many executables, it is reasonable to use External tools (Settings | External tools). You can configure executable, constant parameters, and parameters depending on the file executable is applied to with macroses.

0
Comment actions Permalink

Hmm. It just seems to hang. But it external tools would be better I'll move in that direction. But I have a question there too, but it's not direcrly related to intellij. I try to execute my command and it complains that it can't

/usr/bin/rl-command
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:197:in `default_gemfile'
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:167:in `root'
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:126:in `load'
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
     from /Library/Ruby/Gems/1.8/gems/robotlegs-1.3.0.6.pre/bin/rl-command:6
     from /usr/bin/rl-command:19:in `load'
     from /usr/bin/rl-command:19

Process finished with exit code 1


I imagine this is actually what is happening with my command line tool, but its just not showing me the error >.< should I make a bash script that just calls this command in a place that it would work?     

Thanks,
TJ
0
Comment actions Permalink

It should show you that error. Maybe it gets different environment variables from IDE and from termnal?

0

Please sign in to leave a comment.