Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Extern Tool Builder and Ant
Extern Tool Builder and Ant [message #227300] Mon, 12 April 2004 21:27 Go to next message
Eclipse UserFriend
Originally posted by: danc.us.ibm.com

I have a need to use an Ant buildfile to run a conversion process on a
non-java file prior to building my project. I found the topic "Creating a
project Ant buildfile" in the online docs and looks like it will work for
me and I have a few questions and a problem that I encountered. I'm
running WSAD 5.0.1 and the online doc matchs the Eclipse doc.
First the questions.
Q1: Where do I find detailed documentation on this capability??
Q2: On the Properties page, Main tab, for the New_Builder, what is the
Arguments window for and how do I use it??
Q3: What are the entries on the Properties tab used for??

Now for my problem. I have an Ant build file that works from a DOS
command line. The Ant build file reads in a properties file (via Ant
<property file=... >) and a commonTargets.xml file via normal XML include
method. When I create an External Tools Builder 'Ant build', I set things
up according to the online instructions mentioned above. I point to the
buildfile that I run from the command line on the main page, and on the
Targets tab, I select the target that I want. When it runs within WSAD,
the Ant target in the main build file correctly invokes the target in the
commonTargets.xml file, BUT I get an error which indicates that the
content of the properties file, which was read, is not being propagated to
the commonTarget.xml processing. In other words:

build.xml:
reads property file
includes commonTargets.xml
performs some property setup
calls target in commonTargets.xml

commonTargets.xml
attempts to run the conversion processing
error indicating a property is not set (in properties file that was read).

Any ideas??
Dan Carissimo
Re: Extern Tool Builder and Ant [message #227327 is a reply to message #227300] Tue, 13 April 2004 00:09 Go to previous messageGo to next message
Eclipse UserFriend
"Dan Carissimo" <danc@us.ibm.com> wrote in message
news:c5ffme$m0q$1@eclipse.org...
> I have a need to use an Ant buildfile to run a conversion process on a
> non-java file prior to building my project. I found the topic "Creating a
> project Ant buildfile" in the online docs and looks like it will work for
> me and I have a few questions and a problem that I encountered. I'm
> running WSAD 5.0.1 and the online doc matchs the Eclipse doc.
> First the questions.
> Q1: Where do I find detailed documentation on this capability??

There really is not any besides the Eclipse help. I am another resource
available to you :-)


> Q2: On the Properties page, Main tab, for the New_Builder, what is the
> Arguments window for and how do I use it??

This can be used for passing options to Ant just like at the commandline
For example you could use -DpropertyName=propertyValue as an entry in the
Arguments text pane.
The most common use is for setting the message output level using -debug
or -verbose
Almost any command listed as valid for Ant from the commandline should be
accepted from the arguments text pane.
-find is the only example off the top of my head that I know does not work.


> Q3: What are the entries on the Properties tab used for??

This is just another UI way of setting properties. It is an alternative to
using -D<property>=<value> or
-propertyfile <name> in the Arguments tab as outlined above.


> Now for my problem. I have an Ant build file that works from a DOS
> command line. The Ant build file reads in a properties file (via Ant
> <property file=... >) and a commonTargets.xml file via normal XML include
> method. When I create an External Tools Builder 'Ant build', I set things
> up according to the online instructions mentioned above. I point to the
> buildfile that I run from the command line on the main page, and on the
> Targets tab, I select the target that I want. When it runs within WSAD,
> the Ant target in the main build file correctly invokes the target in the
> commonTargets.xml file, BUT I get an error which indicates that the
> content of the properties file, which was read, is not being propagated to
> the commonTarget.xml processing. In other words:
>
> build.xml:
> reads property file
> includes commonTargets.xml
> performs some property setup
> calls target in commonTargets.xml
>
> commonTargets.xml
> attempts to run the conversion processing
> error indicating a property is not set (in properties file that was
read).
>

Are you sure that the <property file=...> is actually reading in the
property file?
Doing a simple echo or a property from the file in the build.xml produces
the correct result?
When you run Ant within Eclipse 2.1.* it runs in the same VM as Eclipse and
the working directory for the Java process is often not what the user
expects for Ant builds.

HTH
Darins
Re: Extern Tool Builder and Ant [message #227794 is a reply to message #227327] Tue, 13 April 2004 11:48 Go to previous message
Eclipse UserFriend
Originally posted by: danc.us.ibm.com

Darin,
thanks for the answers. I put a -verbose into the Agruments section of
the Main tab, and saw that when WSAD invoked my Ant script, he put a
-Dbasedir=..... setting on the command line. It was being set to the
value that I put into the Base Directory. When I removed the Base
Directory setting, the Ant script worked just fine!!
Thanks again!!
Dan

Darin Swanson wrote:

> "Dan Carissimo" <danc@us.ibm.com> wrote in message
> news:c5ffme$m0q$1@eclipse.org...
> > I have a need to use an Ant buildfile to run a conversion process on a
> > non-java file prior to building my project. I found the topic "Creating a
> > project Ant buildfile" in the online docs and looks like it will work for
> > me and I have a few questions and a problem that I encountered. I'm
> > running WSAD 5.0.1 and the online doc matchs the Eclipse doc.
> > First the questions.
> > Q1: Where do I find detailed documentation on this capability??

> There really is not any besides the Eclipse help. I am another resource
> available to you :-)


> > Q2: On the Properties page, Main tab, for the New_Builder, what is the
> > Arguments window for and how do I use it??

> This can be used for passing options to Ant just like at the commandline
> For example you could use -DpropertyName=propertyValue as an entry in the
> Arguments text pane.
> The most common use is for setting the message output level using -debug
> or -verbose
> Almost any command listed as valid for Ant from the commandline should be
> accepted from the arguments text pane.
> -find is the only example off the top of my head that I know does not work.


> > Q3: What are the entries on the Properties tab used for??

> This is just another UI way of setting properties. It is an alternative to
> using -D<property>=<value> or
> -propertyfile <name> in the Arguments tab as outlined above.


> > Now for my problem. I have an Ant build file that works from a DOS
> > command line. The Ant build file reads in a properties file (via Ant
> > <property file=... >) and a commonTargets.xml file via normal XML include
> > method. When I create an External Tools Builder 'Ant build', I set things
> > up according to the online instructions mentioned above. I point to the
> > buildfile that I run from the command line on the main page, and on the
> > Targets tab, I select the target that I want. When it runs within WSAD,
> > the Ant target in the main build file correctly invokes the target in the
> > commonTargets.xml file, BUT I get an error which indicates that the
> > content of the properties file, which was read, is not being propagated to
> > the commonTarget.xml processing. In other words:
> >
> > build.xml:
> > reads property file
> > includes commonTargets.xml
> > performs some property setup
> > calls target in commonTargets.xml
> >
> > commonTargets.xml
> > attempts to run the conversion processing
> > error indicating a property is not set (in properties file that was
> read).
> >

> Are you sure that the <property file=...> is actually reading in the
> property file?
> Doing a simple echo or a property from the file in the build.xml produces
> the correct result?
> When you run Ant within Eclipse 2.1.* it runs in the same VM as Eclipse and
> the working directory for the Java process is often not what the user
> expects for Ant builds.

> HTH
> Darins
Previous Topic:Starting Ant in *new* VM / Eclipse 2.1
Next Topic:"End"- and "Pos 1"-Keys on numpad not working
Goto Forum:
  


Current Time: Mon May 12 19:32:27 EDT 2025

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

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

Back to the top