blob: 8740772caf336370005a3dfd627c4e466da2c5d8 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="build-common-new" default="jar"
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:artifact="artifact:org.apache.maven.artifact.ant">
<loadproperties srcfile="${path.to.basedir}/build.properties"/>
<loadproperties srcfile="${path.to.basedir}/ivy/libraries.properties"/>
<import file="${path.to.basedir}/ant/dependencies.xml"/>
<import file="${path.to.basedir}/ant/deploy.xml"/>
<import file="${path.to.basedir}/ant/findbugs.xml"/>
<import file="${path.to.basedir}/ant/test.xml"/>
<macrodef name="_javac">
<attribute name="srcDir"/>
<attribute name="destDir"/>
<attribute name="classPathRef"/>
<sequential>
<mkdir dir="@{destDir}"/>
<javac
fork="true"
deprecation="false"
sourcepath=""
includes="**/*.java"
debug="${javac.debug}"
encoding="utf-8"
srcdir="@{srcDir}"
destdir="@{destDir}"
classpathref="@{classPathRef}"
includeantruntime="false"/>
</sequential>
</macrodef>
<target name="clean">
<echo message="${ant.project.name}"/>
<delete dir="${build.dir}"/>
</target>
<target name="compile" depends="ivy-retrieve">
<echo message="${ant.project.name}"/>
<_javac srcDir="${basedir}/src/main/java"
destDir="${build.classes}"
classPathRef="compile.class.path"/>
</target>
<target name="compile-test" depends="jar">
<echo message="${ant.project.name}"/>
<_javac srcDir="${basedir}/src/test/java"
destDir="${test.classes}"
classPathRef="test.class.path"/>
</target>
<target name="test" depends="jar, compile-test">
<echo message="${ant.project.name}"/>
<_junit srcDir="${basedir}/src/test/java"/>
</target>
<target name="jar" depends="compile,mvn-init">
<echo message="${ant.project.name}"/>
<jar jarfile="${build.dir}/${jar.name}" basedir="${build.classes}"/>
<artifact:install file="${build.dir}/${ant.project.name}-${hcatalog.version}.jar">
<artifact:pom file="${build.dir}/ivy/${ant.project.name}-${hcatalog.version}.pom"/>
</artifact:install>
</target>
<target name="findbugs" depends="init-findbugs,jar">
<echo message="${ant.project.name}"/>
<_findbugs outputDir="${findbugs.out.dir}"
outputFile="${findbugs.report.xmlfile}"
excludeFilter="${findbugs.exclude.file}"
findbugsReportXmlFile="${findbugs.report.xmlfile}"
findbugsReportHtmlFile="${findbugs.report.htmlfile}"
sourceDir="${basedir}/src/main/java"
jarDir="${build.dir}"
classPathRef="findbugs.class.path"/>
</target>
</project>