You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Karthik <ka...@xius.org> on 2006/02/14 06:20:56 UTC

Delima to use or not to use build.xml


Hi Form

I am a begineer in here....

 If One uses the API's of Ant  from java  to  set/run the targets /tasks.

   "org.apache.tools.ant.*"

  then is  the "buildfile.xml"  still necessary for execution.


Please somebody  explain.....




with regards
Karthik


RE: Delima to use or not to use build.xml

Posted by Stephen McConnell <mc...@dpml.net>.
 
> 
>   How to write the equivalent of the "FTP_UPLOAD" Task by 
> using ANT API
> ("org.apache.tools.ant.*")

Spend some time reading everthing here at
http://ant.apache.org/manual/index.html and in particular:
http://ant.apache.org/ant_in_anger.html.

> Mr McConell the site http://www.dpml.net/depot u reffred is 
> probably down,and timing out on my FireFox Browser.
> 

It's working for me - perhaps try later.

Cheers, Steve.


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


Delima to use or not to use build.xml

Posted by Karthik <ka...@xius.org>.
Hi Form


  How to write the equivalent of the "FTP_UPLOAD" Task by using ANT API
("org.apache.tools.ant.*")


<target name="FTP_UPLOAD" >

 <ftp server="${ftIp}"
   remotedir="${ftpremotedir}"
   userid="${ftpid}"
   password="${ftppas}"
   separator="\"
   action="put">
  <fileset dir="${src.dir}">
   <include name="**/*"/>
   </fileset>
  </ftp>
</target>


Mr McConell the site http://www.dpml.net/depot u reffred is probably
down,and timing out on my FireFox Browser.


Please somebody help he.


with regards
Karthik


-----Original Message-----
From: Stephen McConnell [mailto:mcconnell@dpml.net]
Sent: Tuesday, February 14, 2006 1:39 PM
To: 'Ant Users List'
Subject: RE: Delima to use or not to use build.xml



> 1)How to set the Target name for ="TgtName"
>
>   "<property name="TgtName" value="$(target}"/>"
>
>    in property  Using ANT API ("org.apache.tools.ant.*")


http://api.dpml.net/ant/1.6.5/org/apache/tools/ant/Project.html#setProperty(
java.lang.String,%20java.lang.String)


> 2)How to execute the argumented target using ANT API's.

Take a look at some examples of some systems that handle embedded ant.  The
DPML Depot system is the one I use (http://www.dpml.net/depot) but there are
other more prominent/well-known examples on the net that you should probably
dig into.

Cheers, Steve.



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


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


RE: Delima to use or not to use build.xml

Posted by Stephen McConnell <mc...@dpml.net>.
 
> 1)How to set the Target name for ="TgtName"
> 
>   "<property name="TgtName" value="$(target}"/>"
> 
>    in property  Using ANT API ("org.apache.tools.ant.*")


http://api.dpml.net/ant/1.6.5/org/apache/tools/ant/Project.html#setProperty(
java.lang.String,%20java.lang.String)


> 2)How to execute the argumented target using ANT API's.

Take a look at some examples of some systems that handle embedded ant.  The
DPML Depot system is the one I use (http://www.dpml.net/depot) but there are
other more prominent/well-known examples on the net that you should probably
dig into.

Cheers, Steve.



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


Delima to use or not to use build.xml

Posted by Karthik <ka...@xius.org>.
Hi Form

I have a build.xml file with tags as displayed below...

 <property name="src.dir" value="${basedir}"/>
 <property name="dest.dir" value="${destdir}"/>
 <property name="TgtName" value="$(target}"/>
 
 <target name="${TgtName}" 
      <copy todir="${dest.dir}">
         <fileset dir="${src.dir}"/>
      </copy>



1)How to set the Target name for ="TgtName"

  "<property name="TgtName" value="$(target}"/>"

   in property  Using ANT API ("org.apache.tools.ant.*")

2)How to execute the argumented target using ANT API's.


Please somebody expalin to me

With regards
Karthik



  -----Original Message-----
  From: Karthik [mailto:karthikn@xius.org]
  Sent: Tuesday, February 14, 2006 10:51 AM
  To: user@ant.apache.org
  Subject: Delima to use or not to use build.xml




  Hi Form

  I am a begineer in here....

   If One uses the API's of Ant  from java  to  set/run the targets /tasks.

     "org.apache.tools.ant.*"

    then is  the "buildfile.xml"  still necessary for execution.


  Please somebody  explain.....




  with regards
  Karthik


RE: Delima to use or not to use build.xml

Posted by Stephen McConnell <mc...@dpml.net>.
 

> Hi Form
> I am a begineer in here....
> If One uses the API's of Ant  from java  to  set/run the targets /tasks.
> "org.apache.tools.ant.*"
> then is  the "buildfile.xml"  still necessary for execution.

No - the build.xml file is not necessary.
 
> Please somebody  explain.....

The centre of the Ant API is the Project class.  You can programmatically
setup a project, add targets containing tasks, listeners, etc. Once that's
done you can request a sorted list of targets and trigger target execution.

Think of the build file as an XML-based description of the state of project
definition.  The definition could be established by parsing the build file,
or alternatively it could be establish using other information.  The
majority of builds I work with do not have a build.xml however, I frequently
include XML-based template definitions as part of the process of project
population.

/Steve.

--------------------------
Stephen McConnell
mailto:mcconnell@dpml.net
http://www.dpml.net
 


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