Build.xml

Материал из BiTel WiKi

Перейти к: навигация, поиск
<?xml version="1.0" encoding="windows-1251"?>
<project name="BGBilling" default="build" basedir=".">
    <description>Action для BGBilling</description>
 
    <!-- application metadata -->
    <property name="app.name"        value="custom-actions"/>
 
    <!-- sources -->
    <property name="src.dir"        value="${basedir}/src"/>
 
    <!-- runtime libraries -->
    <property name="lib.dir"        value="${basedir}/lib"/>
 
    <!-- standalone ant libraries -->
    <property name="lib-build.dir"  value="${basedir}/lib-build"/>
 
    <!-- compiled results -->
    <property name="classes.dir"    value="${basedir}/classes"/>
    <property name="dist.dir"       value="${basedir}/dist"/>
 
    <!-- ### Begin OS detection ### -->
    <!-- first create our properties -->
    <condition property="isWindows">
        <os family="windows" />
    </condition>
 
    <condition property="isUnix">
        <os family="unix" />
    </condition>
 
    <!-- now create our operating system specific targets -->
    <target name="doWindows" if="isWindows">
        <echo message="Came into the Windows target" />
        <property name="bgbilling.dir"  value="C:\Dropbox\My Dropbox\Paul\Apps\bgbilling\server"/>
    </target>
 
    <target name="doUnix" if="isUnix">
        <echo message="Came into the Unix target" />
        <property name="bgbilling.dir"  value="/home/paul/Dropbox.pub/Paul/Apps/bgbilling/server"/>
    </target>
    <!-- ### End of OS detection ### -->
 
    <!-- compile options -->
    <property name="includeantruntime"      value="false"/>
    <property name="compile.debug"          value="true"/>
    <property name="compile.deprecation"    value="false"/>
    <property name="compile.optimize"       value="true"/>
 
    <target name="clean" description="Delete generated and temporary directories and files">
        <delete quiet="true" dir="${dist.dir}"/>
        <delete quiet="true" dir="${classes.dir}"/>
    </target>
 
    <target name="prepare" description="Create directories and files before compile">
        <mkdir dir="${classes.dir}"/>
        <mkdir dir="${dist.dir}"/>
    </target>
 
    <target name="compile" depends="clean, prepare, doWindows, doUnix" description="Compile Java sources">
        <property name="bgbilling-lib.dir" value="${bgbilling.dir}/lib"/>
        <path id="compile.classpath">
            <fileset dir="${lib.dir}">
                <include name="*.jar"/>
            </fileset>      
            <fileset dir="${bgbilling-lib.dir}">
                <include name="*.jar"/>
            </fileset>      
        </path>
        <javac   srcdir="${src.dir}"
                destdir="${classes.dir}"
                debug="${compile.debug}"
                deprecation="${compile.deprecation}"
                optimize="${compile.optimize}"
                includeantruntime="${includeantruntime}"
                encoding="cp1251">
                <classpath refid="compile.classpath"/>
                <compilerarg value="-Xlint:unchecked"/>
                <compilerarg value="-Xlint:deprecation"/>
        </javac>
     </target>
 
    <target name="build" depends="compile" description="Create JAR distribution">
        <jar destfile="${dist.dir}/${app.name}.jar">
            <fileset dir="${classes.dir}"/>
        </jar>
    </target>
 
</project>
Личные инструменты