0

I'm trying to concatenate the js files in my project and put the resultant file in a build folder using ant.

The folder structure of my project is:

-Project
  -build.xml
  -build
  -src
    -init.js
    -Game.js

The build.xml file I'm trying to run is:

<project name="Build example" default="all" basedir=".">
    <!-- Setup -->
    <property name="SRC_JS_DIR" value="src" description="JavaScript source folder" />
    <property name="DIST_JS_DIR" value="build" description="Output folder for JavaScript files" />

    <property name="JS" value="${DIST_JS_DIR}/app.js" />

    <target name="js" description="Concatenate JavaScript source files">
        <echo message="Building ${JS}" />
        <concat destfile="${JS}">
            <fileset dir="${SRC_JS_DIR}" includes="init.js" />
            <fileset dir="${SRC_JS_DIR}" includes="Game.js" />
        </concat>
        <echo message="${JS} built." />
    </target>
</project>

When I run ant I get the following error:

BUILD FAILED Target "all" does not exist in the project "Build example".

Please could some one give a help on how to fix this.

1 Answer 1

1

Either change the target name to all or change default="all" to default="js".

The default attribute of the <project> tag indicates which target will be run if none were specified.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.