123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <project name="build-common" basedir="." default="...">
- <property name="javac.debug" value="true"/>
- <property name="javac.deprecation" value="false"/>
- <property file="${buildconfig.dir}/prerequisites.properties"/>
- <property file="${buildconfig.dir}/orionplaces.properties"/>
- <property name="coverage.tool" value="none"/>
- <import file="${buildconfig.dir}/build-coverage.${coverage.tool}.xml"/>
- <property name="checkstyle.xsl" location="${buildconfig.dir}/checkstyle-report.xsl"/>
- <property name="checkstyle.config" location="${buildconfig.dir}/checkstyle.xml"/>
- <!--
- Common source code and destination code structure
- -->
- <property name="src.main.java.dir" location="src/main/java"/>
- <property name="src.main.resources.dir" location="src/main/resources"/>
- <property name="src.test.java.dir" location="src/test/java"/>
- <property name="src.test.resources.dir" location="src/test/resources"/>
- <property name="build.dir" location="target"/>
- <property name="lib.dir" location="${build.dir}/lib"/>
- <property name="gsrc.dir" location="${build.dir}/java"/>
- <property name="dest.dir" location="${build.dir}/classes"/>
- <property name="depcache.dir" location="depcache"/>
- <property name="utresults.dir" location="utresults"/>
- <property name="checkstyle.output.dir" location="checkstyle.output"/>
- <property name="utdest.dir" location="${build.dir}/tests"/>
- <macrodef name="xjc-16">
- <attribute name="target"/>
- <attribute name="schema"/>
- <attribute name="package"/>
- <sequential>
- <exec executable="xjc">
- <arg value="-d"/>
- <arg value="@{target}"/>
- <!--
- <arg value="-b"/>
- <arg value="@{b}"/>
- -->
- <arg value="-p"/>
- <arg value="@{package}"/>
- <arg value="@{schema}"/>
- </exec>
- </sequential>
- </macrodef>
- <presetdef name="my.javac">
- <javac debug="${javac.debug}"
- deprecation="${javac.deprecation}"
- includes="**/*.java">
- <compilerarg value="-source"/>
- <compilerarg value="1.5"/>
- <!--<compilerarg value="-Xlint:unchecked"/>-->
- <!--<compilerarg value="-Xlint:deprecation"/>-->
- </javac>
- </presetdef>
- <target name="clean">
- <delete dir="${build.dir}"/>
- <delete dir="${lib.dir}"/>
- <delete dir="${utdest.dir}"/>
- <delete dir="${dest.dir}"/>
- <delete dir="${utresults.dir}"/>
- <delete dir="${checkstyle.output.dir}"/>
- <antcall target="clean.project"/>
- <antcall target="clean.${coverage.tool}"/>
- </target>
- <target name="init">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${lib.dir}"/>
- <mkdir dir="${utdest.dir}"/>
- <mkdir dir="${dest.dir}"/>
- <mkdir dir="${utresults.dir}"/>
- <mkdir dir="${checkstyle.output.dir}"/>
- <antcall target="init.project"/>
- <antcall target="init.${coverage.tool}"/>
- </target>
- <path id="tests.run.classpath.base">
- <pathelement location="${dest.dir}"/>
- <pathelement location="${utdest.dir}"/>
- <path refid="classpath.code"/>
- </path>
- <target name="tests.run">
- <antcall target="tests.before"/>
- <antcall target="tests.execute"/>
- <antcall target="tests.after"/>
- </target>
- <target name="tests.execute">
- <junit.orion fork="yes"
- printsummary="yes"
- haltonerror="no"
- haltonfailure="no">
- <classpath refid="tests.run.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml" if="junit.xml.needed"/>
- <batchtest todir="${utresults.dir}">
- <fileset dir="${utdest.dir}">
- <include name="**/Test*.class"/>
- </fileset>
- </batchtest>
- </junit.orion>
- </target>
- <target name="checkstyle">
- <taskdef resource="checkstyletask.properties"
- classpath="${checkstyle.home}/${checkstyle.jar}"/>
- <checkstyle config="${checkstyle.config}" failOnViolation="false">
- <fileset dir="${src.main.java.dir}">
- <include name="**/*.java"/>
- </fileset>
- <formatter type="xml" toFile="${checkstyle.output.dir}/checkstyle_errors.xml"/>
- </checkstyle>
- <style in="${checkstyle.output.dir}/checkstyle_errors.xml"
- out="${checkstyle.output.dir}/checkstyle_errors.html"
- style="${checkstyle.xsl}"/>
- </target>
- </project>
|