Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Invoke Ant file with AntRunner
Invoke Ant file with AntRunner [message #667553] Fri, 29 April 2011 13:59 Go to next message
JeTBLaCK  is currently offline JeTBLaCK Friend
Messages: 41
Registered: March 2011
Member
Hi!!!

I want to execute programatically my build.xml Ant file to refresh my workspace. I use AntRunner:

AntRunner ant = new AntRunner();

ant.setBuildFileLocation(locationBuild(Platform.getLocation().toString()));

ant.setAntHome(System.getProperty("user.dir")+"\\plugins\\org.apache.ant_1.7.1.v20100518-1145\\");

ant.run();


But not works:

org.eclipse.core.runtime.CoreException: BUILD FAILED


Any idea??

[Updated on: Fri, 29 April 2011 13:59]

Report message to a moderator

Re: Invoke Ant file with AntRunner [message #667574 is a reply to message #667553] Fri, 29 April 2011 15:11 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You should pick one or the other.

1) If you are programmatically trying to refresh your workspace, create
a plugin, use ResourcesPlugin, and you can refresh your workspace using API.

2) run your build file, using something like:

bash$ eclipse -application org.eclipse.ant.core.antRunner -buildfile
<your build.xml>

Running a buildfile using eclipse's antRunner provides all of the
eclipse and pde ant tasks for free.


Or are you somehow outside of eclipse completely?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Invoke Ant file with AntRunner [message #667575 is a reply to message #667574] Fri, 29 April 2011 15:26 Go to previous message
JeTBLaCK  is currently offline JeTBLaCK Friend
Messages: 41
Registered: March 2011
Member
Hi Paul,

About use ResourcePlugin and to refresh my workspace using API... How can I do it?

I tried the next code:

IWorkspace workspace = ResourcesPlugin.getWorkspace();

IWorkspaceRoot root = workspace.getRoot();

root.refreshLocal(IResource.DEPTH_INIFINITE, null);


But not works... My workspace is not refreshed.

About build file... I need execute the buildfile from my code...

[Updated on: Fri, 29 April 2011 15:31]

Report message to a moderator

Previous Topic:Help not too helpful
Next Topic:[SOLVED] How to use HTML text inside MessageDialogs?
Goto Forum:
  


Current Time: Thu Mar 28 23:41:56 GMT 2024

Powered by FUDForum. Page generated in 0.02325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top