hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1309676 - in /hive/trunk: build.xml ivy.xml ivy/libraries.properties
Date Thu, 05 Apr 2012 07:33:55 GMT
Author: hashutosh
Date: Thu Apr  5 07:33:55 2012
New Revision: 1309676

URL: http://svn.apache.org/viewvc?rev=1309676&view=rev
Log:
HIVE-2879 : Add rat target to build to look for missing license headers (Owen Omalley via
Ashutosh Chauhan)

Modified:
    hive/trunk/build.xml
    hive/trunk/ivy.xml
    hive/trunk/ivy/libraries.properties

Modified: hive/trunk/build.xml
URL: http://svn.apache.org/viewvc/hive/trunk/build.xml?rev=1309676&r1=1309675&r2=1309676&view=diff
==============================================================================
--- hive/trunk/build.xml (original)
+++ hive/trunk/build.xml Thu Apr  5 07:33:55 2012
@@ -20,7 +20,8 @@
 
 <project name="hive" default="jar"
          xmlns:ivy="antlib:org.apache.ivy.ant"
-         xmlns:artifact="urn:maven-artifact-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"/>
@@ -54,6 +55,7 @@
   <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 -->
@@ -770,6 +772,80 @@
 
 
   <!-- ================================================================== -->
+  <!-- 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="data/files/*.seq"/>
+	   <exclude name="**/data/files/*.log"/>
+           <exclude name="**/*.txt"/>
+           <exclude name="**/test/results/**/*.xml"/>
+
+           <!-- 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                                                         -->
   <!-- ================================================================== -->
 

Modified: hive/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/hive/trunk/ivy.xml?rev=1309676&r1=1309675&r2=1309676&view=diff
==============================================================================
--- hive/trunk/ivy.xml (original)
+++ hive/trunk/ivy.xml Thu Apr  5 07:33:55 2012
@@ -27,11 +27,16 @@
     <!-- Private configurations -->
     <conf name="docs" visibility="private"/>
     <conf name="checkstyle" visibility="private"/>
+    <conf name="rat" visibility="private"/>
     <conf name="maven" visibility="private"/>
   </configurations>
 
 
   <dependencies>
+   <dependency org="org.apache.rat" name="apache-rat-tasks"
+               rev="${rat.version}" conf="rat->default"/>
+   <dependency org="org.apache.rat" name="apache-rat-core"
+               rev="${rat.version}" conf="rat->default"/>
    <dependency org="checkstyle" name="checkstyle" rev="${checkstyle.version}"
      conf="checkstyle->default"/>
    <dependency org="org.jdom" name="jdom" rev="${jdom.version}"

Modified: hive/trunk/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/hive/trunk/ivy/libraries.properties?rev=1309676&r1=1309675&r2=1309676&view=diff
==============================================================================
--- hive/trunk/ivy/libraries.properties (original)
+++ hive/trunk/ivy/libraries.properties Thu Apr  5 07:33:55 2012
@@ -51,6 +51,7 @@ libthrift.version=0.7.0
 log4j.version=1.2.16
 maven-ant-tasks.version=2.1.0
 mockito-all.version=1.8.2
+rat.version=0.8
 slf4j-api.version=1.6.1
 slf4j-log4j12.version=1.6.1
 velocity.version=1.5



Mime
View raw message