Skip to content
Browse files

moving common settings and tasks into build-common.xml and adding a b…

…uild.version param
  • Loading branch information...
1 parent 6526e48 commit f1fb0aacb91bef3c3044b33ad06ff799e1012f63 @billonahill billonahill committed Jan 24, 2013
Showing with 54 additions and 71 deletions.
  1. +38 −0 build-common.xml
  2. +4 −14 hadoop-connector/build.xml
  3. +4 −15 hadoop-example/build.xml
  4. +4 −28 pig-connector/build.xml
  5. +4 −14 squeal/build.xml
View
38 build-common.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common">
+ <!--
+ Common build file for properties or tasks that should be shared across sub-project build files.
+ -->
+
+ <!-- When making a versioned release, create a branch and change the build.version below -->
+ <property name="build.version" value = "SNAPSHOT" />
+
+ <!-- some common defaults -->
+ <property name="hadoop-connector.jar"
+ value = "${basedir}/../hadoop-connector/build/hadoop-connector/jar/hadoop-vertica-${build.version}.jar" />
+
+ <!-- These require targets could be done better with a single macro -->
+ <target name="requirehadoopdir">
+ <fail message="Property &quot;hadoop.dir&quot; needs to be set to a value">
+ <condition>
+ <or>
+ <equals arg1="${hadoop.dir}" arg2=""/>
+ <not><isset property="hadoop.dir"/></not>
+ <not><available file="${hadoop.dir}" type="dir"/></not>
+ </or>
+ </condition>
+ </fail>
+ </target>
+
+ <target name="requirepigjar">
+ <fail message="Property &quot;pig.jar&quot; needs to be set to a valid jar file">
+ <condition>
+ <or>
+ <equals arg1="${pig.jar}" arg2=""/>
+ <not><isset property="pig.jar"/></not>
+ <not><available file="${pig.jar}" type="file"/></not>
+ </or>
+ </condition>
+ </fail>
+ </target>
+</project>
View
18 hadoop-connector/build.xml
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="hadoop-connector">
+ <include file="../build-common.xml"/>
+
<property environment="env"/>
<!--Required parameters. You have to specify these on the ANT command line -->
<!--JUNIT jars should be in the lib path. For e.g. specify using -lib -->
@@ -17,7 +19,7 @@
<property name="build.dir" location="${basedir}/build" />
<property name="dist" value="${build.dir}/hadoop-connector/jar"/>
- <property name="jar.file" location="${dist}/${jar.name}.jar" />
+ <property name="jar.file" location="${dist}/${jar.name}-${build.version}.jar" />
<property name="build.classes" location="${build.dir}/hadoop-connector/classes"/>
<property name="build.test.classes" location="${build.dir}/hadoop-connector/tests" />
<property name="junit.output.dir" value="${build.dir}/hadoop-connector/junit"/>
@@ -61,19 +63,7 @@
<target depends="clean" name="cleanall"/>
- <target name="requirehadoopdir">
- <fail message="Property &quot;hadoop.dir&quot; needs to be set to a value">
- <condition>
- <or>
- <equals arg1="${hadoop.dir}" arg2=""/>
- <not><isset property="hadoop.dir"/></not>
- <not><available file="${hadoop.dir}" type="dir"/></not>
- </or>
- </condition>
- </fail>
- </target>
-
- <target depends="requirehadoopdir,init" name="compile">
+ <target depends="common.requirehadoopdir,init" name="compile">
<echo>hadoop.dir: ${hadoop.dir}</echo>
<echo></echo>
<mkdir dir="${build.classes}"/>
View
19 hadoop-example/build.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="hadoop-example">
+ <include file="../build-common.xml"/>
+
<property environment="env"/>
<!--Required parameters. You have to specify these on the ANT command line -->
<!--JUNIT jars should be in the lib path. For e.g. specify using -lib -->
<property name="vertica.jar" value = "" />
- <property name="hadoop-connector.jar" value = "${basedir}/../hadoop-connector/build/hadoop-connector/jar/hadoop-vertica.jar" />
<property name="hadoop.dir" value="" />
<property name="doc.dir" value="" />
@@ -18,7 +19,7 @@
<property name="build.dir" location="${basedir}/build" />
<property name="dist" value="${build.dir}/hadoop-example/jar"/>
- <property name="jar.file" location="${dist}/${jar.name}.jar" />
+ <property name="jar.file" location="${dist}/${jar.name}-${build.version}.jar" />
<property name="build.classes" location="${build.dir}/hadoop-example/" />
<!-- Lesson: You can add location of jar files here -->
@@ -48,19 +49,7 @@
<target depends="clean" name="cleanall"/>
- <target name="requirehadoopdir">
- <fail message="Property &quot;hadoop.dir&quot; needs to be set to a valid directory">
- <condition>
- <or>
- <equals arg1="${hadoop.dir}" arg2=""/>
- <not><isset property="hadoop.dir"/></not>
- <not><available file="${hadoop.dir}" type="dir"/></not>
- </or>
- </condition>
- </fail>
- </target>
-
- <target depends="requirehadoopdir,init" name="compile">
+ <target depends="common.requirehadoopdir,init" name="compile">
<mkdir dir="${build.classes}"/>
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.classes}"
View
32 pig-connector/build.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="pig-vertica">
+ <include file="../build-common.xml"/>
+
<property environment="env"/>
<!--Required parameters. You have to specify these on the ANT command line -->
<!--JUNIT jars should be in the lib path. For e.g. specify using -lib -->
<property name="vertica.jar" value = "" />
- <property name="hadoop-connector.jar" value = "${basedir}/../hadoop-connector/build/hadoop-connector/jar/hadoop-vertica.jar" />
<property name="doc.dir" value="" />
<property name="jar.name" value="pig-vertica" />
@@ -17,7 +18,7 @@
<property name="build.dir" location="${basedir}/build" />
<property name="dist" value="${build.dir}/pig-connector/jar"/>
- <property name="jar.file" location="${dist}/${jar.name}.jar" />
+ <property name="jar.file" location="${dist}/${jar.name}-${build.version}.jar" />
<property name="build.classes" location="${build.dir}/pig-connector/classes"/>
<!-- Lesson: You can add location of jar files here -->
@@ -49,32 +50,7 @@
<delete dir="${doc.dir}/pig-connector"/>
</target>
-
- <target name="requirehadoopdir">
- <fail message="Property &quot;hadoop.dir&quot; needs to be set to a valid directory">
- <condition>
- <or>
- <equals arg1="${hadoop.dir}" arg2=""/>
- <not><isset property="hadoop.dir"/></not>
- <not><available file="${hadoop.dir}" type="dir"/></not>
- </or>
- </condition>
- </fail>
- </target>
-
- <target name="requirepigjar">
- <fail message="Property &quot;pig.jar&quot; needs to be set to a valid jar file">
- <condition>
- <or>
- <equals arg1="${pig.jar}" arg2=""/>
- <not><isset property="pig.jar"/></not>
- <not><available file="${pig.jar}" type="file"/></not>
- </or>
- </condition>
- </fail>
- </target>
-
- <target depends="requirehadoopdir, requirepigjar, init" name="compile">
+ <target depends="common.requirehadoopdir,common.requirepigjar,init" name="compile">
<fail unless="hadoop.dir">Property hadoop.dir must be set.</fail>
<fail unless="pig.jar">Property pig.jar must be set.</fail>
<echo>hadoop.dir : ${hadoop.dir}</echo>
View
18 squeal/build.xml
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="squeal">
+ <include file="../build-common.xml"/>
+
<property environment="env"/>
<!--Required parameters. You have to specify these on the ANT command line -->
<!--JUNIT jars should be in the lib path. For e.g. specify using -lib -->
@@ -24,7 +26,7 @@
<property name="build.dir" location="${basedir}/build" />
<property name="build.classes" location="${build.dir}/squeal/classes"/>
<property name="dist" value="${build.dir}/squeal/jar"/>
- <property name="jar.file" location="${dist}/${jar.name}.jar" />
+ <property name="jar.file" location="${dist}/${jar.name}-${build.version}.jar" />
<!-- Lesson: You can add location of jar files here -->
<path id="compile.classpath">
@@ -74,19 +76,7 @@
</fail>
</target>
- <target name="requirepigjar">
- <fail message="Property &quot;pig.jar&quot; needs to be set to a valid jar file">
- <condition>
- <or>
- <equals arg1="${pig.jar}" arg2=""/>
- <not><isset property="pig.jar"/></not>
- <not><available file="${pig.jar}" type="file"/></not>
- </or>
- </condition>
- </fail>
- </target>
-
- <target depends="requirehadoopdir,requirepigjar,init" name="compile">
+ <target depends="common.requirehadoopdir,common.requirepigjar,init" name="compile">
<echo>hadoop.dir : ${hadoop.dir}</echo>
<echo>pig.jar : ${pig.jar}</echo>
<mkdir dir="${build.classes}"/>

0 comments on commit f1fb0aa

Please sign in to comment.
Something went wrong with that request. Please try again.