tags:

views:

149

answers:

3

On linux something like:

  <target name="runDo">
     <exec executable="gnome-terminal" spawn="true">
      <arg line="-t 'Title' --geometry=120x80 -e '/script/path/bin/do.sh'"/>
    </exec>
  </target>

Works fine.

I've tried installing xterm, gnome-terminal and rxvt via macports and running them similarly with no results as well as /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -e, but none seem to work. I've also tried running the script as the attribute value of executable, hoping the OS would pick an appropriate applications to launch, but no joy.

I can get it to run without spawning a new terminal, but I'm running the ant task from an IDE and would like to be able to keep it alive if I quit the IDE, or close the project to open another. Help?

+1  A: 

You should just be able to run it against /bin/sh and have it appear inline with the ant output.

Tim
True enough, but I'm running the ant target from an IDE and would like it to spawn a new terminal, so the IDE can be quit or the project can be closed without killing the script. In this case, its launching Tomcat. I apologize for lacking that information in the original question. I'll add it now. Thank you for your response.
Felix
+2  A: 

Try open -a Terminal /script/path/bin/do.sh.

trashgod
+1  A: 

Just went with xterm...

<target name="startTomcat_DebugLinux" if="isLinux">
  <exec executable="gnome-terminal" spawn="true">
    <arg line="--window-with-profile=Tomcat --geometry=120x60 -e '${env.CATALINA_HOME}/bin/catalina.sh jpda run'" />
  </exec>
</target>

<target name="startTomcat_DebugMac" if="isMac">
  <exec executable="/usr/X11R6/bin/xterm" spawn="true">
    <arg  line="-geometry 180x65 -e ${env.CATALINA_HOME}/bin/catalina.sh jpda run" />
  </exec>
</target>

The problem before, that open -a couldn't help with was that I couldn't get the arguments jpda and run passed to the script. open takes a --args, but the args seem to be passed to terminal rather than the script. Other solutions are welcome, but this is working for me now.

Felix
+1 Interesting alternative; more here: http://developer.apple.com/opensource/tools/runningx11.html
trashgod