This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant base dir problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant base dir problem" Watch "Ant base dir problem" New topic

Ant base dir problem

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

i tried this because my build file was non in the src folder and the complile task was not paths correctly, so I tried this:

<project name="nikos.custom.ant.builds" basedir="../src">

but then nothing worked,

saying stiff like mxmlc cannot be found.

<taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>

Any ideas?

Jesus lives
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Ant uses basedir as the project's main directory and thus expects almost everything to be relative to that directory. Setting the basdir to the src directory is probably going to mess things up. But it all really depends on your project's directory structure. A typical project should have a structure such as:

project/src/** (your Java sources go here)
project/bin/** (your compiled Java classes go here)

and so on. Thus the build.xml is in the base directory of the project (basedir=".").

JBoss In Action
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Ant base dir problem
It's not a secret anymore!