|
- <project default="dist-lite" name="Mutant">
-
- <!-- source locations -->
- <property name="src.dir" value="src"/>
- <property name="lib.dir" value="lib"/>
- <property name="java.dir" value="${src.dir}/java"/>
- <property name="script.dir" value="${src.dir}/script"/>
- <property name="conf.dir" value="${src.dir}/conf"/>
-
- <!-- build and distribution locations -->
- <property name="bin.dir" value="bin"/>
- <property name="dist.dir" value="dist"/>
- <property name="dist.bin" value="${dist.dir}/bin"/>
- <property name="dist.conf" value="${dist.dir}/conf"/>
- <property name="javadocs.dir" value="${dist.dir}/docs/manual/api"/>
- <property name="dist.lib.dir" value="${dist.dir}/lib"/>
- <property name="dist.core.dir" value="${dist.lib.dir}/core"/>
- <property name="dist.frontend.dir" value="${dist.lib.dir}/frontend"/>
- <property name="dist.antlibs.dir" value="${dist.lib.dir}/antlibs"/>
- <property name="dist.syslibs.dir" value="${dist.core.dir}/syslibs"/>
-
- <!-- control flags -->
- <property name="debug" value="true"/>
- <property name="chmod.fail" value="true" />
-
- <path id="classpath.parser">
- <fileset dir="${lib.dir}/parser" includes="*.jar"/>
- </path>
-
- <path id="classpath.common">
- <pathelement location="${dist.core.dir}/start/init.jar"/>
- </path>
-
- <path id="classpath.antcore">
- <path refid="classpath.common"/>
- <pathelement location="${dist.core.dir}/common/common.jar"/>
- <path refid="classpath.parser"/>
- </path>
-
- <path id="classpath.frontend">
- <path refid="classpath.antcore"/>
- <pathelement location="${dist.core.dir}/antcore/antcore.jar"/>
- </path>
-
- <path id="classpath.start">
- <pathelement location="${dist.core.dir}/start/init.jar"/>
- </path>
-
- <target name="buildsetup">
- <available classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
- property="checkstyle.available"/>
- <mkdir dir="${bin.dir}"/>
- <mkdir dir="${dist.core.dir}"/>
- <copy todir="${dist.core.dir}/parser">
- <fileset dir="${lib.dir}/parser"/>
- </copy>
- </target>
-
- <target name="initjar" depends="buildsetup">
- <mkdir dir="${bin.dir}/init"/>
- <mkdir dir="${dist.core.dir}/start"/>
- <depend destdir="${bin.dir}/init" srcdir="${java.dir}/init" closure="yes"/>
- <javac destdir="${bin.dir}/init" srcdir="${java.dir}/init" debug="${debug}"/>
- <jar basedir="${bin.dir}/init" jarfile="${dist.core.dir}/start/init.jar"/>
- </target>
-
- <target name="common" depends="initjar">
- <mkdir dir="${bin.dir}/common"/>
- <mkdir dir="${dist.core.dir}/common"/>
- <depend destdir="${bin.dir}/common" srcdir="${java.dir}/common" closure="yes">
- <classpath refid="classpath.common"/>
- </depend>
- <javac destdir="${bin.dir}/common" srcdir="${java.dir}/common" debug="${debug}">
- <classpath refid="classpath.common"/>
- </javac>
- <jar basedir="${bin.dir}/common" jarfile="${dist.core.dir}/common/common.jar"/>
- </target>
-
- <target name="antcore" depends="common">
- <mkdir dir="${bin.dir}/antcore"/>
- <mkdir dir="${dist.core.dir}/antcore"/>
- <depend destdir="${bin.dir}/antcore" srcdir="${java.dir}/antcore" closure="yes">
- <classpath refid="classpath.antcore"/>
- </depend>
- <javac destdir="${bin.dir}/antcore" srcdir="${java.dir}/antcore" debug="${debug}">
- <classpath refid="classpath.antcore"/>
- </javac>
- <jar basedir="${bin.dir}/antcore" jarfile="${dist.core.dir}/antcore/antcore.jar"/>
- </target>
-
- <target name="frontend" depends="antcore, startjar">
- <mkdir dir="${bin.dir}/frontend"/>
- <mkdir dir="${dist.frontend.dir}"/>
- <depend destdir="${bin.dir}/frontend" srcdir="${java.dir}/frontend" closure="yes">
- <classpath refid="classpath.frontend"/>
- </depend>
- <javac destdir="${bin.dir}/frontend" srcdir="${java.dir}/frontend" debug="${debug}">
- <classpath refid="classpath.frontend"/>
- </javac>
- <jar basedir="${bin.dir}/frontend" jarfile="${dist.frontend.dir}/cli.jar">
- <include name="**/cli/*.class"/>
- <manifest>
- <attribute name="Main-Class" value="org.apache.ant.cli.Commandline"/>
- </manifest>
- </jar>
- </target>
-
- <target name="startjar" depends="initjar">
- <mkdir dir="${bin.dir}/start"/>
- <mkdir dir="${dist.core.dir}/start"/>
- <depend destdir="${bin.dir}/start" srcdir="${java.dir}/start" closure="yes">
- <classpath refid="classpath.start"/>
- </depend>
- <javac destdir="${bin.dir}/start" srcdir="${java.dir}/start" debug="${debug}">
- <classpath refid="classpath.start"/>
- </javac>
- <jar basedir="${bin.dir}/start" jarfile="${dist.core.dir}/start/start.jar">
- <manifest>
- <attribute name="Main-Class" value="org.apache.ant.start.Main"/>
- <attribute name="Class-Path" value="init.jar"/>
- </manifest>
- <include name="org/apache/ant/**/*"/>
- </jar>
- <jar basedir="${bin.dir}/start" jarfile="${dist.core.dir}/start/ant.jar">
- <manifest>
- <attribute name="Main-Class" value="org.apache.tools.ant.Main"/>
- <attribute name="Class-Path" value="start.jar"/>
- </manifest>
- <include name="org/apache/tools/ant/**/*"/>
- </jar>
- </target>
-
- <!--
- <target name="remote" depends="initjar">
- <mkdir dir="${bin.dir}/remote"/>
- <depend destdir="${bin.dir}/remote" srcdir="${java.dir}/remote" closure="yes">
- <classpath refid="classpath.start"/>
- </depend>
- <javac destdir="${bin.dir}/remote" srcdir="${java.dir}/remote" debug="${debug}">
- <classpath refid="classpath.start"/>
- </javac>
- <jar basedir="${bin.dir}/remote" jarfile="${distlib.dir}/remote.jar">
- <manifest>
- <attribute name="Main-Class" value="org.apache.ant.remote.RemoteMain"/>
- </manifest>
- </jar>
- </target>
- -->
-
- <target name="antlibs" depends="common">
- <!-- <ant antfile="build/script.xml"/> -->
- <antcall target="buildlib">
- <param name="libname" value="system"/>
- <param name="antlibdir" value="${dist.syslibs.dir}"/>
- </antcall>
- <antcall target="buildlib">
- <param name="libname" value="monitor"/>
- <param name="antlibdir" value="${dist.syslibs.dir}"/>
- </antcall>
- <ant antfile="build/ant1compat.xml"/>
- </target>
-
- <target name="buildlib">
- <property name="antlib.build.dir" value="${bin.dir}/antlibs/${libname}"/>
- <property name="antlib.src.dir" value="${java.dir}/antlibs/${libname}"/>
- <mkdir dir="${antlib.build.dir}"/>
- <mkdir dir="${antlibdir}"/>
- <path id="classpath.antlibs">
- <path refid="classpath.common"/>
- <pathelement location="${dist.core.dir}/common/common.jar"/>
- </path>
- <depend destdir="${antlib.build.dir}" srcdir="${antlib.src.dir}" closure="yes">
- <classpath refid="classpath.antlibs"/>
- </depend>
- <javac destdir="${antlib.build.dir}" srcdir="${antlib.src.dir}" debug="${debug}">
- <classpath refid="classpath.antlibs"/>
- </javac>
- <jar basedir="${antlib.build.dir}" jarfile="${antlibdir}/${libname}.jar">
- <metainf dir="${antlib.src.dir}"
- includes="antlib.xml"/>
- </jar>
- </target>
-
-
- <target name="setup-bin">
- <mkdir dir="${dist.bin}"/>
- <copy todir="${dist.bin}">
- <fileset dir="${script.dir}/" />
- </copy>
-
- <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat" />
- <fixcrlf srcdir="${dist.bin}" eol="lf">
- <include name="mutant" />
- <include name="antRun" />
- <include name="*.pl" />
- </fixcrlf>
-
- <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
- failonerror="${chmod.fail}" />
- <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
- failonerror="${chmod.fail}" />
- <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
- <fileset dir="${dist.bin}">
- <include name="**/mutant" />
- <include name="**/antRun" />
- <include name="**/*.pl" />
- <include name="**/*.py" />
- </fileset>
- </chmod>
-
- </target>
-
- <target name="setup-conf">
- <mkdir dir="${dist.conf}"/>
- <copy todir="${dist.conf}">
- <fileset dir="${conf.dir}/" />
- </copy>
- </target>
-
-
- <target name="clean">
- <delete dir="${bin.dir}"/>
- <delete dir="${dist.dir}"/>
- </target>
-
- <target name="checkstyle" depends="buildsetup" if="checkstyle.available">
- <taskdef name="checkstyle"
- classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
- <mkdir dir="${bin.dir}/check"/>
- <checkstyle headerFile="../../src/etc/RequiredHeader.txt"
- headerIgnoreLine="4">
- <fileset dir="${java.dir}">
- <include name="**/*.java"/>
- <exclude name="**/org/apache/tools/ant/Task.java"/>
- <exclude name="**/org/apache/tools/ant/ProjectComponent.java"/>
- <exclude name="**/org/apache/tools/ant/types/DataType.java"/>
- <exclude name="**/builder/MutantBuilder.java"/>
- <exclude name="**/builder/Ant1CompatBuilder.java"/>
- </fileset>
- </checkstyle>
- <checkstyle allowProtected="true"
- headerFile="../../src/etc/RequiredHeader.txt"
- headerIgnoreLine="4">
- <fileset dir="${java.dir}">
- <include name="**/org/apache/tools/ant/Task.java"/>
- <include name="**/org/apache/tools/ant/ProjectComponent.java"/>
- <include name="**/org/apache/tools/ant/types/DataType.java"/>
- </fileset>
- </checkstyle>
- </target>
-
- <target name="javadocs">
- <mkdir dir="${javadocs.dir}"/>
- <javadoc packagenames="org.apache.*"
- useexternalfile="yes"
- sourcepath="${java.dir}/antcore:${java.dir}/init:${java.dir}/common:${java.dir}/frontend:${java.dir}/start"
- destdir="${javadocs.dir}"
- author="true"
- private ="true"
- version="true"
- windowtitle="Mutant API"
- doctitle="Mutant">
- <group title="Ant Library" packages="org.apache.ant.common.antlib*" />
- <group title="Services" packages="org.apache.ant.common.service*" />
- <group title="Common Facilities" packages="org.apache.ant.common*" />
- <group title="Core" packages="org.apache.ant.antcore*" />
- <group title="Initialisation" packages="org.apache.ant.init*,org.apache.ant.start*" />
- <group title="Command Line" packages="org.apache.ant.cli*" />
- <group title="Ant1 Compatability Layer" packages="org.apache.tools.ant*" />
- <tag name="created" description="Date Created:" scope="types"/>
- </javadoc>
- </target>
-
-
- <target name="test">
- <ant antfile="build/ant1compat.xml" target="test"/>
- </target>
-
- <target name="jars" depends="initjar, startjar, antcore, frontend, antlibs"/>
-
- <target name="dist-lite" depends="jars, setup-bin, setup-conf"/>
-
- <target name="dist" depends="dist-lite, javadocs"/>
-
- </project>
|