incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tra...@apache.org
Subject svn commit: r1360361 - in /incubator/hcatalog/trunk: CHANGES.txt ant/ ant/findbugs.xml build-common-new.xml build.xml hcatalog-pig-adapter/build.xml hcatalog-pig-adapter/ivy.xml
Date Wed, 11 Jul 2012 19:21:06 GMT
Author: travis
Date: Wed Jul 11 19:21:05 2012
New Revision: 1360361

URL: http://svn.apache.org/viewvc?rev=1360361&view=rev
Log:
HCATALOG-447 : findbugs target doesn't work in trunk

Added:
    incubator/hcatalog/trunk/ant/
    incubator/hcatalog/trunk/ant/findbugs.xml
Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/build-common-new.xml
    incubator/hcatalog/trunk/build.xml
    incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml
    incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1360361&r1=1360360&r2=1360361&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Wed Jul 11 19:21:05 2012
@@ -59,6 +59,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-447 findbugs target doesn't work in trunk (traviscrawford)
+
   HCAT-437 HCatSchema's equals() implementation uses hashcode obtained from toString() method.
(avandana)
 
   HCAT-438 HCatFieldSchema class does not have equals() method implementation (avandana)

Added: incubator/hcatalog/trunk/ant/findbugs.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/ant/findbugs.xml?rev=1360361&view=auto
==============================================================================
--- incubator/hcatalog/trunk/ant/findbugs.xml (added)
+++ incubator/hcatalog/trunk/ant/findbugs.xml Wed Jul 11 19:21:05 2012
@@ -0,0 +1,63 @@
+<?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>
+  <property name="findbugs.home" value=""/>
+
+  <macrodef name="_findbugs">
+    <attribute name="outputDir"/>
+    <attribute name="outputFile"/>
+    <attribute name="excludeFilter"/>
+    <attribute name="findbugsReportXmlFile"/>
+    <attribute name="findbugsReportHtmlFile"/>
+    <attribute name="sourceDir"/>
+    <attribute name="jarDir"/>
+    <attribute name="classPathRef"/>
+    <sequential>
+      <mkdir dir="@{outputDir}"/>
+      <findbugs
+          home="${findbugs.home}"
+          output="xml:withMessages"
+          outputFile="@{outputFile}"
+          effort="max"
+          timeout="2400000"
+          excludeFilter="@{excludeFilter}"
+          jvmargs="-Xmx1024M">
+        <auxClasspath>
+          <path refid="@{classPathRef}"/>
+        </auxClasspath>
+        <sourcePath path="@{sourceDir}"/>
+        <fileset dir="@{jarDir}">
+          <include name="**/hcatalog-*.jar"/>
+        </fileset>
+      </findbugs>
+      <xslt style="${findbugs.home}/src/xsl/default.xsl"
+            in="@{findbugsReportXmlFile}"
+            out="@{findbugsReportHtmlFile}"/>
+    </sequential>
+  </macrodef>
+
+  <target name="init-findbugs">
+    <available property="findbugs.present" file="${findbugs.home}/lib/findbugs.jar"/>
+    <fail message="'findbugs.home' is not defined. Please pass -Dfindbugs.home=&lt;base
of Findbugs installation&gt; to Ant on the command-line." unless="findbugs.present"/>
+    <taskdef name="findbugs"
+             classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
+             classpath="${findbugs.home}/lib/findbugs-ant.jar"/>
+  </target>
+</project>

Modified: incubator/hcatalog/trunk/build-common-new.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build-common-new.xml?rev=1360361&r1=1360360&r2=1360361&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build-common-new.xml (original)
+++ incubator/hcatalog/trunk/build-common-new.xml Wed Jul 11 19:21:05 2012
@@ -30,6 +30,13 @@
   <property name="test.warehouse.dir" location="${test.dir}/hcat_junit_warehouse"/>
   <property name="mvnrepo" value="http://repo2.maven.org/maven2"/>
 
+  <property name="findbugs.out.dir" location="${test.dir}/findbugs"/>
+  <property name="findbugs.exclude.file" value="${basedir}/src/test/findbugsExcludeFile.xml"/>
+  <property name="findbugs.report.htmlfile"
+    location="${findbugs.out.dir}/hcat-findbugs-report.html"/>
+  <property name="findbugs.report.xmlfile"
+    location="${findbugs.out.dir}/hcat-findbugs-report.xml"/>
+
   <macrodef name="_javac">
     <attribute name="srcDir"/>
     <attribute name="destDir"/>
@@ -119,4 +126,18 @@
     <jar jarfile="${build.dir}/${jar.name}" basedir="${build.classes}"/>
     <antcall target="ivy-publish"/>
   </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>
+
+  <import file="${basedir}/../ant/findbugs.xml"/>
 </project>

Modified: incubator/hcatalog/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build.xml?rev=1360361&r1=1360360&r2=1360361&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build.xml (original)
+++ incubator/hcatalog/trunk/build.xml Wed Jul 11 19:21:05 2012
@@ -465,36 +465,28 @@
   ================================================================================
   -->
 
-  <property name="findbugs.home" value=""/>
-
-  <target name="findbugs" depends="check-for-findbugs, jar" if="findbugs.present" description="Run
findbugs if present">
+  <target name="findbugs" depends="init-findbugs,jar">
     <property name="findbugs.out.dir" value="${test.build.dir}/findbugs"/>
     <property name="findbugs.exclude.file" value="${test.src.dir}/findbugsExcludeFile.xml"/>
