Skip to content
Permalink
Browse files
added rat-report ant task
  • Loading branch information
cyrillzadra committed May 17, 2013
1 parent 7d4c01c commit 32d87a53d1a93e216b1db317b48d8722755517be
Showing 1 changed file with 87 additions and 1 deletion.
@@ -1,6 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
<!--
Since we're eating our own dogfood here, our build process is a bit non-standard. Assuming
the following call should be made to run this script:
@@ -33,6 +48,21 @@ to contribute to our CI process.
<property name="flexcoverlistener.loc" location="${basedir}/FlexUnit4FlexCoverListener" />
<property name="turnkey.loc" location="${basedir}/FlexUnit4TurnKey" />
<property name="sampleCI.loc" location="${basedir}/FlexUnit4SampleCIProject" />

<!--
Optional jars but should be in place for a real release build.
For <rat> apache-rat-0.8.jar and apache-rat-tasks-0.8.jar should be in classpath.
See rat-report.
-->
<path id="anttask.classpath">
<fileset dir="${env.ANT_HOME}/lib">
<include name="**/apache-rat*.jar"/>
</fileset>
<fileset dir="${user.home}">
<include name=".ant/lib/**/apache-rat*.jar"/>
</fileset>
</path>

<!-- Cleans up all projects -->
<target name="clean">
@@ -267,4 +297,60 @@ to contribute to our CI process.
</zip>

</target>


<target name="rat-report" depends="rat-taskdef" if="have.rattasks"
description="Report on licenses in source kit.">

<property name="rat.dir" value="${basedir}"/>

<echo message="Checking files at ${rat.dir}, report is ${basedir}/rat.report"/>

<rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
reportFile="${basedir}/rat.report">
<fileset dir="${rat.dir}">
<!-- generated source files that don't have Apache v2 license header -->
<exclude name="**/build.number"/>
<exclude name="**/.actionScriptProperties"/>
<exclude name="**/.flexProperties"/>
<exclude name="**/.flexLibProperties"/>
<exclude name="**/.project"/>
<exclude name="**/.fxpProperties"/>
<exclude name="**/.settings/**"/>
<exclude name="**/.idea/**"/>
<exclude name="**/*.iml"/>
<!-- End of source files -->
<!-- Start of binary files -->
<!-- exclude media (png, ico) -->
<exclude name="**/*.ico"/>
<exclude name="**/*.png"/>
<!-- exclude fonts -->
<exclude name="**/*.ttf"/>
<!-- End of binary files -->
</fileset>
</rat:report>

</target>

<target name="rat-taskdef" description="Rat taskdef">
<available property="have.rattasks"
resource="org/apache/rat/anttasks/antlib.xml"
classpathref="anttask.classpath"/>

<antcall target="have-rattasks"/>
<antcall target="no-rattasks"/>
</target>

<target name="have-rattasks" if="have.rattasks">
<typedef resource="org/apache/rat/anttasks/antlib.xml"
uri="antlib:org.apache.rat.anttasks"
classpathref="anttask.classpath"/>
</target>

<target name="no-rattasks" unless="have.rattasks">
<echo message="Rat report not generated."/>
<echo message="rat jars (apache-rat-*.jar, apache-rat-tasks-*.jar)"/>
<echo message="not found in anttask.classpath"/>
</target>

</project>

0 comments on commit 32d87a5

Please sign in to comment.