• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

build.xml question

 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to decode this build file. Line 3, the project tag, sets the default attribute (am I correct in calling this an attribute?) to "build" and the basedir to "." which I am assuming is the directory from which you launch the "ant deploy" or "ant all deploy" command, or whatever else you want to do. If this is correct, then on my system, the project tag has told Ant to put stuff (or look for it?) in C:\java\build\.
(Am I on the right track so far?)

I noticed on lines 9 and 10 that the property tags for src.dir and resources.dir indicate that these directories are to be put inside the basedir, so they will be found at C:\java\src\ and C:\java\resources\ respectively. But line 11 puts the build.dir directly at build\. I am assuming that the project tag has already told Ant to put build in the basedir, therefore it doesn't have to give the fully qualified location as it did in lines 9 and 10. Is this correct? (Also, is my terminology correct? I hate calling things by the wrong name. It adds to my confusion, as well as making discussion confusing.


<?xml version="1.0"?>
< !-- This build file uses ant 1.6 -->
<project name="bee" default="build" basedir=".">

<target name="init">
<property file="${user.home}/build.properties"/>
<property name="app.name" value="bee"/>

<property name="src.dir" location="${basedir}/src"/>
<property name="resources.dir" value="${basedir}/resources"/>
<property name="build.dir" location="build"/>
<property name="classes.dir" location="${build.dir}/classes"/>

<property name="dist.dir" location="${build.dir}/dist"/>
</target>

(I didn't ask for my title without good reason.....)
[ February 27, 2006: Message edited by: Carol Murphy ]
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no code.......
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chandra Sagi:
no code.......


I believe she is referring to this ant build file.
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


CM: I'm trying to decode this build file. Line 3, the project tag, sets the default attribute (am I correct in calling this an attribute?)

MdQ: Yes, it is an attribute.

CM: to "build" and the basedir to "." which I am assuming is the directory from which you launch the "ant deploy" or "ant all deploy" command, or whatever else you want to do. If this is correct, then on my system, the project tag has told Ant to put stuff (or look for it?) in C:\java\build\.

MdQ: You're almost correct. You have set the default target to "build" and the basedir to whichever directory your build.xml file lives in (which is probably C:\java, the same directory that your src and resources subdirectories live in).

CM: (Am I on the right track so far?)

I noticed on lines 9 and 10 that the property tags for src.dir and resources.dir indicate that these directories are to be put inside the basedir, so they will be found at C:\java\src\ and C:\java\resources\ respectively. But line 11 puts the build.dir directly at build\. I am assuming that the project tag has already told Ant to put build in the basedir, therefore it doesn't have to give the fully qualified location as it did in lines 9 and 10. Is this correct? (Also, is my terminology correct? I hate calling things by the wrong name. It adds to my confusion, as well as making discussion confusing.

MdQ: Good observation, Carol. Actually, the ${basedir} part of lines 9 and 10 appear to be redundant for our use since src.dir and resources.dir are also subdirectories of the basedir.

p.s. by "fully qualified location" I suspect you mean "absolute path"
[ February 27, 2006: Message edited by: Marilyn de Queiroz ]
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic