0
votes

I have an Ant task that needs to run in the parent directory. When I set the basedir to the parent directory the tokens are not replaced correctly.

<project name="Flex Ant Tasks Build Script" default="compileFlex" basedir="../"> 

    <!-- load previously defined configuration properties file --> 
    <property file="local_build.properties" /> 

    <!-- delete and create the DEPLOY dir again --> 
    <target name="init">
        <delete dir="${DEPLOY_DIR}" /> 
        <mkdir dir="${DEPLOY_DIR}" /> 
    </target> 

And the build properties:

// this is the folder we want to publish the swf to 
DEPLOY_DIR = ${basedir}/output

When the basedir is set to "." the result is:

[mkdir] Created dir: /Users/me/Documents/projects/MyProject/output

When I set the basedir to the parent, "../" the result is:

[mkdir] Created dir: /Users/me/Documents/projects/${DEPLOY_DIR}

The desired result is:

[mkdir] Created dir: /Users/me/Documents/projects/output

NOTE:
The build script resides in:

/Users/me/Documents/projects/MyProject/

because I can't seem to import any ANT build files outside of the Eclipse project

1

1 Answers

0
votes

The problem is that when I go up a directory the path to the property file becomes invalid. So ${DEPLOY_DIR} is never getting defined. If I go up a directory I need to then give it the correct path to the build properties file:

<property file="MyProject/local_build.properties" />