You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2016/08/14 12:24:33 UTC
svn commit: r1756315 - in /jmeter/trunk: build.properties build.xml
Author: sebb
Date: Sun Aug 14 12:24:33 2016
New Revision: 1756315
URL: http://svn.apache.org/viewvc?rev=1756315&view=rev
Log:
Add RAT check target
Modified:
jmeter/trunk/build.properties
jmeter/trunk/build.xml
Modified: jmeter/trunk/build.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/build.properties?rev=1756315&r1=1756314&r2=1756315&view=diff
==============================================================================
--- jmeter/trunk/build.properties (original)
+++ jmeter/trunk/build.properties Sun Aug 14 12:24:33 2016
@@ -383,3 +383,14 @@ checkstyle-all.version = 6.13
checkstyle-all.jar = checkstyle-${checkstyle-all.version}-all.jar
checkstyle-all.loc = http://downloads.sourceforge.net/checkstyle/checkstyle/${checkstyle-all.version}/checkstyle-${checkstyle-all.version}-all.jar?ts=${EPOCHSECONDS}&use_mirror=autoselect
checkstyle-all.md5 = ac6e1e81d09bcaf4c0c22181e9bda1d9
+
+# Optional for use by rat
+rat.version = 0.12
+rat.jar = apache-rat-${rat.version}.jar
+rat.loc = ${maven2.repo}/org/apache/rat/apache-rat/${rat.version}
+rat.md5 = f4cc7b4de337e9f250a949467c5e1b42
+
+rat-tasks.jar = apache-rat-tasks-${rat.version}.jar
+rat-tasks.loc = ${maven2.repo}/org/apache/rat/apache-rat-tasks/${rat.version}
+rat-tasks.md5 = 96b699581b4475ed5756a0c24af745e8
+
Modified: jmeter/trunk/build.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/build.xml?rev=1756315&r1=1756314&r2=1756315&view=diff
==============================================================================
--- jmeter/trunk/build.xml (original)
+++ jmeter/trunk/build.xml Sun Aug 14 12:24:33 2016
@@ -15,7 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project name="JMeter" default="install" basedir=".">
+<project name="JMeter" default="install" basedir="."
+ xmlns:rat="antlib:org.apache.rat.anttasks"
+ xmlns="antlib:org.apache.tools.ant">
<description>
N.B. To build JMeter from a release you need both the binary and source archives,
@@ -899,7 +901,7 @@
<target name="package" depends="compile, prepare-resources, package-only"
description="Compile everything and create the jars"/>
- <target name="package-and-check" depends="clean, package, checkstyle"
+ <target name="package-and-check" depends="clean, package, checkstyle, rat"
description="Compile, create jars and apply checkstyle before commiting code"/>
<target name="prepare-resources"
@@ -3025,6 +3027,11 @@ run JMeter unless all the JMeter jars ar
<process_jarfile jarname="checkstyle-all" dest.dir="${lib.opt}"/>
</target>
+ <target name="_process_rat_jars">
+ <process_jarfile jarname="rat" dest.dir="${lib.opt}"/>
+ <process_jarfile jarname="rat-tasks" dest.dir="${lib.opt}"/>
+ </target>
+
<!-- Update a jar (clean, download, package in one shot.-->
<target name="update_jar" depends="clean, download_jars, package">
</target>
@@ -3068,6 +3075,14 @@ run JMeter unless all the JMeter jars ar
</antcall>
</target>
+ <target name="download_rat">
+ <!-- build.dir may be needed as a temporary work area -->
+ <mkdir dir="${build.dir}" />
+ <antcall target="_process_rat_jars">
+ <param name="_get_file" value="true"/>
+ </antcall>
+ </target>
+
<target name="_check_exists" if="_check_exists">
<fail message="Invalid call sequence - file.exists should not be defined" if="file.exists"/>
<available file="${file}" property="file.exists"/>
@@ -3143,6 +3158,32 @@ run JMeter unless all the JMeter jars ar
</target>
+ <target name="rat">
+ <available property="rat.jar.available" file="${lib.opt}/apache-rat-tasks-${rat.version}.jar"/>
+ <fail message="This task requires Apache Creadur RAT, please run download_rat target to download it" unless="rat.jar.available"/>
+ <taskdef
+ uri="antlib:org.apache.rat.anttasks"
+ resource="org/apache/rat/anttasks/antlib.xml">
+ <classpath>
+ <pathelement location="${lib.opt}/apache-rat-${rat.version}.jar"/>
+ <pathelement location="${lib.opt}/apache-rat-tasks-${rat.version}.jar"/>
+ <!--pathelement location="${lib.dir}/${commons-io.jar}"/-->
+ </classpath>
+ </taskdef>
+ <rat:report reportfile="reports/rat-report.txt">
+ <fileset dir="." excludesfile="rat-excludes.txt"/>
+ </rat:report>
+ <loadfile property="rat-errors" srcFile="reports/rat-report.txt">
+ <filterchain>
+ <linecontains>
+ <contains value="Unknown"/>
+ </linecontains>
+ </filterchain>
+ </loadfile>
+ <echo message="reports/rat-report.txt:"/>
+ <echo message="${rat-errors}"/>
+ </target>
+
<target name="sign_dist"
description="Sign release artifacts in dist and dist/maven. Usage: ant sign_dist -Dgpg.keyname=key-id [-Dgpg.secretKeyring=path-to-keyring] ">
<scriptdef name="gpg" language="beanshell">