You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kamran Hameed <ka...@gmail.com> on 2008/07/29 09:08:26 UTC

how to call a file in build.xml

folks.. i am writting a java application that uses JNI. Now for generating c
files i am using Makefile. and for java files i am using ant[it is must that
i use Makefile].

Now my question is that how can i call makefile in build.xml.. how
to call that so that when build.xml executes.. it calls Makefile that
compiles the C code

-- 
Kamran Hameed

http://hpc.niit.edu.pk/~kamran

Re: how to call a file in build.xml

Posted by Kamran Hameed <ka...@gmail.com>.
thanks alot

On Tue, Jul 29, 2008 at 6:06 AM, <ra...@wachovia.com> wrote:

> Kamran,
>
> You can still run the exec task in a UNIX environment.  The command to use
> would be sh, ksh, or bash:
>
> Example:
>
> for windows:
>          <exec executable="cmd" failonerror="true"
> outputproperty="build.xml.version.line">
>                <arg line='/c "cvs status
> ${quote}${app.lar.source.clientpath}/${prop.cust.xml.basename}.xml${quote}
> | findstr Working | findstr revision"'/>
>          </exec>
>
> for UNIX:
>           <exec executable="sh" failonerror="true"
> outputproperty="build.xml.version.line">
>                  <arg line="-c ${quote}cvs -d${common.setup.cvsRoot}
> status ${app.lar.source.clientpath}/${prop.cust.xml.basename}.xml | grep
> 'Working'${quote}"/>
>           </exec>
>
> You can also use <arg value="some single argument">.  I like to use the
> <arg line="some line of arguments"> ...
>
> I hope this helps ...
>
> Ray Harper, Jr.
> Software Engineer II
> Wachovia Corporation
> 1525 West WT Harris Blvd. Charlotte, NC, 28270
> Tel: 704-427-1717 ? Fax: 704-427-3234 ? Mailcode: NC1077
>
> CONFIDENTIALITY NOTICE:
> The information accompanying this email transmission may contain
> confidential or legally privileged information that is intended only for
> the use of the individual or entity named in this message. If you are not
> the intended recipient, you are hereby notified that any disclosure,
> copying, distribution or reliance upon the contents of this email is
> strictly prohibited. If you receive this email in error, please notify the
> sender immediately.
>
>
>
>
> "Kamran Hameed" <ka...@gmail.com>
> 07/29/2008 05:19 AM
> Please respond to
> "Ant Users List" <us...@ant.apache.org>
>
>
> To
> "Ant Users List" <us...@ant.apache.org>
> cc
>
> Subject
> Re: how to call a file in build.xml
>
>
>
>
>
>
> But exec is not supported on Linux. if we are in Windows.. and we want to
> call a batch file then we can use exec but under UNIX it is assumed that
> we
> can run scripts in shell
>
> So how do i call the makefile in my build.xml file??
>
> any idea
>
> On Tue, Jul 29, 2008 at 7:35 AM, Chris Green
> <ch...@googlemail.com>wrote:
>
> > Try the exec command. This allows you to call external command files.
> >
> > On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
> > > folks.. i am writting a java application that uses JNI. Now for
> > generating c
> > > files i am using Makefile. and for java files i am using ant[it is
> must
> > that
> > > i use Makefile].
> > >
> > > Now my question is that how can i call makefile in build.xml.. how
> > > to call that so that when build.xml executes.. it calls Makefile that
> > > compiles the C code
> > >
> > > --
> > > Kamran Hameed
> > >
> > > http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran> <
> http://hpc.niit.edu.pk/%7Ekamran>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
> --
> Kamran Hameed
>
> http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>
>
>


-- 
Kamran Hameed

http://hpc.niit.edu.pk/~kamran

Re: how to call a file in build.xml

Posted by Joe Schmetzer <jo...@exubero.com>.
Actually, exec *is* supported on Linux. You just need to specify the
executable as "make". e.g. <exec executable="/usr/bin/make">

Cheers,
Joe

On Tue, July 29, 2008 10:53 am, Kamran Hameed wrote:
> My point is that i am not invoking any simple script. Makefile should be
> called with make command
>
> On Tue, Jul 29, 2008 at 9:19 AM, Kamran Hameed
> <ka...@gmail.com>wrote:
>
>> But exec is not supported on Linux. if we are in Windows.. and we want
>> to
>> call a batch file then we can use exec but under UNIX it is assumed that
>> we
>> can run scripts in shell
>>
>> So how do i call the makefile in my build.xml file??
>>
>> any idea
>>
>>
>> On Tue, Jul 29, 2008 at 7:35 AM, Chris Green <
>> chris.green100@googlemail.com> wrote:
>>
>>> Try the exec command. This allows you to call external command files.
>>>
>>> On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
>>> > folks.. i am writting a java application that uses JNI. Now for
>>> generating c
>>> > files i am using Makefile. and for java files i am using ant[it is
>>> must
>>> that
>>> > i use Makefile].
>>> >
>>> > Now my question is that how can i call makefile in build.xml.. how
>>> > to call that so that when build.xml executes.. it calls Makefile that
>>> > compiles the C code
>>> >
>>> > --
>>> > Kamran Hameed
>>> >
>>> > http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to call a file in build.xml

Posted by Kamran Hameed <ka...@gmail.com>.
My point is that i am not invoking any simple script. Makefile should be
called with make command

