Browse Source

HADOOP-2509. Add Ant target for Rat report. Contributed by Hrishikesh

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@612957 13f79535-47bb-0310-9956-ffa450edef68
Nigel Daley 17 years ago
parent
commit
f68828f71d
2 changed files with 20 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 17 0
      build.xml

+ 3 - 0
CHANGES.txt

@@ -263,6 +263,9 @@ Trunk (unreleased changes)
     HADOOP-2298. Add Ant target for a binary-only distribution.
     (Hrishikesh via nigel)
 
+    HADOOP-2509. Add Ant target for Rat report (Apache license header
+    reports).  (Hrishikesh via nigel)
+
   OPTIMIZATIONS
 
     HADOOP-1898.  Release the lock protecting the last time of the last stack

+ 17 - 0
build.xml

@@ -94,7 +94,10 @@
   <property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
   <property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
 
+  <property name="rat.reporting.classname" value="rat.Report"/>
+
   <available property="clover.present" classname="com.cenqua.clover.tasks.CloverReportTask" />
+
   <!-- check if clover reports should be generated -->
   <condition property="clover.enabled">
     <and>
@@ -130,6 +133,9 @@
     <pathelement location="${build.dir}"/>
   </path>
 
+  <!-- properties dependent on the items defined above. -->
+  <available classname="${rat.reporting.classname}" classpathref="classpath" property="rat.present" value="true"/>
+
   <!-- ====================================================== -->
   <!-- Macro definitions                                      -->
   <!-- ====================================================== -->
@@ -800,6 +806,17 @@
     </macro_tar>
   </target>
 
+  <!-- ================================================================== -->
+  <!-- Perform audit activities for the release                           -->
+  <!-- ================================================================== -->
+  <target name="releaseaudit" depends="package" description="Release Audit activities">
+    <fail unless="rat.present" message="Failed to load class [${rat.reporting.classname}]. Download the latest rat jar from [http://code.google.com/p/arat] and copy it to [${lib.dir}]. Typically the file name will be of format rat-x.y.z.jar"/>
+    <java classname="${rat.reporting.classname}" fork="true">
+      <classpath refid="classpath"/>
+      <arg value="${build.dir}/${final.name}"/>
+    </java>
+  </target>
+
   <!-- ================================================================== -->
   <!-- Clean.  Delete the build files, and their directories              -->
   <!-- ================================================================== -->