blob: ec6840804a6c731beac237e1c2c1424aa0073bd1 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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="hive" default="jar"
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:artifact="urn:maven-artifact-ant"
xmlns:rat="antlib:org.apache.rat.anttasks" >
<property name="hive.root" location="${basedir}"/>
<property file="${hive.root}/build.properties"/>
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
<loadproperties srcfile="${ivy.conf.dir}/libraries.properties"/>
<property environment="env"/>
<property name="target.dir" location="${build.dir.hive}/dist"/>
<property name="target.lib.dir" location="${target.dir}/lib"/>
<property name="target.conf.dir" location="${target.dir}/conf"/>
<property name="target.bin.dir" location="${target.dir}/bin"/>
<property name="target.scripts.dir" location="${target.dir}/scripts"/>
<property name="target.example.dir" location="${target.dir}/examples"/>
<property name="ql.test.query.dir" location="${basedir}/ql/src/test/queries"/>
<property name="test.data.dir" location="${basedir}/data"/>
<property name="test.build.dir" value="${build.dir.hive}/test"/>
<property name="test.continue.on.failure" value="true"/>
<property name="build.docs" value="${target.dir}/docs"/>
<property name="build.javadoc" value="${build.docs}/api"/>
<property name="docs.src" value="${hive.root}/docs"/>
<property name="anakia.docs.src" value="${docs.src}/xdocs"/>
<property name="anakia.docs.dest" value="${target.dir}/docs"/>
<property name="images.src" value="${docs.src}/images"/>
<property name="javadoc.link.java"
value="http://java.sun.com/javase/6/docs/api/"/>
<property name="final.name" value="${name}-${version}"/>
<property name="tar.final.name" value="${final.name}"/>
<property name="bin.final.name" value="${final.name}-bin"/>
<property name="vcs.excludes" value="**/.svn,**/.svn/**,**/.git,**/.git/**"/>
<property name="checkstyle.conf.dir" location="${hive.root}/checkstyle"/>
<property name="checkstyle.build.dir" location="${build.dir.hive}/checkstyle"/>
<property name="rat.build.dir" location="${build.dir.hive}/rat"/>
<property name="md5sum.format" value="{0} {1}"/>
<!-- Ignore Postgres upgrade scripts unless 'include.postgres' is true -->
<condition property="metastore.excludes"
value="${vcs.excludes}" else="${vcs.excludes},**/postgres/**">
<istrue value="${include.postgres}"/>
</condition>
<condition property="is-offline" value="true" else="false">
<isset property="offline"/>
</condition>
<import file="build-offline.xml"/>
<condition property="staging">
<equals arg1="${mvn.publish.repo}" arg2="staging"/>
</condition>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${hive.root}/testlibs/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- ForTask is not defined in net/sf/antcontrib/antcontrib.properties! -->
<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask">
<classpath>
<pathelement location="${hive.root}/testlibs/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- ====================================================== -->
<!-- Macro definitions -->
<!-- ====================================================== -->
<macrodef name="macro_tar" description="Worker Macro for tar">
<attribute name="param.destfile"/>
<element name="param.listofitems"/>
<sequential>
<tar compression="gzip" longfile="gnu" destfile="@{param.destfile}">
<param.listofitems/>
</tar>
<checksum file="@{param.destfile}" algorithm="md5" pattern="${md5sum.format}"/>
</sequential>
</macrodef>
<macrodef name="iterate-cpp">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<property name="thrift.home" value="${thrift.home}"/>
<property name="build.dir.hive" location="${build.dir.hive}"/>
<!-- TODO filelist dir="." files="metastore/build.xml,serde/build.xml,service/build.xml,odbc/build.xml"/-->
<filelist dir="." files="odbc/build.xml"/>
</subant>
</sequential>
</macrodef>
<macrodef name="iterate-test">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<property name="thrift.home" value="${thrift.home}"/>
<property name="build.dir.hive" location="${build.dir.hive}"/>
<filelist dir="." files="ql/build.xml,contrib/build.xml,hbase-handler/build.xml,hwi/build.xml,jdbc/build.xml,metastore/build.xml,odbc/build.xml,serde/build.xml,service/build.xml"/>
</subant>
</sequential>
</macrodef>
<macrodef name="iterate-thriftif">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<property name="thrift.home" value="${thrift.home}"/>
<property name="build.dir.hive" location="${build.dir.hive}"/>
<filelist dir="." files="ql/build.xml,service/build.xml,metastore/build.xml,serde/build.xml"/>
</subant>
</sequential>
</macrodef>
<macrodef name="iterate-all">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<property name="build.dir.hive" location="${build.dir.hive}"/>
<property name="is-offline" value="${is-offline}"/>
<filelist dir="." files="ant/build.xml,shims/build.xml,common/build.xml,serde/build.xml,metastore/build.xml,ql/build.xml,contrib/build.xml,service/build.xml,cli/build.xml,jdbc/build.xml,hwi/build.xml,hbase-handler/build.xml,ant/build.xml,pdk/build.xml,builtins/build.xml"/>
</subant>
</sequential>
</macrodef>
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<property name="build.dir.hive" location="${build.dir.hive}"/>
<property name="is-offline" value="${is-offline}"/>
<filelist dir="." files="shims/build.xml,common/build.xml,serde/build.xml,metastore/build.xml,ql/build.xml,contrib/build.xml,service/build.xml,cli/build.xml,jdbc/build.xml,hwi/build.xml,hbase-handler/build.xml,pdk/build.xml,builtins/build.xml"/>
</subant>
</sequential>
</macrodef>
<!-- the normal classpath -->
<path id="common-classpath">
<pathelement location="${hadoop.oldstyle-name.jar}"/>
<pathelement location="${hadoop.newstyle-name.jar}"/>
<pathelement location="${hadoop.common.jar}"/>
<pathelement location="${hadoop.hdfs.jar}"/>
<pathelement location="${hadoop.mapreduce.jar}"/>
<pathelement location="${build.dir.hive}/classes"/>
<fileset dir="${hive.root}" includes="hive-*.jar"/>
<fileset dir="${hive.root}/lib" includes="*.jar"/>
<fileset dir="${build.dir.hive}/ivy/lib/default" includes="*.jar"
excludes="*hadoop*.jar" erroronmissingdir="false"/>
</path>
<path id="classpath">
<pathelement location="${build.dir.hive}/common/classes"/>
<pathelement location="${build.dir.hive}/serde/classes"/>
<pathelement location="${build.dir.hive}/metastore/classes"/>
<pathelement location="${build.dir.hive}/ql/classes"/>
<pathelement location="${build.dir.hive}/cli/classes"/>
<fileset dir="${hive.root}/data" includes="files/*.jar"/>
<fileset dir="${hive.root}/ql" includes="lib/*.jar"/>
<fileset dir="${hive.root}/cli" includes="lib/*.jar"/>
<fileset dir="${hive.root}/service" includes="lib/*.jar"/>
<path refid="common-classpath"/>
</path>
<target name="ivy-init-settings">
<!--Configure Ivy by reading in the settings file
If anyone has already read in a settings file into this settings ID, it gets priority
-->
<echo message="Project: ${ant.project.name}"/>
<ivy:settings id="${ant.project.name}.ivy.settings" file="${ivysettings.xml}"/>
</target>
<target name="ivy-init-dirs">
<echo message="Project: ${ant.project.name}"/>
<mkdir dir="${build.ivy.dir}" />
<mkdir dir="${build.ivy.lib.dir}" />
<mkdir dir="${build.ivy.report.dir}" />
<mkdir dir="${build.ivy.maven.dir}" />
</target>
<target name="ivy-probe-antlib" >
<echo message="Project: ${ant.project.name}"/>
<condition property="ivy.found">
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
</condition>
</target>
<target name="ivy-download" depends="ivy-init-dirs"
description="To download ivy" unless="offline">
<echo message="Project: ${ant.project.name}"/>
<get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
</target>
<!--
To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
Also note how we skip loading Ivy if it is already there, just to make sure all is well.
-->
<target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
<echo message="Project: ${ant.project.name}"/>
<typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderRef="ivyLoader">
<classpath>
<pathelement location="${ivy.jar}"/>
</classpath>
</typedef>
<fail>
<condition>
<not>
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
</not>
</condition>
You need Apache Ivy 2.1 or later from http://ant.apache.org/
It could not be loaded from ${ivy_repo_url}
</fail>
</target>
<target name="ivy-clean-cache" depends="ivy-init-antlib"
description="Clean the Ivy cache">
<ivy:cleancache />
</target>
<target name="init" depends="ivy-init-antlib,deploy-ant-tasks">
<echo message="Project: ${ant.project.name}"/>
<iterate-all target="init"/>
</target>
<target name="test-init">
<echo message="Project: ${ant.project.name}"/>
<iterate-all target="test-init"/>
</target>
<!-- target to deploy anttasks -->
<target name="compile-ant-tasks">
<echo message="Project: ${ant.project.name}"/>
<subant target="compile">
<fileset dir="." includes="ant/build.xml"/>
</subant>
</target>
<target name="deploy-ant-tasks" depends="compile-ant-tasks">
<echo message="Project: ${ant.project.name}"/>
<subant target="jar">
<fileset dir="." includes="ant/build.xml"/>
</subant>
<taskdef name="getversionpref" classname="org.apache.hadoop.hive.ant.GetVersionPref"
classpath="${build.dir.hive}/anttasks/hive-anttasks-${version}.jar"/>
</target>
<target name="compile-cpp"
depends="init"
description="Build CPP artifacts" >
<echo message="Project: ${ant.project.name}"/>
<fail unless="thrift.home">
You must set thrift.home to the absolute path of your
local Thrift installation.
</fail>
<iterate-cpp target="compile-cpp"/>
</target>
<target name="compile-cpp-clean"
description="Clean CPP artifacts">
<echo message="Project: ${ant.project.name}"/>
<iterate-cpp target="clean"/>
</target>
<target name="compile" depends="compile-cpp">
<echo message="Project: ${ant.project.name}"/>
<iterate target="compile"/>
</target>
<target name="thriftif">
<echo message="Project: ${ant.project.name}"/>
<iterate-thriftif target="thriftif"/>
</target>
<target name="jar"
depends="init"
description="Build JAR artifacts">
<echo message="Project: ${ant.project.name}"/>
<iterate target="jar"/>
</target>
<target name="gen-test" depends="jar" description="Generate tests">
<iterate-test target="gen-test"/>
</target>
<target name="jar-test" depends="gen-test"
description="Build Java test artifacts">
<echo message="Project: ${ant.project.name}"/>
<iterate-test target="compile-test"/>
</target>
<target name="test" depends="clean-test,jar-test" description="Run tests">
<echo message="Project: ${ant.project.name}"/>
<antcall target="test-shims">
<param name="hadoop.version.ant-internal" value="${hadoop.security.version}" />
</antcall>
<for keepgoing="${test.continue.on.failure}" param="file">
<path>
<fileset dir="." includes="*/build.xml" excludes="ant/*,odbc/*,shims/*"/>
</path>
<sequential>
<ant antfile="@{file}" target="test" inheritAll="false" inheritRefs="true">
<property name="build.dir.hive" location="${build.dir.hive}"/>
<property name="is-offline" value="${is-offline}"/>
</ant>
</sequential>
</for>
</target>
<target name="test-shims">
<echo message="Project: ${ant.project.name}"/>
<subant target="test" failonerror="${failonerror}">
<property name="hadoop.version" value="${hadoop.security.version}"/>
<property name="hadoop.security.version" value="${hadoop.security.version}"/>
<fileset dir="${hive.root}/shims" includes="build.xml"/>
</subant>
</target>
<!-- create an html report from junit output files -->
<target name="testreport"
description="Generate JUnit HTML test report">
<echo message="Project: ${ant.project.name}"/>
<mkdir dir="${test.build.dir}"/>
<junitreport todir="${test.build.dir}">
<fileset dir="${build.dir.hive}">
<include name="**/TEST-*.xml"/>
</fileset>
<report format="noframes" todir="${test.build.dir}"/>
</junitreport>
</target>
<target name="clean-test"
description="Clean test results">
<echo message="Project: ${ant.project.name}"/>
<iterate target="clean-test"/>
<delete dir="${build.dir.hive}/test"/>
<delete dir="${hive.root}/ql/TempStatsStore"/>
</target>
<target name="clean"
description="Clean build artifacts">
<echo message="Project: ${ant.project.name}"/>
<iterate-all target="clean"/>
<iterate-cpp target="clean"/>
<delete dir="${target.dir}"/>
<antcall target="clean-online"/>
<antcall target="clean-offline"/>
</target>
<target name="clean-online" unless="offline">
<echo message="Project: ${ant.project.name}"/>
<delete dir="${build.dir.hive}"/>
</target>
<target name="clean-offline" if="offline">
<echo message="Project: ${ant.project.name}"/>
<!-- preserve the downloaded ivy .jar -->
<delete quiet="true" includeemptydirs="true">
<fileset dir="${build.dir.hive}" excludes="ivy/**/ivy*.jar"/>
</delete>
</target>
<target name="very-clean" unless="offline" depends="clean,ivy-clean-cache"
description="Clean build artifacts and flush Ivy cache" />
<target name="package-cpp"
depends="package,compile-cpp"
description="Deploy CPP artifacts">
<echo message="Project: ${ant.project.name}"/>
<mkdir dir="${target.dir}/include"/>
<copy todir="${target.dir}/include" preservelastmodified="true" flatten="true">
<fileset file="${build.dir.hive}/odbc/include/*"/>
</copy>
<copy todir="${target.lib.dir}" preservelastmodified="true" flatten="true">
<fileset file="${build.dir.hive}/odbc/lib/*" excludes="*.so"/>
</copy>
<symlink link="${target.lib.dir}/libhiveclient.so" resource="libhiveclient.so.1.0.0"/>
</target>
<target name="package"
depends="jar"
description="Deploy JAR artifacts">
<echo message="Project: ${ant.project.name}"/>
<echo message="Deploying Hive jars to ${target.dir}"/>
<mkdir dir="${target.dir}"/>
<mkdir dir="${target.lib.dir}"/>
<mkdir dir="${target.conf.dir}"/>
<mkdir dir="${target.bin.dir}"/>
<mkdir dir="${target.scripts.dir}/metastore/upgrade"/>
<mkdir dir="${target.scripts.dir}/pdk"/>
<mkdir dir="${target.example.dir}"/>
<mkdir dir="${target.example.dir}/files"/>
<mkdir dir="${target.example.dir}/queries"/>
<mkdir dir="${target.lib.dir}/py"/>
<mkdir dir="${target.lib.dir}/php"/>
<copy file="${hive.root}/bin/hive" todir="${target.bin.dir}"/>
<copy file="${hive.root}/bin/metatool" todir="${target.bin.dir}"/>
<echo message="metastore.excludes = ${metastore.excludes}"/>
<copy todir="${target.scripts.dir}/metastore/upgrade">
<fileset dir="${hive.root}/metastore/scripts/upgrade" excludes="${metastore.excludes}"/>
</copy>
<copy todir="${target.scripts.dir}/pdk">
<fileset dir="${hive.root}/pdk/scripts" excludes="${vcs.excludes},README"/>
</copy>
<copy todir="${target.bin.dir}/ext">
<fileset dir="${hive.root}/bin/ext" excludes="${vcs.excludes}"/>
</copy>
<copy file="${hive.root}/bin/hive-config.sh" todir="${target.bin.dir}"/>
<copy file="${basedir}/conf/hive-default.xml.template" todir="${target.conf.dir}">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<copy todir="${target.conf.dir}">
<fileset dir="${basedir}/conf">
<include name="*.template"/>
</fileset>
</copy>
<copy file="${basedir}/common/src/java/conf/hive-log4j.properties"
tofile="${target.conf.dir}/hive-log4j.properties.template"/>
<copy file="${basedir}/ql/src/java/conf/hive-exec-log4j.properties"
tofile="${target.conf.dir}/hive-exec-log4j.properties.template"/>
<!-- Create php thrift package -->
<copy todir="${target.lib.dir}/php">
<fileset dir="${hive.root}/service/lib/php" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/php/packages/serde">
<fileset dir="${hive.root}/serde/src/gen/thrift/gen-php" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/php/packages/hive_metastore">
<fileset dir="${hive.root}/metastore/src/gen/thrift/gen-php" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/php/packages/hive_service">
<fileset dir="${hive.root}/service/src/gen/thrift/gen-php" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/php/packages/queryplan">
<fileset dir="${hive.root}/ql/src/gen/thrift/gen-php" excludes="${vcs.excludes}"/>
</copy>
<!-- Create the python thrift package -->
<copy todir="${target.lib.dir}/py">
<fileset dir="${hive.root}/service/lib/py" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/py/hive_serde">
<fileset dir="${hive.root}/serde/src/gen/thrift/gen-py/org_apache_hadoop_hive_serde" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/py/hive_metastore">
<fileset dir="${hive.root}/metastore/src/gen/thrift/gen-py/hive_metastore" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/py/hive_service">
<fileset dir="${hive.root}/service/src/gen/thrift/gen-py/hive_service" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.lib.dir}/py/queryplan">
<fileset dir="${hive.root}/ql/src/gen/thrift/gen-py/queryplan" excludes="${vcs.excludes}"/>
</copy>
<!-- copy jar files -->
<copy todir="${target.lib.dir}" preservelastmodified="true" flatten="true">
<fileset dir="${hive.root}" >
<include name="*/*.jar"/>
<include name="*/*/*.jar"/>
<exclude name="**/TestSerDe.jar"/>
<exclude name="build/hadoopcore/*.jar"/>
<exclude name="**/ant-contrib*.jar"/>
<exclude name="**/hive-anttasks*.jar"/>
</fileset>
<fileset file="${build.dir.hive}/cli/hive-cli-${version}.jar"/>
<fileset file="${build.dir.hive}/common/hive-common-${version}.jar"/>
<fileset file="${build.dir.hive}/ql/hive-exec-${version}.jar"/>
<fileset file="${build.dir.hive}/metastore/hive-metastore-${version}.jar"/>
<fileset file="${build.dir.hive}/hwi/hive-hwi-${version}.war"/>
<fileset file="${build.dir.hive}/contrib/hive-contrib-${version}.jar"/>
<fileset file="${build.dir.hive}/contrib/hive-hbase_handler-${version}.jar"/>
<fileset dir="${build.dir.hive}/ivy/lib/default">
<include name="*.jar"/>
<exclude name="*.tar.gz"/>
<exclude name="hadoop-*.jar" />
<exclude name="**/*high-scale-lib-*"/>
<exclude name="**/hamcrest-core-*jar"/>
<exclude name="**/junit*.jar"/>
<exclude name="**/asm*.jar"/>
<exclude name="**/mockito*.jar"/>
<exclude name="**/velocity*.jar"/>
<exclude name="**/antlr-3*.jar"/>
</fileset>
</copy>
<copy todir="${target.example.dir}/files" preservelastmodified="true" flatten="true">
<fileset dir="${test.data.dir}/files" includes="*.*" excludes="${vcs.excludes}"/>
</copy>
<copy todir="${target.example.dir}/test-plugin">
<fileset dir="${hive.root}/pdk/test-plugin"/>
</copy>
<copy file="${basedir}/README.txt" todir="${target.dir}">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<copy file="${basedir}/NOTICE" todir="${target.dir}"/>
<copy file="${basedir}/LICENSE" todir="${target.dir}"/>
<copy file="${basedir}/RELEASE_NOTES.txt" todir="${target.dir}"/>
<copy todir="${target.example.dir}/queries" preservelastmodified="true" flatten="true">
<fileset dir="${ql.test.query.dir}/positive" includes="*.q" excludes="${vcs.excludes}"/>
</copy>
<chmod perm="ugo+x" type="file" parallel="false">
<fileset dir="${target.bin.dir}"/>
</chmod>
<!-- special case because builtins compilation depends on packaging
up everything else first -->
<ant antfile="${hive.root}/builtins/build.xml" target="package"
inheritAll="false" />
<copy todir="${target.lib.dir}" preservelastmodified="true" flatten="true">
<fileset file="${build.dir.hive}/builtins/hive-builtins-${version}.jar"/>
</copy>
</target>
<!-- ====================================================== -->
<!-- Generate files for eclipse. -->
<!-- ====================================================== -->
<target name="eclipse-files" depends="gen-test"
description="Generate files for Eclipse">
<echo message="Project: ${ant.project.name}"/>
<condition property="hadoop.version.ant-internal" value="0.20">
<not>
<isset property="hadoop.version.ant-internal"/>
</not>
</condition>
<echo message="Using hadoop version ${hadoop.version.ant-internal}"/>
<taskdef name="getversionpref" classname="org.apache.hadoop.hive.ant.GetVersionPref"
classpath="${build.dir.hive}/anttasks/hive-anttasks-${version}.jar"/>
<getversionpref property="hadoop.version.ant-internal.prefix" input="${hadoop.version.ant-internal}"/>
<condition property="jetty.jar" value="jetty-6.1.14.jar" else="jetty-5.1.4.jar">
<matches string="${hadoop.version.ant-internal}" pattern="^0\.20\..*" />
</condition>
<condition property="jetty.util.jar" value="jetty-util-6.1.14.jar" else="jetty-ext/jsp-api.jar">
<!-- hadoop 0.19 and earlier does not have jetty-util.jar, so we just load another jar -->
<matches string="${hadoop.version.ant-internal}" pattern="^0\.20\..*" />
</condition>
<condition property="servlet-api.jar" value="servlet-api-2.5-6.1.14.jar" else="servlet-api.jar">
<matches string="${hadoop.version.ant-internal}" pattern="^0\.20\..*" />
</condition>
<!-- Construct the classpath needed for testutils/hadoop launch script -->
<path id="hive.hadoop.test.classpath">
<fileset dir="${hive.root}/build/ivy/lib/hadoop0.${hadoop.mr.rev}.shim" includes="*.jar" />
<fileset dir="${hive.root}/build/ivy/lib/default" includes="*.jar" excludes="hive*.jar" />
</path>
<property name="hive.hadoop.test.classpath" refid="hive.hadoop.test.classpath"/>
<pathconvert property="eclipse.project">
<path path="${basedir}"/>
<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/>
</pathconvert>
<copy todir="." overwrite="true">
<fileset dir="eclipse-templates">
<exclude name="**/README.txt"/>
<exclude name="${vcs.excludes}"/>
</fileset>
<filterset>
<filtersfile file="${hive.root}/ivy/libraries.properties"/>
<filter token="PROJECT" value="${eclipse.project}"/>
<filter token="HADOOPVER" value="${hadoop.version.ant-internal}"/>
<filter token="HADOOPVERPREF" value="${hadoop.version.ant-internal.prefix}"/>
<filter token="JETTYJAR" value="${jetty.jar}"/>
<filter token="JETTYUTILJAR" value="${jetty.util.jar}"/>
<filter token="SERVLETAPIJAR" value="${servlet-api.jar}"/>
<filter token="HIVE_VERSION" value="${version}"/>
<filter token="HIVE_HADOOP_TEST_CLASSPATH" value="${hive.hadoop.test.classpath}"/>
<filter token="HADOOP_BIN_PATH" value="${hive.root}/testutils/hadoop"/>
<filter token="JVM_ARGS" value="${eclipse.launch.jvm.args}"/>
</filterset>
</copy>
<move todir="." includeemptydirs="false">
<fileset dir=".">
<include name="*.launchtemplate"/>
</fileset>
<mapper type="glob" from="*.launchtemplate" to="*.launch"/>
</move>
</target>
<target name="clean-eclipse-files"
description="Delete files for Eclipse">
<echo message="Project: ${ant.project.name}"/>
<delete includeemptydirs="true">
<fileset dir="." includes=".classpath .project .settings/ .externalToolBuilders/"/>
</delete>
</target>
<!-- ====================================================== -->
<!-- Get Arc-JIRA library. -->
<!-- ====================================================== -->
<target name="arc-setup" description="Get Arc-JIRA library" depends="init">
<get
dest="${build.dir.hive}/arc-jira.tar.gz"
src="https://github.com/facebook/arc-jira/tarball/master"/>
<untar src="${build.dir.hive}/arc-jira.tar.gz" compression="gzip"
dest="${build.dir.hive}">
<patternset>
<include name="facebook-arc-jira-*/arc_jira_lib/**"/>
</patternset>
</untar>
<move todir="${hive.root}">
<fileset dir="${build.dir.hive}">
<include name="facebook-arc-jira-*/arc_jira_lib/**"/>
</fileset>
<mapper type="regexp" from="^facebook-arc-jira-([^/])*/(.*)" to="\.\2"/>
</move>
<delete includeemptydirs="true">
<fileset dir="${build.dir.hive}">
<include name="facebook-arc-jira-*"/>
<include name="arc-jira.tar.gz"/>
</fileset>
</delete>
</target>
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
<target name="docs" description="Generate documentation" depends="ivy-init-antlib">
<echo message="Project: ${ant.project.name}"/>
<antcall target="docs-anakia"/>
</target>
<target name="javadoc" depends="package" description="Generate Javadoc">
<echo message="Project: ${ant.project.name}"/>
<mkdir dir="${build.javadoc}"/>
<javadoc
maxmemory="1024m"
packagenames="org.apache.hadoop.hive.*"
destdir="${build.javadoc}"
author="true"
version="true"
use="true"
windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API"
bottom="Copyright &amp;copy; ${year} The Apache Software Foundation"
>
<packageset dir="ant/src"/>
<packageset dir="hwi/src/java"/>
<packageset dir="hwi/src/test"/>
<packageset dir="common/src/java"/>
<packageset dir="service/src/java"/>
<packageset dir="service/src/test"/>
<packageset dir="service/src/gen/thrift/gen-javabean"/>
<packageset dir="serde/src/java"/>
<packageset dir="serde/src/test"/>
<packageset dir="serde/src/gen/thrift/gen-javabean"/>
<packageset dir="serde/src/gen/protobuf/gen-java"/>
<packageset dir="jdbc/src/java"/>
<packageset dir="jdbc/src/test"/>
<packageset dir="metastore/src/java"/>
<packageset dir="metastore/src/test"/>
<packageset dir="metastore/src/gen/thrift/gen-javabean"/>
<packageset dir="metastore/src/model"/>
<packageset dir="cli/src/java"/>
<packageset dir="ql/src/java"/>
<packageset dir="ql/src/test"/>
<packageset dir="ql/src/gen/thrift/gen-javabean"/>
<packageset dir="${build.dir.hive}/ql/gen/antlr/gen-java"/>
<packageset dir="shims/src/common/java"/>
<packageset dir="pdk/src/java"/>
<packageset dir="builtins/src"/>
<link href="${javadoc.link.java}"/>
<classpath >
<path refid="classpath" />
<pathelement path="${java.class.path}"/>
<pathelement
path="${build.ivy.lib.dir}/default/hadoop-core-${hadoop-0.20.version}.jar"/>
<pathelement
path="${build.ivy.lib.dir}/default/hadoop-test-${hadoop-0.20.version}.jar"/>
</classpath>
<group title="Hive" packages="org.apache.*"/>
</javadoc>
</target>
<!-- ================================================================== -->
<!-- Make release tarball -->
<!-- ================================================================== -->
<target name="tar" depends="package, docs, javadoc" description="Make release tarball">
<echo message="Project: ${ant.project.name}"/>
<macro_tar param.destfile="${build.dir.hive}/${tar.final.name}.tar.gz">
<param.listofitems>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${tar.final.name}"
excludes="${vcs.excludes}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${tar.final.name}"
excludes="${vcs.excludes}">
<include name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="664" prefix="${tar.final.name}"
excludes="${vcs.excludes}">
<include name="**"/>
<exclude name="bin/**"/>
<exclude name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${hive.root}" mode="664" prefix="${tar.final.name}/src"
excludes="${vcs.excludes}">
<exclude name="build/**" />
<exclude name="bin/**" />
<exclude name="**/py/**/*-remote" />
<exclude name="data/scripts/**" />
<exclude name="metastore/scripts/**" />
<exclude name="ql/src/test/scripts/**" />
</tarfileset>
<tarfileset dir="${hive.root}" mode="755" prefix="${tar.final.name}/src"
excludes="${vcs.excludes}">
<exclude name="build/**" />
<include name="bin/**" />
<include name="**/py/**/*-remote" />
<include name="data/scripts/**" />
<include name="metastore/scripts/**" />
<include name="ql/src/test/scripts/**" />
</tarfileset>
</param.listofitems>
</macro_tar>
</target>
<target name="binary" depends="package, docs, javadoc"
description="Make release tarball without source and documentation">
<echo message="Project: ${ant.project.name}"/>
<macro_tar param.destfile="${build.dir.hive}/${bin.final.name}.tar.gz">
<param.listofitems>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${bin.final.name}"
excludes="${vcs.excludes}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${bin.final.name}"
excludes="${vcs.excludes}">
<include name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="664" prefix="${bin.final.name}"
excludes="${vcs.excludes}">
<include name="**"/>
<exclude name="bin/**"/>
<exclude name="docs/**"/>
<exclude name="lib/py/**/*-remote"/>
</tarfileset>
</param.listofitems>
</macro_tar>
</target>
<!-- ================================================================== -->
<!-- RAT -->
<!-- ================================================================== -->
<target name="ivy-resolve-rat" depends="ivy-init-settings">
<echo message="Project: ${ant.project.name}"/>
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="rat"
log="${ivyresolvelog}"/>
</target>
<target name="ivy-retrieve-rat" depends="ivy-resolve-rat"
description="Retrieve Ivy-managed artifacts for RAT">
<echo message="Project: ${ant.project.name}"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
log="${ivyresolvelog}"/>
<ivy:cachepath pathid="rat-classpath" conf="rat"/>
</target>
<target name="rat" depends="init,ivy-retrieve-rat,check-for-rat"
if="rat.present"
description="Run RAT on source files">
<echo message="Project: ${ant.project.name}"/>
<taskdef uri="antlib:org.apache.rat.anttasks"
resource="org/apache/rat/anttasks/antlib.xml">
<classpath refid="rat-classpath"/>
</taskdef>
<mkdir dir="${rat.build.dir}"/>
<rat:report reportFile="${rat.build.dir}/hive-rat.txt">
<fileset dir=".">
<patternset id="non.build.files">
<exclude name="**/build/**"/>
<exclude name="**/src/gen/**"/>
<exclude name=".arcconfig*"/>
<exclude name=".arc_jira_lib/**"/>
<exclude name="**/*.deflate"/>
<exclude name="**/*.m"/>
<exclude name="**/*.m.out"/>
<exclude name="**/*.q"/>
<exclude name="**/*.q.out"/>
<exclude name="data/files/*.rc"/>
<exclude name="**/test/data/**/*.rc"/>
<exclude name="data/files/*.seq"/>
<exclude name="**/data/files/*.log"/>
<exclude name="**/*.txt"/>
<exclude name="**/test/results/**/*.out"/>
<exclude name="**/test/results/**/*.xml"/>
<exclude name="**/testdata/*.input"/>
<!-- Ignore recordio generated file -->
<exclude name="ql/src/test/org/apache/hadoop/hive/ql/io/RecordTestObj.java"/>
<!-- Ignore thrift generated files -->
<exclude name="service/lib/php/packages/fb303/FacebookService.php"/>
<exclude name="service/lib/php/packages/fb303/fb303_types.php"/>
<exclude name="service/lib/py/fb303/FacebookService-remote"/>
<exclude name="service/lib/py/fb303/FacebookService.py"/>
<exclude name="service/lib/py/fb303/constants.py"/>
<exclude name="service/lib/py/fb303/ttypes.py"/>
<exclude name="service/lib/py/thrift/reflection/limited/constants.py"/>
<exclude name="service/lib/py/thrift/reflection/limited/ttypes.py"/>
</patternset>
</fileset>
</rat:report>
</target>
<target name="check-for-rat">
<echo message="Project: ${ant.project.name}"/>
<available property="rat.present"
resource="org/apache/rat/anttasks/antlib.xml">
<classpath refid="rat-classpath"/>
</available>
</target>
<!-- ================================================================== -->
<!-- Checkstyle -->
<!-- ================================================================== -->
<target name="ivy-resolve-checkstyle" depends="ivy-init-settings">
<echo message="Project: ${ant.project.name}"/>
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle"
log="${ivyresolvelog}"/>
</target>
<target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle"
description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
<echo message="Project: ${ant.project.name}"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
log="${ivyresolvelog}"/>
<ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle"/>
</target>
<target name="checkstyle" depends="init,ivy-retrieve-checkstyle,check-for-checkstyle"
if="checkstyle.present"
description="Run Checkstyle on source files">
<echo message="Project: ${ant.project.name}"/>
<taskdef resource="checkstyletask.properties">
<classpath refid="checkstyle-classpath"/>
</taskdef>
<mkdir dir="${checkstyle.build.dir}"/>
<checkstyle config="${checkstyle.conf.dir}/checkstyle.xml"
failOnViolation="false">
<fileset dir="${hive.root}">
<exclude name="build/**"/>
<exclude name="ant/**"/>
<include name="**/*.java"/>
</fileset>
<formatter type="plain" toFile="${checkstyle.build.dir}/checkstyle-errors.txt"/>
<formatter type="xml" toFile="${checkstyle.build.dir}/checkstyle-errors.xml"/>
</checkstyle>
<xslt style="${checkstyle.conf.dir}/checkstyle-noframes-sorted.xsl"
in="${checkstyle.build.dir}/checkstyle-errors.xml"
out="${checkstyle.build.dir}/checkstyle-errors.html"/>
</target>
<target name="check-for-checkstyle">
<echo message="Project: ${ant.project.name}"/>
<available property="checkstyle.present" resource="checkstyletask.properties">
<classpath refid="checkstyle-classpath"/>
</available>
</target>
<!-- ================================================================== -->
<!-- Findbugs -->
<!-- ================================================================== -->
<target name="ivy-resolve-findbugs" depends="ivy-init-settings">
<echo message="Project: ${ant.project.name}" />
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="findbugs" log="${ivyresolvelog}" />
</target>
<property name="ivy.findbugs.retrieve.pattern" value="[conf]/[artifact].[ext]" />
<target name="ivy-retrieve-findbugs" depends="ivy-resolve-findbugs" description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
<echo message="Project: ${ant.project.name}" />
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.findbugs.retrieve.pattern}" log="${ivyresolvelog}" />
</target>
<target name="check-for-findbugs">
<echo message="Project: ${ant.project.name}" />
<path id="findbugs.classpath">
<fileset dir="${build.ivy.lib.dir}/findbugs">
<include name="*.jar" />
</fileset>
</path>
<pathconvert property="findbugs.classpath" refid="findbugs.classpath" />
</target>
<target name="findbugs" depends="init,ivy-retrieve-findbugs,check-for-findbugs" description="Run findbugs on source files">
<echo message="Project: ${ant.project.name}" />
<property name="findbugs.conf.dir" location="${hive.root}/findbugs" />
<property name="findbugs.build.dir" location="${build.dir.hive}/findbugs" />
<property name="findbugs.exclude.file" value="${findbugs.conf.dir}/findbugs-exclude.xml"/>
<property name="findbugs.report.htmlfile" value="${findbugs.build.dir}/findbugs-report.html"/>
<property name="findbugs.report.xmlfile" value="${findbugs.build.dir}/findbugs-report.xml"/>
<mkdir dir="${findbugs.build.dir}" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${build.ivy.lib.dir}/findbugs/findbugs-ant.jar" />
<findbugs classpath="${findbugs.classpath}" pluginList="" effort="max" output="xml" outputFile="${findbugs.report.xmlfile}" excludeFilter="${findbugs.exclude.file}">
<auxClasspath>
<fileset dir="${build.dir.hive}">
<include name="**/*.jar" />
</fileset>
</auxClasspath>
<sourcePath path="${hive.root}/ant" />
<sourcePath path="${hive.root}/builtins" />
<sourcePath path="${hive.root}/cli" />
<sourcePath path="${hive.root}/common" />
<sourcePath path="${hive.root}/contrib" />
<sourcePath path="${hive.root}/hbase-handler" />
<sourcePath path="${hive.root}/hwi" />
<sourcePath path="${hive.root}/jdbc" />
<sourcePath path="${hive.root}/metastore" />
<sourcePath path="${hive.root}/odbc" />
<sourcePath path="${hive.root}/pdk" />
<sourcePath path="${hive.root}/ql" />
<sourcePath path="${hive.root}/serde" />
<sourcePath path="${hive.root}/service" />
<sourcePath path="${hive.root}/shims" />
<class location="${build.dir.hive}/anttasks/classes" />
<class location="${build.dir.hive}/builtins/classes" />
<class location="${build.dir.hive}/cli/classes" />
<class location="${build.dir.hive}/common/classes" />
<class location="${build.dir.hive}/contrib/classes" />
<class location="${build.dir.hive}/hbase-handler/classes" />
<class location="${build.dir.hive}/hwi/classes" />
<class location="${build.dir.hive}/jdbc/classes" />
<class location="${build.dir.hive}/metastore/classes" />
<class location="${build.dir.hive}/pdk/classes" />
<class location="${build.dir.hive}/ql/classes" />
<class location="${build.dir.hive}/serde/classes" />
<class location="${build.dir.hive}/service/classes" />
<class location="${build.dir.hive}/shims/classes" />
</findbugs>
<!--
<xslt style="${findbugs.conf.dir}/default.xsl" in="${findbugs.report.xmlfile}" out="${findbugs.report.htmlfile}"/>
-->
</target>
<target name="ivy-docs" depends="ivy-init-settings"
description="Resolve, Retrieve Ivy-managed artifacts for docs configuration">
<echo message="Project: ${ant.project.name}"/>
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="docs"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="docs"/>
<ivy:cachepath pathid="docs-classpath" conf="docs"/>
</target>
<target name="docs-anakia" depends="ivy-docs">
<echo message="Project: ${ant.project.name}"/>
<echo message="Building xdocs with anakia"/>
<mkdir dir="${build.dir.hive}/docs"/>
<taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
<classpath refid="common-classpath"/>
<classpath refid="docs-classpath"/>
</taskdef>
<anakia basedir="${anakia.docs.src}" destdir="${anakia.docs.dest}"
extension=".html" style="./docs/stylesheets/site.vsl"
projectFile="../stylesheets/project.xml"
excludes="**/stylesheets/**"
includes="**/*.xml"
lastModifiedCheck="false"
velocityPropertiesFile="${docs.src}/velocity.properties">
</anakia>
<copy todir="${anakia.docs.dest}/images" filtering="no">
<fileset dir="${docs.src}/images">
<include name="**/*.gif"/>
<include name="**/*.jpeg"/>
<include name="**/*.jpg"/>
<include name="**/*.png"/>
</fileset>
</copy>
<copy file="${docs.src}/site.css" tofile="${anakia.docs.dest}/site.css" />
</target>
<!-- Prepare for maven deploy i.e. jars, poms, and licence -->
<target name="ivy-resolve-maven-ant-tasks" depends="ivy-init-settings">
<echo message="Project: ${ant.project.name}"/>
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="maven"
log="${ivyresolvelog}"/>
</target>
<target name="ivy-retrieve-maven-ant-tasks" depends="ivy-resolve-maven-ant-tasks"
description="Retrieve Ivy-managed artifacts for the maven-ant-tasks configurations">
<echo message="Project: ${ant.project.name}"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
log="${ivyresolvelog}"/>
<ivy:cachepath pathid="maven-ant-tasks.classpath" conf="maven"/>
</target>
<target name="mvn-taskdef" depends="ivy-retrieve-maven-ant-tasks">
<echo message="Project: ${ant.project.name}"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
</target>
<target name="maven-build" depends="package" description="Build Maven artifacts">
<echo message="Project: ${ant.project.name}"/>
<!-- create jars, poms licences directory -->
<mkdir dir="${mvn.jar.dir}" />
<mkdir dir="${mvn.pom.dir}" />
<mkdir dir="${mvn.license.dir}" />
<!-- call make pom on all projects that have ivy.xml -->
<iterate-all target="make-pom" />
<!-- copy the jars -->
<copy file="${build.dir.hive}/anttasks/hive-anttasks-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/cli/hive-cli-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/common/hive-common-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/contrib/hive-contrib-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/hbase-handler/hive-hbase-handler-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/hwi/hive-hwi-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/jdbc/hive-jdbc-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/metastore/hive-metastore-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/ql/hive-exec-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/serde/hive-serde-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/service/hive-service-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/shims/hive-shims-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/pdk/hive-pdk-${version}.jar"
todir="${mvn.jar.dir}" />
<copy file="${build.dir.hive}/builtins/hive-builtins-${version}.jar"
todir="${mvn.jar.dir}" />
<!-- copy over maven pom files created using the make-pom target and rename to maven convention -->
<copy file="${build.dir.hive}/anttasks/pom.xml"
tofile="${mvn.pom.dir}/hive-anttasks-${version}.pom" />
<copy file="${build.dir.hive}/cli/pom.xml"
tofile="${mvn.pom.dir}/hive-cli-${version}.pom" />
<copy file="${build.dir.hive}/common/pom.xml"
tofile="${mvn.pom.dir}/hive-common-${version}.pom" />
<copy file="${build.dir.hive}/contrib/pom.xml"
tofile="${mvn.pom.dir}/hive-contrib-${version}.pom" />
<copy file="${build.dir.hive}/hbase-handler/pom.xml"
tofile="${mvn.pom.dir}/hive-hbase-handler-${version}.pom" />
<copy file="${build.dir.hive}/hwi/pom.xml"
tofile="${mvn.pom.dir}/hive-hwi-${version}.pom" />
<copy file="${build.dir.hive}/jdbc/pom.xml"
tofile="${mvn.pom.dir}/hive-jdbc-${version}.pom" />
<copy file="${build.dir.hive}/metastore/pom.xml"
tofile="${mvn.pom.dir}/hive-metastore-${version}.pom" />
<copy file="${build.dir.hive}/ql/pom.xml"
tofile="${mvn.pom.dir}/hive-exec-${version}.pom" />
<copy file="${build.dir.hive}/serde/pom.xml"
tofile="${mvn.pom.dir}/hive-serde-${version}.pom" />
<copy file="${build.dir.hive}/service/pom.xml"
tofile="${mvn.pom.dir}/hive-service-${version}.pom" />
<copy file="${build.dir.hive}/shims/pom.xml"
tofile="${mvn.pom.dir}/hive-shims-${version}.pom" />
<copy file="${build.dir.hive}/pdk/pom.xml"
tofile="${mvn.pom.dir}/hive-pdk-${version}.pom" />
<copy file="${build.dir.hive}/builtins/pom.xml"
tofile="${mvn.pom.dir}/hive-builtins-${version}.pom" />
<!-- copy over licence -->
<copy file="${hive.root}/LICENSE" todir="${mvn.license.dir}" />
<!-- checksum files -->
<checksum forceOverwrite="yes" algorithm="MD5" fileext=".md5">
<fileset dir="${mvn.jar.dir}" excludes="**/*.sha1,**/*.md5" />
<fileset dir="${mvn.pom.dir}" excludes="**/*.sha1,**/*.md5" />
<fileset dir="${mvn.license.dir}" excludes="**/*.sha1,**/*.md5" />
</checksum>
<checksum forceOverwrite="yes" algorithm="SHA" fileext=".sha1">
<fileset dir="${mvn.jar.dir}" excludes="**/*.sha1,**/*.md5" />
<fileset dir="${mvn.pom.dir}" excludes="**/*.sha1,**/*.md5" />
<fileset dir="${mvn.license.dir}" excludes="**/*.sha1,**/*.md5" />
</checksum>
<echo>
Please consult the HowToRelease page on the Hive Wiki for
a description of the remaining steps required to publish
Maven artifacts to the ASF repository:
https://cwiki.apache.org/confluence/display/Hive/HowToRelease
</echo>
</target>
<!-- Deploy a single artifact to the maven repository -->
<target name="maven-publish-artifact">
<echo message="Project: ${ant.project.name}"/>
<artifact:pom
file="${mvn.pom.dir}/hive-${hive.project}-${version}.pom"
id="hive.project.pom" />
<artifact:install-provider artifactId="wagon-http" version="1.0-beta-2" />
<if>
<equals arg1="${mvn.publish.repo}" arg2="staging" />
<then>
<artifact:deploy
file="${mvn.jar.dir}/hive-${hive.project}-${version}.jar">
<pom refid="hive.project.pom" />
<remoteRepository
id="apache.staging.https"
url="https://repository.apache.org/service/local/staging/deploy/maven2" />
<attach file="${mvn.jar.dir}/hive-${hive.project}-${version}.jar.asc"
type="jar.asc"/>
<attach file="${mvn.pom.dir}/hive-${hive.project}-${version}.pom.asc"
type="pom.asc"/>
</artifact:deploy>
</then>
<elseif>
<equals arg1="${mvn.publish.repo}" arg2="local"/>
<then>
<artifact:install
file="${mvn.jar.dir}/hive-${hive.project}-${version}.jar">
<pom refid="hive.project.pom" />
</artifact:install>
</then>
</elseif>
<else>
<artifact:deploy
file="${mvn.jar.dir}/hive-${hive.project}-${version}.jar">
<pom refid="hive.project.pom" />
<remoteRepository id="${mvn.deploy.id}" url="${mvn.deploy.url}"/>
</artifact:deploy>
</else>
</if>
</target>
<target name="maven-publish" depends="init,mvn-taskdef,maven-sign"
description="Publish Maven artifacts">
<echo message="Project: ${ant.project.name}"/>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="anttasks" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="cli" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="common" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="contrib" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="exec" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="hbase-handler" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="hwi" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="pdk" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="builtins" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="jdbc" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="metastore" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="serde" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="service" />
</antcall>
<antcall target="maven-publish-artifact">
<param name="hive.project" value="shims" />
</antcall>
</target>
<target name="maven-sign" if="staging">
<echo message="Project: ${ant.project.name}"/>
<input message="password:>" addproperty="gpg.passphrase">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<macrodef name="sign-artifact" description="Signs the artifact">
<attribute name="input.file"/>
<attribute name="output.file" default="@{input.file}.asc"/>
<attribute name="gpg.passphrase"/>
<sequential>
<echo>Signing @{input.file} Sig File: @{output.file}</echo>
<exec executable="gpg" >
<arg value="--armor"/>
<arg value="--output"/>
<arg value="@{output.file}"/>
<arg value="--passphrase"/>
<arg value="@{gpg.passphrase}"/>
<arg value="--detach-sig"/>
<arg value="@{input.file}"/>
</exec>
</sequential>
</macrodef>
<sign-artifact
input.file="${mvn.jar.dir}/hive-anttasks-${version}.jar"
output.file="${mvn.jar.dir}/hive-anttasks-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-anttasks-${version}.pom"
output.file="${mvn.pom.dir}/hive-anttasks-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-cli-${version}.jar"
output.file="${mvn.jar.dir}/hive-cli-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-cli-${version}.pom"
output.file="${mvn.pom.dir}/hive-cli-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-common-${version}.jar"
output.file="${mvn.jar.dir}/hive-common-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-common-${version}.pom"
output.file="${mvn.pom.dir}/hive-common-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-contrib-${version}.jar"
output.file="${mvn.jar.dir}/hive-contrib-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-contrib-${version}.pom"
output.file="${mvn.pom.dir}/hive-contrib-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-hbase-handler-${version}.jar"
output.file="${mvn.jar.dir}/hive-hbase-handler-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-hbase-handler-${version}.pom"
output.file="${mvn.pom.dir}/hive-hbase-handler-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-hwi-${version}.jar"
output.file="${mvn.jar.dir}/hive-hwi-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-hwi-${version}.pom"
output.file="${mvn.pom.dir}/hive-hwi-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-jdbc-${version}.jar"
output.file="${mvn.jar.dir}/hive-jdbc-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-jdbc-${version}.pom"
output.file="${mvn.pom.dir}/hive-jdbc-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-metastore-${version}.jar"
output.file="${mvn.jar.dir}/hive-metastore-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-metastore-${version}.pom"
output.file="${mvn.pom.dir}/hive-metastore-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-exec-${version}.jar"
output.file="${mvn.jar.dir}/hive-exec-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-exec-${version}.pom"
output.file="${mvn.pom.dir}/hive-exec-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-pdk-${version}.jar"
output.file="${mvn.jar.dir}/hive-pdk-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-pdk-${version}.pom"
output.file="${mvn.pom.dir}/hive-pdk-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-builtins-${version}.jar"
output.file="${mvn.jar.dir}/hive-builtins-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-builtins-${version}.pom"
output.file="${mvn.pom.dir}/hive-builtins-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-serde-${version}.jar"
output.file="${mvn.jar.dir}/hive-serde-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-serde-${version}.pom"
output.file="${mvn.pom.dir}/hive-serde-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-service-${version}.jar"
output.file="${mvn.jar.dir}/hive-service-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-service-${version}.pom"
output.file="${mvn.pom.dir}/hive-service-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.jar.dir}/hive-shims-${version}.jar"
output.file="${mvn.jar.dir}/hive-shims-${version}.jar.asc"
gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact
input.file="${mvn.pom.dir}/hive-shims-${version}.pom"
output.file="${mvn.pom.dir}/hive-shims-${version}.pom.asc"
gpg.passphrase="${gpg.passphrase}"/>
</target>
</project>