I have the following ant build file that attempts to concatenate a bunch of JavaScript files, so that I can write modular code, but only deliver one js file. The script is automatically ran by Eclipse every time I save a file in my project, which greatly simplifies my workflow.
My problem
When the build script is executed by Eclipse, everything is fine. If I try to run ant directly from the command line, I get an error saying:
/home/formigone/html5voodoo/build.xml:38: file attribute is null!
Here's my script:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Build example" default="all" basedir=".">
// ...
<property name="SRC_JS_DIR" value="${basedir}/js/hvdoo" />
<property name="DIST_JS_DIR" value="${basedir}/js/out" />
<property name="DIST_JS_TMP" value="${basedir}/js/out/tmp" />
// ...
<property name="JS_OUT_DEF" value="${DIST_JS_TMP}/__def.js" />
<property name="JS_OUT_CODE" value="${DIST_JS_TMP}/__code.js" />
<property name="JS_OUT_LINKED" value="${DIST_JS_TMP}/__out.js" />
<target name="makeDef">
<concat destfile="${JS_OUT_DEF}">
<fileset dir="${SRC_JS_DIR}"
includes="**/__def.js" />
</concat>
</target>
<target name="makeCode">
<concat destfile="${JS_OUT_CODE}">
<fileset dir="${SRC_JS_DIR}"
includes="**/*.js"
excludes="**/__*.js" />
</concat>
</target>
<target name="link">
<concat destfile="${JS_OUT_LINKED}">
<file name="${JS_OUT_DEF}" />
<file name="${JS_OUT_CODE}" />
</concat>
</target>
// ...
<target name="quick" depends="makeDef, makeCode, linkToOut"></target>
(I have intentionally left out other parts of the script that aren't in question here)
The error message refers to this line inside the link target:
<concat destfile="${JS_OUT_LINKED}">
What does file attribute is null! mean in this case? If I , I can see that the path to the file I want is correct. So why does it work from Eclipse, but not com CLI?
Thanks!