Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Can I customize the ant build script exported by eclipse?
Can I customize the ant build script exported by eclipse? [message #334357] Wed, 04 February 2009 16:58 Go to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
Hey,

Our plug-in has implemented a builder which is used to build some resource
files (let's call it resource builder). The files created by the resource
builder are used when the java builder builds a project. Now, we are
looking for a way to add the task which is done by our resource builder to
the ant build script exported by eclipse through "Export-->Ant Buildfile"
wizard. By defaul, the generated ant descript file only contains java
build task. Is there any way we can customize it?

Thanks.
Re: Can I customize the ant build script exported by eclipse? [message #334377 is a reply to message #334357] Thu, 05 February 2009 19:38 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
I just answered a similar question over on eclipse.platform.pde, look at
http://www.eclipse.org/newsportal/article.php?id=1097&gr oup=eclipse.platform.pde#1097

Set customBuildCallbacks=true in your build.properties, then regenerate
the build.xml script. You should then see new <subant> calls to pre and
post targets throughout the script.

There are also properties to control the inheritAll and failOnError
attributes of the subant call:
customBuildCallbacks.inheritall
customBuildCallbacks.failonerror

-Andrew

Raymond wrote:
> Hey,
>
> Our plug-in has implemented a builder which is used to build some
> resource files (let's call it resource builder). The files created by
> the resource builder are used when the java builder builds a project.
> Now, we are looking for a way to add the task which is done by our
> resource builder to the ant build script exported by eclipse through
> "Export-->Ant Buildfile" wizard. By defaul, the generated ant descript
> file only contains java build task. Is there any way we can customize it?
> Thanks.
>
Re: Can I customize the ant build script exported by eclipse? [message #334385 is a reply to message #334377] Fri, 06 February 2009 14:39 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
Andrew,

Thanks for you answer. It is good for me to know this mechanism. However,
it is not exactly what I want. This way, it seems users still need to
create the customBuildCallbacks.xml manually, then, when the build.xml is
executed, it can be called, right?

What I am looking for is does eclipse provides any support to
programmatically create an ANT build script file? When a project is
created, the properties of our resource builder are set, when users click
the export ant buildfiles function, I want it can programmatically create
an ANT task for our resource builder in the build.xml file or the
customBuildCallbacks.xml mentioned in your answer.In short words, I am
more interested in programmatically generating an ANT build file.

Thanks.
Re: Can I customize the ant build script exported by eclipse? [message #334389 is a reply to message #334377] Fri, 06 February 2009 14:53 Go to previous message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
BTW, can this call back be triggered if users run the build.xml outside
eclipse?
Previous Topic:Run As --> Ant Build... always creates new configuration
Next Topic:[p2] Can i somehow "reset" p2?
Goto Forum:
  


Current Time: Thu Nov 07 12:21:05 GMT 2024

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

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

Back to the top