velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkien...@apache.org
Subject svn commit: r1683214 - in /velocity/engine/branches/1.x/build: build.properties build.xml download.xml
Date Wed, 03 Jun 2015 03:18:31 GMT
Author: mkienenb
Date: Wed Jun  3 03:18:31 2015
New Revision: 1683214

URL: http://svn.apache.org/r1683214
Log:
VELOCITY-864: Download and install Apache Rat task in preparation target for "ant rat"

Modified:
    velocity/engine/branches/1.x/build/build.properties
    velocity/engine/branches/1.x/build/build.xml
    velocity/engine/branches/1.x/build/download.xml

Modified: velocity/engine/branches/1.x/build/build.properties
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.x/build/build.properties?rev=1683214&r1=1683213&r2=1683214&view=diff
==============================================================================
--- velocity/engine/branches/1.x/build/build.properties (original)
+++ velocity/engine/branches/1.x/build/build.properties Wed Jun  3 03:18:31 2015
@@ -52,6 +52,8 @@ build.test=      ${build.dir}/test
 build.test.reports= ${build.dir}/test-reports
 build.docs=      ${build.dir}/docs
 
+run.rat.lib=     ${build.dir}/rat-lib
+
 # Various local pathes in the distribution
 src.java.dir=  ${velocity.dir}/src/java
 src.parser.dir = ${velocity.dir}/src/parser
@@ -121,6 +123,7 @@ proxy.port= 80
 # We download directly from the ibiblio maven repository
 repo.m1.url= http://mirrors.ibiblio.org/maven2
 repo.m2.url=http://mirrors.ibiblio.org/maven2
+repo.maven2-central.url=http://central.maven.org/maven2
 #
 # Jars to be downloaded
 jar.antlr.version= 2.7.5
@@ -133,6 +136,7 @@ jar.log4j.version= 1.2.12
 jar.oro.version= 2.0.8
 jar.servletapi.version= 2.3
 jar.werken-xpath.version= 0.9.4
+jar.rat.version= 0.11
 
 jar.hsqldb.version= 1.7.1
 jar.junit.version= 3.8.1

Modified: velocity/engine/branches/1.x/build/build.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.x/build/build.xml?rev=1683214&r1=1683213&r2=1683214&view=diff
==============================================================================
--- velocity/engine/branches/1.x/build/build.xml (original)
+++ velocity/engine/branches/1.x/build/build.xml Wed Jun  3 03:18:31 2015
@@ -1317,16 +1317,21 @@ import org.apache.velocity.runtime.parse
   <!-- =================================================================== -->
   <!-- Analyze code with Apache RAT                                        -->
   <!-- =================================================================== -->
-  <target name="rat" depends="package-tgz"
+  <target name="apache-rat-prepare">
+    <ant antfile="${velocity.build.dir}/download.xml" target="run-rat-download" />
+
+    <taskdef
+        uri="antlib:org.apache.rat.anttasks"
+        resource="org/apache/rat/anttasks/antlib.xml">
+        <classpath>
+            <pathelement location="${run.rat.lib}/apache-rat-${jar.rat.version}.jar"/>
+        </classpath>
+    </taskdef>
+  </target>
+
+  <target name="rat" depends="package-tgz,apache-rat-prepare"
     description="Runs Apache RAT against the source code.">
-    <!-- TODO: download RAT and deps -->
-    <echo>
-      NOTE: At this time, you must add Apache RAT, Apache RAT AntTasks
-      Commons-Lang, Commons-Collections and Commons-CLI to Ant's lib directory
-      to use this.
-    </echo>
     <mkdir dir="${build.test.reports}"/>
-    <typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks"/>
     <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
       reportFile="${build.test.reports}/rat-report.txt">
       <tarfileset>

Modified: velocity/engine/branches/1.x/build/download.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.x/build/download.xml?rev=1683214&r1=1683213&r2=1683214&view=diff
==============================================================================
--- velocity/engine/branches/1.x/build/download.xml (original)
+++ velocity/engine/branches/1.x/build/download.xml Wed Jun  3 03:18:31 2015
@@ -47,6 +47,11 @@
    <antcall target="junit-download" />
   </target>
 
+  <target name="run-rat-download" description="Download rat and dependencies from the
central repository">
+   <mkdir dir="${run.rat.lib}" />
+   <antcall target="apache-rat-download" />
+  </target>
+
   <target name="http-m1-download">
     <condition property="skip-download">
       <or>
@@ -113,6 +118,28 @@
          ignoreerrors="false" />
   </target>
 
+  <target name="http-rat-maven-central-download">
+    <condition property="skip-download">
+      <or>
+        <istrue value="${skip.jar.loading}"/>
+        <and>
+          <isfalse value="${force.jar.loading}"/>
+          <available file="${run.rat.lib}/${download.artifactId}-${download.version}.jar"/>
+        </and>
+      </or>
+    </condition>
+    <antcall target="do-http-rat-maven-central-download"/>
+  </target>
+
+  <target name="do-http-rat-maven-central-download" unless="skip-download">
+    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
+    <get src="${repo.maven2-central.url}/${download.groupId}/${download.artifactId}/${download.version}/${download.artifactId}-${download.version}.jar"
+         dest="${run.rat.lib}/${download.artifactId}-${download.version}.jar"
+         usetimestamp="true"
+         verbose="false"
+         ignoreerrors="false" />
+  </target>
+
   <target name="antlr-download">
    <property name="download.groupId" value="antlr" />
    <property name="download.artifactId" value="antlr" />
@@ -209,5 +236,14 @@
   </target>
 
 
+  <!-- Apache rat related dependencies -->
+
+   <target name="apache-rat-download">
+	<property name="download.groupId" value="org/apache/rat" />
+	<property name="download.artifactId" value="apache-rat" />
+	<property name="download.version" value="${jar.rat.version}" />
+	<antcall target="http-rat-maven-central-download"/>
+   </target>
+
 </project>
 



Mime
View raw message