Search code examples
antbuildhtml5boilerplate

HTML5Boilerplate Build Script - How to pass dir.source variable on the command line


We're using the HTML5 Boilerplate Build Script on Windows and I wondered if it's possible to specify the dir.source parameter on the command line when running ant build, rather than editing it in the default.properties file each time we want to build a template in a different directory.

dir.source = ./template/company1

The dir.source parameter changes constantly as were building templates within different directories for our CMS, such as ./template/company1 and ./template/company2 etc

If we can avoid editing the default.properties file every time we want to build a template in a different directory that would be great, any help much appreciated!


Solution

  • Try to use something like:

    <javac srcdir="${srcdir}" destdir="${build.dir}"/>  
    

    and call it with:

    ant -Dsrcdir="template/company1"
    

    is it what you need?