PageRenderTime 24ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/odbc/build.xml

#
XML | 102 lines | 69 code | 13 blank | 20 comment | 0 complexity | fb964d3604b494f285aeb8ef654f7edc MD5 | raw file
  1<?xml version="1.0" encoding="UTF-8"?>
  2
  3<!--
  4   Licensed to the Apache Software Foundation (ASF) under one or more
  5   contributor license agreements.  See the NOTICE file distributed with
  6   this work for additional information regarding copyright ownership.
  7   The ASF licenses this file to You under the Apache License, Version 2.0
  8   (the "License"); you may not use this file except in compliance with
  9   the License.  You may obtain a copy of the License at
 10
 11       http://www.apache.org/licenses/LICENSE-2.0
 12
 13   Unless required by applicable law or agreed to in writing, software
 14   distributed under the License is distributed on an "AS IS" BASIS,
 15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 16   See the License for the specific language governing permissions and
 17   limitations under the License.
 18-->
 19
 20<project name="odbc" default="compile-cpp">
 21  <property name="src.dir" value="${basedir}/src"/>
 22
 23  <!--
 24    Override properties defined in ../build-common.xml.
 25  -->
 26  <property name="test.junit.output.format" value="plain"/>
 27  <property name="test.output" value="false"/>
 28  <property name="test.junit.output.usefile" value="false"/>
 29  <property name="make.cmd" value="make"/>
 30  <import file="../build-common.xml"/>
 31
 32  <path id="test.classpath">
 33    <pathelement location="${test.build.classes}" />
 34    <pathelement location="" />
 35    <pathelement location="${test.src.data.dir}/conf"/>
 36    <pathelement location="${hive.conf.dir}"/>
 37    <fileset dir="${test.src.data.dir}" includes="files/*.jar"/>
 38    <fileset dir="${hive.root}" includes="testlibs/*.jar"/>
 39    <pathelement location="${build.dir.hive}/ql/test/classes"/>
 40    <path refid="classpath"/>
 41  </path>
 42
 43  <target name="check-word-size">
 44    <condition property="word.size" value="64" else="32">
 45      <contains string="${os.arch}" substring="64"/>
 46    </condition>
 47  </target>
 48
 49  <target name="compile-cpp" depends="init,check-word-size">
 50    <exec dir="." executable="${make.cmd}" failonerror="true">
 51      <env key="WORD_SIZE" value="${word.size}"/>
 52      <env key="THRIFT_HOME" value="${thrift.home}"/>
 53      <env key="BOOST_HOME" value="${boost.home}"/>
 54      <env key="HIVE_ROOT" value="${hive.root}"/>
 55      <env key="BASE_DIR" value="${basedir}"/>
 56    </exec>
 57    <mkdir dir="${build.dir.hive}/odbc/include"/>
 58    <copy file="${basedir}/src/cpp/hiveclient.h" todir="${build.dir.hive}/odbc/include"/>
 59    <copy file="${basedir}/src/cpp/hiveconstants.h" todir="${build.dir.hive}/odbc/include"/>
 60  </target>
 61
 62  <target name="clean">
 63    <delete dir="${build.dir.hive}/odbc/include"/>
 64    <exec dir="." executable="${make.cmd}" failonerror="true">
 65      <arg line="clean"/>
 66      <env key="HIVE_ROOT" value="${hive.root}"/>
 67      <env key="BASE_DIR" value="${basedir}"/>
 68    </exec>
 69  </target>
 70
 71  <target name="install" depends="check-word-size">
 72    <exec dir="." executable="${make.cmd}" failonerror="true">
 73      <arg line="install"/>
 74      <env key="WORD_SIZE" value="${word.size}"/>
 75      <env key="THRIFT_HOME" value="${thrift.home}"/>
 76      <env key="HIVE_ROOT" value="${hive.root}"/>
 77      <env key="BASE_DIR" value="${basedir}"/>
 78    </exec>
 79  </target>
 80
 81  <target name="uninstall">
 82    <exec dir="." executable="${make.cmd}" failonerror="true">
 83      <arg line="uninstall"/>
 84      <env key="HIVE_ROOT" value="${hive.root}"/>
 85      <env key="BASE_DIR" value="${basedir}"/>
 86    </exec>
 87  </target>
 88
 89  <!-- Only run tests if thrift.home is defined so that we don't break other tests -->
 90  <target name="test" depends="check-word-size,check-thrift-home" if="thrift.home.defined">
 91    <exec dir="." executable="${make.cmd}" failonerror="true">
 92      <arg line="test"/>
 93      <env key="WORD_SIZE" value="${word.size}"/>
 94      <env key="THRIFT_HOME" value="${thrift.home}"/>
 95      <env key="HIVE_ROOT" value="${hive.root}"/>
 96      <env key="BASE_DIR" value="${basedir}"/>
 97    </exec>
 98  </target>
 99
100
101
102</project>