You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by John McClain <jm...@lanset.com> on 2001/08/16 06:48:19 UTC

ant newbie question

I have a web app that I am trying to learn ant with.
In this test scenario, I don't want to use packages, so I am trying to figure out the best way to use ant to build the entire project.
Here is my build file and my includesfile


<project name="crossroads" default="buildActions" basedir=".">
<target name="init">
  <property name="classes" value="WEB-INF/classes" />
</target> 

<target name="tstBuild" depends="init">
  <javac srcdir="${classes}" destdir="${classes}" includesfile="incFile">
    <classpath>
    <pathelement location="/opt/jakarta-tomcat-3.2.1/lib/servlet.jar"/>
    <pathelement location="WEB-INF/lib/struts.jar"/>
    <pathelement location="WEB-INF/classes/Forms"/>
    <pathelement location="${Utils}"/>
    <pathelement location="${Forms}"/>
    <pathelement location="${DataSources}"/>
    <pathelement location="${DomainObjects}"/>
    <pathelement location="${Actions}"/>
    <pathelement location="${TagSrc}"/>
    </classpath>
  </javac>
</target>
</project>
<!-- here is incFile 
${classes}/Utils/Constants.java
${classes}/DomainObjects/MyEvent.java
${classes}/Utils/User.java
${classes}/Forms/EditEventForm.java
${classes}/Forms/EditEventsForm.java
${classes}/Forms/LogonForm.java
${classes}/TagSrc/CheckLogonTag.java
${classes}/DataSources/MyCalendarDS.java
${classes}/DataSources/MyCalendarDayDS.java
${classes}/DataSources/MyEventDS.java
${classes}/DomainObjects/MyCalendar.java
${classes}/DomainObjects/MyCalendarDay.java
${classes}/Actions/ChangeMonthAction.java
${classes}/Actions/EditEventAction.java
${classes}/Actions/EditEventsAction.java
${classes}/Actions/LogonAction.java
${classes}/Actions/MyCalendarAction.java
-->



Questions:
  a.. Why do I get the following when It did nothing. Should I not get "project up to date" or "no files found" or something to tell me what it is doing:
earching for build.xml ...

Buildfile: /home/jmcclain/dev/crossroads2/build.xml


init:


tstBuild:


BUILD SUCCESSFUL


Total time: 0 seconds 

  a.. Can I use a pattern or fileset instead of an include file? how would I do it???
  b.. Is there a better way to do this NOT using packages?
John and Michelle McClain
7604 Muschetto Ct.
Citrus Heights, Ca. 95621
(916)728-5223

Re: ant newbie question

Posted by Satish Kumar <ma...@yahoo.com>.
Hi John,
        Try turning on the -verbose option...u will be
able to see what's happenning 'behind the scenes'...it
will tell u whether it is selecting a particular file
or not.....

Check the ant user manual for pattern set and file
sets ..the example given there should be sufficient to
handle your requirement....

i guess u can use **/*.java in the "include task" to
include sub-directories also.

Satish
--- John McClain <jm...@lanset.com> wrote:
> I have a web app that I am trying to learn ant with.
> In this test scenario, I don't want to use packages,
> so I am trying to figure out the best way to use ant
> to build the entire project.
> Here is my build file and my includesfile
> 
> 
> <project name="crossroads" default="buildActions"
> basedir=".">
> <target name="init">
>   <property name="classes" value="WEB-INF/classes"
> />
> </target> 
> 
> <target name="tstBuild" depends="init">
>   <javac srcdir="${classes}" destdir="${classes}"
> includesfile="incFile">
>     <classpath>
>     <pathelement
>
location="/opt/jakarta-tomcat-3.2.1/lib/servlet.jar"/>
>     <pathelement location="WEB-INF/lib/struts.jar"/>
>     <pathelement location="WEB-INF/classes/Forms"/>
>     <pathelement location="${Utils}"/>
>     <pathelement location="${Forms}"/>
>     <pathelement location="${DataSources}"/>
>     <pathelement location="${DomainObjects}"/>
>     <pathelement location="${Actions}"/>
>     <pathelement location="${TagSrc}"/>
>     </classpath>
>   </javac>
> </target>
> </project>
> <!-- here is incFile 
> ${classes}/Utils/Constants.java
> ${classes}/DomainObjects/MyEvent.java
> ${classes}/Utils/User.java
> ${classes}/Forms/EditEventForm.java
> ${classes}/Forms/EditEventsForm.java
> ${classes}/Forms/LogonForm.java
> ${classes}/TagSrc/CheckLogonTag.java
> ${classes}/DataSources/MyCalendarDS.java
> ${classes}/DataSources/MyCalendarDayDS.java
> ${classes}/DataSources/MyEventDS.java
> ${classes}/DomainObjects/MyCalendar.java
> ${classes}/DomainObjects/MyCalendarDay.java
> ${classes}/Actions/ChangeMonthAction.java
> ${classes}/Actions/EditEventAction.java
> ${classes}/Actions/EditEventsAction.java
> ${classes}/Actions/LogonAction.java
> ${classes}/Actions/MyCalendarAction.java
> -->
> 
> 
> 
> Questions:
>   a.. Why do I get the following when It did
> nothing. Should I not get "project up to date" or
> "no files found" or something to tell me what it is
> doing:
> earching for build.xml ...
> 
> Buildfile: /home/jmcclain/dev/crossroads2/build.xml
> 
> 
> init:
> 
> 
> tstBuild:
> 
> 
> BUILD SUCCESSFUL
> 
> 
> Total time: 0 seconds 
> 
>   a.. Can I use a pattern or fileset instead of an
> include file? how would I do it???
>   b.. Is there a better way to do this NOT using
> packages?
> John and Michelle McClain
> 7604 Muschetto Ct.
> Citrus Heights, Ca. 95621
> (916)728-5223
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/