Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
HIVE-82 Support for building tarballs and javadocs
Browse files Browse the repository at this point in the history
(Ashish Thusoo via rmurthy)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/hive/trunk@763877 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Raghotham Murthy committed Apr 10, 2009
1 parent bc5ae00 commit 5ba213e
Show file tree
Hide file tree
Showing 49 changed files with 815 additions and 148 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Release 0.3.0 - Unreleased
HIVE-299. Include php packages for thrift service.
(Raghotham Murthy via zshao)

HIVE-82 Support for building tarballs and javadocs
(Ashish Thusoo via rmurthy)

IMPROVEMENTS

HIVE-132. Show table and describe results to be read via FetchTask.
Expand Down
4 changes: 0 additions & 4 deletions ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ public String getQueryFile() {
return this.queryFile;
}

/**
* Invoke {@link org.apache.hadoop.fs.FsShell#doMain FsShell.doMain} after a
* few cursory checks of the configuration.
*/
public void execute() throws BuildException {

if (templatePath == null) {
Expand Down
33 changes: 14 additions & 19 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,21 @@

<project xmlns:ivy="antlib:org.apache.ivy.ant" name="hivecommon" default="jar">

<property name="name" value="${ant.project.name}"/>

<property name="hive.root" location="${basedir}/.."/>
<property file="${hive.root}/build.properties"/>
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />

<property name="hive.conf.dir" value="${hive.root}/conf"/>
<property name="dist.dir" location="${hive.root}"/>

<property name="src.dir.hive" location="${hive.root}"/>
<property name="build.dir.hive" location="${hive.root}/build"/>
<property name="build.dir.hadoop" location="${build.dir.hive}/hadoopcore"/>
<property name="build.dir" location="${build.dir.hive}/${name}"/>
<property name="build.dir" location="${build.dir.hive}/${ant.project.name}"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.encoding" value="ISO-8859-1"/>
<property name="deploy.dir" location="${build.dir.hive}"/>

<property name="hadoop.mirror" value="http://archive.apache.org/dist"/>
<property name="hadoop.version" value="0.19.0"/>
<property name="hadoop.root.default" location="${build.dir.hadoop}/hadoop-${hadoop.version}"/>
<property name="hadoop.root" value="${hadoop.root.default}"/>
<property name="hadoop.jar" location="${hadoop.root}/hadoop-${hadoop.version}-core.jar"/>
<property name="hadoop.conf.dir" location="${hadoop.root}/conf"/>

<property name="javac.debug" value="on"/>
Expand All @@ -50,13 +46,12 @@

<!-- configuration needed for tests -->
<property name="test.src.dir" value="${basedir}/src/test"/>
<property name="test.src.data.dir" value="${src.dir.hive}/data"/>
<property name="test.src.data.dir" value="${hive.root}/data"/>
<property name="test.build.dir" value="${build.dir}/test"/>
<property name="test.log.dir" value="${test.build.dir}/logs"/>
<property name="test.data.dir" value="${test.build.dir}/data"/>
<property name="test.build.src" value="${test.build.dir}/src"/>
<property name="test.build.classes" value="${test.build.dir}/classes"/>
<property name="test.build.javadoc" value="${test.build.dir}/docs/api"/>
<property name="test.include" value="Test*"/>
<property name="test.classpath.id" value="test.classpath"/>
<property name="test.output" value="true"/>
Expand Down Expand Up @@ -107,9 +102,9 @@

<!-- I am not sure whether we need this target any more since that package does what is needed -->
<target name="deploy" depends="jar">
<echo message="hive: ${name}"/>
<echo message="hive: ${ant.project.name}"/>
<mkdir dir="${deploy.dir}"/>
<copy file="${build.dir}/hive_${name}.jar"
<copy file="${build.dir}/hive_${ant.project.name}.jar"
todir="${deploy.dir}"/>
</target>

Expand All @@ -118,8 +113,8 @@
<pathelement location="${hadoop.jar}"/>
<pathelement location="${build.dir.hive}/classes"/>
<fileset dir="${build.dir.hive}" includes="hive_*.jar"/>
<fileset dir="${src.dir.hive}/lib" includes="*.jar"/>
<fileset dir="${src.dir.hive}/ql/lib" includes="*.jar"/>
<fileset dir="${hive.root}/lib" includes="*.jar"/>
<fileset dir="${hive.root}/ql/lib" includes="*.jar"/>
</path>

<path id="classpath">
Expand Down Expand Up @@ -158,7 +153,7 @@
</target>

<target name="compile" depends="init, install-hadoopcore">
<echo message="Compiling: ${name}"/>
<echo message="Compiling: ${ant.project.name}"/>
<javac
encoding="${build.encoding}"
srcdir="${src.dir}"
Expand All @@ -172,9 +167,9 @@
</target>

<target name="jar" depends="compile">
<echo message="Jar: ${name}"/>
<echo message="Jar: ${ant.project.name}"/>
<jar
jarfile="${build.dir}/hive_${name}.jar"
jarfile="${build.dir}/hive_${ant.project.name}.jar"
basedir="${build.classes}"
/>
</target>
Expand Down Expand Up @@ -293,7 +288,7 @@
</target>

<target name="clean">
<echo message="Cleaning: ${name}"/>
<echo message="Cleaning: ${ant.project.name}"/>
<delete dir="${build.dir}"/>
</target>

Expand Down
14 changes: 14 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Name=Hive
name=hive
version=0.4.0
year=2009

hadoop.version=0.19.0
hadoop.mirror=http://archive.apache.org/dist

build.dir.hive=${hive.root}/build
build.dir.hadoop=${build.dir.hive}/hadoopcore

hadoop.root.default=${build.dir.hadoop}/hadoop-${hadoop.version}
hadoop.root=${hadoop.root.default}
hadoop.jar=${hadoop.root}/hadoop-${hadoop.version}-core.jar
178 changes: 175 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
<project name="hive" default="deploy" >

<property name="hive.root" location="${basedir}"/>
<property name="build.dir.hive" location="${hive.root}/build"/>
<property file="${hive.root}/build.properties"/>
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />

<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"/>
Expand All @@ -30,6 +33,52 @@
<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="build.docs" value="${target.dir}/docs"/>
<property name="build.javadoc" value="${build.docs}/api"/>
<property name="docs.src" value="${hive.root}/docs"/>
<property name="changes.src" value="${docs.src}/changes"/>
<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}-hadoop-${hadoop.version}"/>
<property name="dev.final.name" value="${final.name}-dev"/>
<property name="bin.final.name" value="${final.name}-bin"/>

<!-- ====================================================== -->
<!-- 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>
</sequential>
</macrodef>

<!-- the normal classpath -->
<path id="common-classpath">
<pathelement location="${hadoop.jar}"/>
<pathelement location="${build.dir.hive}/classes"/>
<fileset dir="${hive.root}" includes="hive_*.jar"/>
<fileset dir="${hive.root}/lib" includes="*.jar"/>
<fileset dir="${hive.root}/ql/lib" includes="*.jar"/>
</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>

<!-- ====================================================== -->
<!-- Initialize for running junit tests -->
Expand Down Expand Up @@ -111,7 +160,7 @@
</target>

<!-- ====================================================== -->
<!-- Test all the contribs. -->
<!-- Test everything. -->
<!-- ====================================================== -->
<target name="test" depends="clean-test,deploy">
<subant target="test">
Expand All @@ -137,7 +186,7 @@
</target>

<!-- ====================================================== -->
<!-- Clean all the contribs. -->
<!-- Clean everything. -->
<!-- ====================================================== -->
<target name="clean">
<subant target="clean">
Expand Down Expand Up @@ -212,6 +261,9 @@
</chmod>
</target>

<!-- ====================================================== -->
<!-- Generate files for eclipse. -->
<!-- ====================================================== -->
<target name="eclipse-files" depends="init"
description="Generate files for Eclipse">

Expand Down Expand Up @@ -252,4 +304,124 @@
</delete>
</target>

<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->

<target name="docs">
<antcall target="changes-to-html"/>
</target>

<target name="changes-to-html" description="Convert CHANGES.txt into an html file">
<mkdir dir="${build.docs}"/>
<exec executable="perl" input="CHANGES.txt" output="${build.docs}/changes.html" failonerror="true">
<arg value="${changes.src}/changes2html.pl"/>
</exec>
<copy todir="${build.docs}">
<fileset dir="${changes.src}" includes="*.css"/>
</copy>
<copy todir="${build.docs}/images">
<fileset dir="${images.src}" includes="*.jpg"/>
</copy>
</target>

<target name="javadoc" depends="package" description="Generate javadoc">

<mkdir dir="${build.javadoc}"/>
<javadoc
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-javabean"/>
<packageset dir="serde/src/java"/>
<packageset dir="serde/src/test"/>
<packageset dir="serde/src/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-javabean"/>
<packageset dir="metastore/src/model"/>
<packageset dir="cli/src/java"/>
<packageset dir="${build.dir.hive}/ql/java"/>
<packageset dir="${build.dir.hive}/ql/gen-java"/>

<link href="${javadoc.link.java}"/>

<classpath >
<fileset dir="${hadoop.root}/lib">
<include name="**/*.jar" />
<exclude name="**/excluded/" />
</fileset>
<path refid="classpath" />
<pathelement path="${java.class.path}"/>
</classpath>

<group title="Hive" packages="org.apache.*"/>
</javadoc>

</target>

<!-- ================================================================== -->
<!-- Make release tarball -->
<!-- ================================================================== -->
<target name="tar" depends="package, docs, javadoc" description="Make release tarball">
<macro_tar param.destfile="${build.dir.hive}/${dev.final.name}.tar.gz">
<param.listofitems>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${dev.final.name}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${dev.final.name}">
<include name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="664" prefix="${dev.final.name}">
<include name="**"/>
<exclude name="bin/**"/>
<exclude name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${hive.root}" mode="664" prefix="${dev.final.name}/src">
<exclude name="build/**" />
<exclude name="bin/**" />
<exclude name="**/py/**/*-remote" />
</tarfileset>
<tarfileset dir="${hive.root}" mode="755" prefix="${dev.final.name}/src">
<exclude name="build/**" />
<include name="bin/**" />
<include name="**/py/**/*-remote" />
</tarfileset>
</param.listofitems>
</macro_tar>
</target>

<target name="binary" depends="package, docs, javadoc" description="Make tarball without source and documentation">
<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}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="755" prefix="${bin.final.name}">
<include name="lib/py/**/*-remote"/>
</tarfileset>
<tarfileset dir="${build.dir.hive}/dist" mode="664" prefix="${bin.final.name}">
<include name="**"/>
<exclude name="bin/**"/>
<exclude name="docs/**"/>
<exclude name="lib/py/**/*-remote"/>
</tarfileset>
</param.listofitems>
</macro_tar>
</target>

</project>
Loading

0 comments on commit 5ba213e

Please sign in to comment.