
<project name="roller-scripting" default="build" basedir=".">
    <description>Build Roller-Groovy integration classes</description>   

    <property file="./ant.properties" />
        
    <path id="scripting.path">
        <fileset dir="${rollersrc.dir}/build/webapp/WEB-INF/lib">   
            <include name="roller-core.jar"/>   
            <include name="roller-web.jar"/>   
            <include name="roller-business.jar"/>   
            <include name="commons-logging.jar"/>   
        </fileset>
        <fileset dir="${bsf.home}/lib">
            <include name="bsf.jar"/>
        </fileset>                      
    </path>
    
    <target name="build">        
        <mkdir dir="./build/classes" />
        <javac debug="on" destdir="./build/classes">
            <src path="./src" />
            <classpath>
                <path refid="scripting.path"/>
            </classpath>
        </javac>
        <mkdir dir="./dist" />
        <jar basedir="build/classes" jarfile="./dist/roller-scripting.jar" />
    </target>

    <!--
    Copy BSF, JRuby, Groovy and Rhino jars. 
    Versions tested:
       - Groovy 1.0
       - BSF 2.4.0
       - JRuby 0.9.8
       - Rhino 1.6 R5
    -->
    <target name="copy-to-roller" >
        <copy todir="../../../build/webapp/WEB-INF/lib">
            <fileset dir="./dist">
               <include name="roller-scripting.jar" />
            </fileset>
            <fileset dir="./lib">
               <include name="bsf.jar" />
            </fileset>
            <fileset dir="${groovy.home}/embeddable">
               <include name="groovy-all-1.0.jar" />
            </fileset>
            <fileset dir="${jruby.home}/lib">
               <include name="jruby.jar" />
            </fileset>
            <fileset dir="${rhino.home}">
               <include name="js.jar" />
            </fileset>
        </copy>
    </target>

    <target name="clean">
        <delete dir="./build" />
    </target>
    
</project>
