Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Running ANT tasks from bash console
icon5.gif  Running ANT tasks from bash console [message #1061141] Thu, 30 May 2013 04:19 Go to next message
Piotr Rygielski is currently offline Piotr Rygielski
Messages: 6
Registered: May 2013
Junior Member
Hello,
I have coded a bunch of EOL, ETL and EGL scripts and I can run them one by one using custom ant script launch.xml. It works perfectly in Eclipse, but I need to run it multiple times (~300) with some variable parameters passed from bash console or external program.

The question is how to run the ant script from bash console?

When I type in bash:
ant -buildfile launch.xml 

I get:
loadModels:

BUILD FAILED
/path/netmodel/trunk/EOL-ETL-EGL-whole-chain/launch.xml:19: Problem: failed to create task or type epsilon.emf.register
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Unfortunately, I was unable to capture the commands that Eclipse executes when clicking on the build button. Epsilon Book says nothing about this case.
I include my launch.xml, although it contains only standard Epsilon entries.
  • Attachment: launch.xml
    (Size: 3.16KB, Downloaded 56 times)
Re: Running ANT tasks from bash console [message #1061212 is a reply to message #1061141] Thu, 30 May 2013 10:38 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 304
Registered: January 2010
Senior Member
Hi Piotr,

You cannot run Ant tasks intended for Eclipse from a vanilla Ant installation. You need to run an Eclipse headless build, using the antRunner entry point. I haven't needed to do this yet, but I think these articles should be useful:

http://blog.ankursharma.org/2010/06/headless-build-for-beginners-part-i.html
http://blog.ankursharma.org/2010/06/headless-build-for-beginners-part-ii.html

If you get it working, we'd love to hear about it, so we can set up a proper example and/or fix any annoyances Smile.

Best regards,
Antonio
Re: Running ANT tasks from bash console [message #1061393 is a reply to message #1061212] Fri, 31 May 2013 08:43 Go to previous messageGo to next message
Piotr Rygielski is currently offline Piotr Rygielski
Messages: 6
Registered: May 2013
Junior Member
Thank you for the suggestion. I will definitely try this option. For the current deadline I went through hell of changing the values and clicking it out manually in Eclipse. Personally, I think that this automatization of running an Ant script with Epsilon chain is very important and I am happy to help to contribute this.

However, if others have some ideas, I am happy to read them.
Re: Running ANT tasks from bash console [message #1061402 is a reply to message #1061393] Fri, 31 May 2013 09:24 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 804
Registered: July 2009
Senior Member
Hi Piotr,

To support running Epsilon's EMF-specific ANT tasks outside Eclipse, we'd probably need to write a build file that assembles a fat jar from the bin folders of the Epsilon core plugins and also injects a copy of the required EMF libraries. We've gone some way towards doing this in [1] but it needs a bit more work to pick up the EMF libraries.

Cheers,
Dimitris

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/plugins/org.eclipse.epsilon.workflow/build-jar.xml
Re: Running ANT tasks from bash console [message #1203175 is a reply to message #1061402] Fri, 22 November 2013 09:16 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 804
Registered: July 2009
Senior Member
Hi Piotr,

On an update to this, standalone JARs are now available under [1]. The following example demonstrates running ANT tasks from the command line [2].

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/download/
[2] http://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/org.eclipse.epsilon.examples.workflow.standalone/
Previous Topic:[SOLVED][EGL] Problem with using XML formatter
Next Topic:One model + ETL; multiple targets
Goto Forum:
  


Current Time: Fri Aug 01 20:38:02 EDT 2014

Powered by FUDForum. Page generated in 0.08730 seconds