On Tue, Jul 29, 2008 at 9:19 AM, Kamran Hameed <ka...@gmail.com>wrote:

> But exec is not supported on Linux. if we are in Windows.. and we want to
> call a batch file then we can use exec but under UNIX it is assumed that we
> can run scripts in shell
>
> So how do i call the makefile in my build.xml file??
>
> any idea
>
>
> On Tue, Jul 29, 2008 at 7:35 AM, Chris Green <
> chris.green100@googlemail.com> wrote:
>
>> Try the exec command. This allows you to call external command files.
>>
>> On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
>> > folks.. i am writting a java application that uses JNI. Now for
>> generating c
>> > files i am using Makefile. and for java files i am using ant[it is must
>> that
>> > i use Makefile].
>> >
>> > Now my question is that how can i call makefile in build.xml.. how
>> > to call that so that when build.xml executes.. it calls Makefile that
>> > compiles the C code
>> >
>> > --
>> > Kamran Hameed
>> >
>> > http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
>
> --
> Kamran Hameed
>
> http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>
>



-- 
Kamran Hameed

http://hpc.niit.edu.pk/~kamran

Re: how to call a file in build.xml

Posted by ra...@wachovia.com.
Kamran,

You can still run the exec task in a UNIX environment.  The command to use 
would be sh, ksh, or bash:

Example:

for windows:
          <exec executable="cmd" failonerror="true" 
outputproperty="build.xml.version.line">
                <arg line='/c "cvs status 
${quote}${app.lar.source.clientpath}/${prop.cust.xml.basename}.xml${quote} 
| findstr Working | findstr revision"'/>
          </exec>

for UNIX:
           <exec executable="sh" failonerror="true" 
outputproperty="build.xml.version.line">
                  <arg line="-c ${quote}cvs -d${common.setup.cvsRoot} 
status ${app.lar.source.clientpath}/${prop.cust.xml.basename}.xml | grep 
'Working'${quote}"/>
           </exec>

You can also use <arg value="some single argument">.  I like to use the 
<arg line="some line of arguments"> ...

I hope this helps ...

Ray Harper, Jr. 
Software Engineer II 
Wachovia Corporation 
1525 West WT Harris Blvd. Charlotte, NC, 28270 
Tel: 704-427-1717 ? Fax: 704-427-3234 ? Mailcode: NC1077 
 
CONFIDENTIALITY NOTICE:
The information accompanying this email transmission may contain 
confidential or legally privileged information that is intended only for 
the use of the individual or entity named in this message. If you are not 
the intended recipient, you are hereby notified that any disclosure, 
copying, distribution or reliance upon the contents of this email is 
strictly prohibited. If you receive this email in error, please notify the 
sender immediately.




"Kamran Hameed" <ka...@gmail.com> 
07/29/2008 05:19 AM
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
"Ant Users List" <us...@ant.apache.org>
cc

Subject
Re: how to call a file in build.xml






But exec is not supported on Linux. if we are in Windows.. and we want to
call a batch file then we can use exec but under UNIX it is assumed that 
we
can run scripts in shell

So how do i call the makefile in my build.xml file??

any idea

On Tue, Jul 29, 2008 at 7:35 AM, Chris Green
<ch...@googlemail.com>wrote:

> Try the exec command. This allows you to call external command files.
>
> On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
> > folks.. i am writting a java application that uses JNI. Now for
> generating c
> > files i am using Makefile. and for java files i am using ant[it is 
must
> that
> > i use Makefile].
> >
> > Now my question is that how can i call makefile in build.xml.. how
> > to call that so that when build.xml executes.. it calls Makefile that
> > compiles the C code
> >
> > --
> > Kamran Hameed
> >
> > http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Kamran Hameed

http://hpc.niit.edu.pk/~kamran


Re: how to call a file in build.xml

Posted by Kamran Hameed <ka...@gmail.com>.
But exec is not supported on Linux. if we are in Windows.. and we want to
call a batch file then we can use exec but under UNIX it is assumed that we
can run scripts in shell

So how do i call the makefile in my build.xml file??

any idea

On Tue, Jul 29, 2008 at 7:35 AM, Chris Green
<ch...@googlemail.com>wrote:

> Try the exec command. This allows you to call external command files.
>
> On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
> > folks.. i am writting a java application that uses JNI. Now for
> generating c
> > files i am using Makefile. and for java files i am using ant[it is must
> that
> > i use Makefile].
> >
> > Now my question is that how can i call makefile in build.xml.. how
> > to call that so that when build.xml executes.. it calls Makefile that
> > compiles the C code
> >
> > --
> > Kamran Hameed
> >
> > http://hpc.niit.edu.pk/~kamran <http://hpc.niit.edu.pk/%7Ekamran>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Kamran Hameed

http://hpc.niit.edu.pk/~kamran

Re: how to call a file in build.xml

Posted by Chris Green <ch...@googlemail.com>.
Try the exec command. This allows you to call external command files.

On 7/29/08, Kamran Hameed <ka...@gmail.com> wrote:
> folks.. i am writting a java application that uses JNI. Now for generating c
> files i am using Makefile. and for java files i am using ant[it is must that
> i use Makefile].
>
> Now my question is that how can i call makefile in build.xml.. how
> to call that so that when build.xml executes.. it calls Makefile that
> compiles the C code
>
> --
> Kamran Hameed
>
> http://hpc.niit.edu.pk/~kamran
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org