-    <property name="findbugs.report.htmlfile" value="${findbugs.out.dir}/hcat-findbugs-report.html"/>
-    <property name="findbugs.report.xmlfile" value="${findbugs.out.dir}/hcat-findbugs-report.xml"/>
-    <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.home}/lib/findbugs-ant.jar"/>
-    <mkdir dir="${findbugs.out.dir}"/>
-    <findbugs home="${findbugs.home}" output="xml:withMessages" outputFile="${findbugs.report.xmlfile}"
effort="max" timeout="2400000" excludeFilter="${findbugs.exclude.file}" jvmargs="-Xmx1024M">
-      <auxClasspath>
-        <fileset dir="${build.ivy.lib.dir}">
-          <include name="**/*.jar"/>
-        </fileset>
-      </auxClasspath>
-      <sourcePath path="${src.dir}"/>
-      <fileset dir="${build.dir}/${ant.project.name}">
-        <include name="**/*.jar"/>
-      </fileset>
-    </findbugs>
-    <xslt style="${findbugs.home}/src/xsl/default.xsl" in="${findbugs.report.xmlfile}"
out="${findbugs.report.htmlfile}"/>
-  </target>
+    <property name="findbugs.report.htmlfile"
+      value="${findbugs.out.dir}/hcat-findbugs-report.html"/>
+    <property name="findbugs.report.xmlfile"
+      value="${findbugs.out.dir}/hcat-findbugs-report.xml"/>
+
+    <path id="findbugs.class.path">
+      <fileset dir="${ivy.lib.dir}"/>
+    </path>
+
+    <_findbugs outputDir="${findbugs.out.dir}"
+               outputFile="${findbugs.report.xmlfile}"
+               excludeFilter="${findbugs.exclude.file}"
+               findbugsReportXmlFile="${findbugs.report.xmlfile}"
+               findbugsReportHtmlFile="${findbugs.report.htmlfile}"
+               sourceDir="${src.dir}"
+               jarDir="${build.dir}/${ant.project.name}"
+               classPathRef="findbugs.class.path"/>
 
-  <target name="check-for-findbugs">
-    <available property="findbugs.present" file="${findbugs.home}/lib/findbugs.jar"/>
-  </target>
-
-  <target name="findbugs.check" depends="check-for-findbugs" unless="findbugs.present">
-     <fail message="'findbugs.home' is not defined. Please pass -Dfindbugs.home=&lt;base
of Findbugs installation&gt; 
-        to Ant on the command-line." />
+    <ant target="findbugs" dir="hcatalog-pig-adapter" inheritAll="false"/>
   </target>
 
   <!--
@@ -718,4 +710,6 @@
         <ant dir="${test.e2e.dir}" target="deploy"/>
     </target>
 
+  <import file="ant/findbugs.xml"/>
+
 </project>

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml?rev=1360361&r1=1360360&r2=1360361&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/build.xml Wed Jul 11 19:21:05 2012
@@ -23,7 +23,6 @@
   <path id="compile.class.path">
     <fileset dir="${build.dir}/ivy/default"/>
     <dirset dir="../build/classes"/>
-    <fileset dir="../build/ivy/lib/hcatalog"/>
   </path>
 
   <path id="test.class.path">
@@ -33,4 +32,15 @@
     <dirset dir="${basedir}/build/classes"/>
     <dirset dir="${basedir}/build/test/classes"/>
   </path>
+
+  <!-- Ideally we would simply use the "default" Ivy configuration jars; however,
+  hcatalog-core.jar is not yet available at build-time so we must explicitly add it.
+  -->
+  <path id="findbugs.class.path">
+    <fileset dir="${build.dir}/ivy/default"/>
+    <fileset dir="${basedir}/../build/hcatalog">
+      <include name="**/hcatalog-core-*.jar"/>
+    </fileset>
+  </path>
+
 </project>

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml?rev=1360361&r1=1360360&r2=1360361&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/ivy.xml Wed Jul 11 19:21:05 2012
@@ -26,10 +26,13 @@
 
   <configurations defaultconfmapping="default">
     <conf name="default"/>
-    <conf name="test" visibility="private"/>
+    <conf name="test" extends="default" visibility="private"/>
   </configurations>
 
   <dependencies>
+    <dependency org="org.apache.hadoop" name="hadoop-core" rev="${hadoop-core.version}"/>
+    <dependency org="org.apache.hive" name="hive-metastore" rev="${hive.version}"/>
+    <dependency org="org.apache.hive" name="hive-exec" rev="${hive.version}"/>
     <dependency org="org.apache.pig" name="pig" rev="${pig.version}"/>
     <dependency org="org.slf4j" name="slf4j-api" rev="${slf4j.version}"/>
     <dependency org="org.slf4j" name="slf4j-log4j12" rev="${slf4j.version}"/>
@@ -37,7 +40,5 @@
     <!-- Test dependencies -->
     <dependency org="org.apache.hive" name="hive-cli"
       rev="${hive.version}" conf="test->default"/>
-    <dependency org="org.apache.hive" name="hive-exec"
-      rev="${hive.version}" conf="test->default"/>
   </dependencies>
 </ivy-module>



Mime
View raw message