File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant Build...What does the values in basedir= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Build...What does the values in basedir="" mean?" Watch "Ant Build...What does the values in basedir="" mean?" New topic
Author

Ant Build...What does the values in basedir="" mean?

Suhas Saheer
Greenhorn

Joined: Mar 23, 2009
Posts: 17

Hi,
PFA my project structure.
I created a build.xml file and used the statement to get the placeholder values.
<property file="build.properties"></property>

But i cant read the values from the properties file.
Seems like the directory is wrong.

I have given like this
<project name="Project " default="compile" basedir="..">

Seems like the basedir is not correct.
Please tell me what is the correct value to be given and i am also confused about this ".." , "../" and so on.


[Thumbnail for Pjt structure.JPG]



Thanks and Regards,
Suhas Saheer
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Regarding PFA: http://faq.javaranch.com/java/UseRealWords

Using '.' means 'current directory', and '..' means 'parent directory'. For a build.xml file, the directory in which the build.xml file resides is considered the current directory.

It is usually a standard practice that basedir is set to '.', and not to '..'. Also it is another standard practice that build.properties appears in the same directory as build.xml. And usually the build.xml file appears in the base directory of the project (in your case, move build.xml to where build.properties is located)

If you really do not want to move your build.xml or build.properties file, or change the basedir, use this:



JBoss In Action
Suhas Saheer
Greenhorn

Joined: Mar 23, 2009
Posts: 17

Thanks you!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's PFA?
Suhas Saheer
Greenhorn

Joined: Mar 23, 2009
Posts: 17

PFA mean "Please find attached"
Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

hi, may I ask something?

using base dir for messes up things like this which are supposed to be unaffected because they are absolute ones.

<taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<taskdef name="compc" classname="flex.ant.CompcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<taskdef name="html-wrapper" classname="flex.ant.HtmlWrapperTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<taskdef name="asdoc" classname="flex.ant.AsDocTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>

Any ideas?


Jesus lives
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168

Nikos, please continue this discussion in your other thread here http://www.coderanch.com/t/587747/tools/Ant-base-dir


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant Build...What does the values in basedir="" mean?