You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/04/18 16:05:07 UTC

[18/19] git commit: Add Apache Ant buildfile for use with Apache Rat

Add Apache Ant buildfile for use with Apache Rat

Signed-off-by: Peter Hartmann <pe...@apache.org>

Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/647759f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/647759f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/647759f2

Branch: refs/heads/master
Commit: 647759f217cd7028dee5d30146508b84bd7339db
Parents: 3b10e5d
Author: Peter Hartmann <pe...@apache.org>
Authored: Fri Apr 12 21:40:31 2013 +0200
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Apr 18 14:04:05 2013 +0000

----------------------------------------------------------------------
 rat-excludes.txt                                |   33 +++++++
 scripts/src-license-check/README.txt            |   24 +++++
 scripts/src-license-check/build.xml             |   34 ++++++++
 scripts/src-license-check/report_stylesheet.xsl |   81 ++++++++++++++++++
 4 files changed, 172 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/647759f2/rat-excludes.txt
----------------------------------------------------------------------
diff --git a/rat-excludes.txt b/rat-excludes.txt
new file mode 100644
index 0000000..b693ad8
--- /dev/null
+++ b/rat-excludes.txt
@@ -0,0 +1,33 @@
+rat-excludes.txt
+**/setup.cfg
+**/*.json
+requirements*
+**/MANIFEST.in
+Allura/allura/controllers/controller.template
+Allura/allura/etc/mime.types
+Allura/allura/lib/AsciiDammit.py
+Allura/allura/lib/widgets/resources/css/autocomplete.css
+Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+Allura/allura/lib/widgets/resources/js/jqfontselector.js
+Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
+Allura/allura/lib/widgets/resources/js/jquery.textarea.js
+Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
+Allura/allura/public/nf/css/blueprint/
+Allura/allura/public/nf/css/forge/accordion.css
+Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+Allura/allura/public/nf/js/jquery-base.js
+Allura/allura/public/nf/js/jquery.daterangepicker.js
+Allura/allura/public/nf/js/jquery.flot.js
+Allura/allura/public/nf/js/jquery.maxlength.min.js
+Allura/allura/public/nf/js/spin.min.js
+Allura/allura/tests/data/genshi_hello_tmpl
+Allura/allura/tests/data/test_mime/text_file.txt
+Allura/run/dummy.txt
+AlluraTesting/jslint/
+ForgeGit/forgegit/data/post-receive_tmpl
+ForgeGit/forgegit/tests/data/
+ForgeSVN/forgesvn/tests/data/
+solr_config/core0/conf/spellings.txt
+solr_config/core1/conf/spellings.txt
+solr_config/solr.xml

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/647759f2/scripts/src-license-check/README.txt
----------------------------------------------------------------------
diff --git a/scripts/src-license-check/README.txt b/scripts/src-license-check/README.txt
new file mode 100644
index 0000000..77743c1
--- /dev/null
+++ b/scripts/src-license-check/README.txt
@@ -0,0 +1,24 @@
+This is Apache Ant buildfile that can be used to do an automated license audit
+of the local Allura codebase. To use it, you need to:
+
+1. Install Apache Ant, version 1.8.0 or later. Apache Ant is very popular
+software package and there are good chances it is already available in your
+operating system's software repository. System-independent binary files are
+available from http://ant.apache.org/bindownload.cgi in case you need them.
+
+Be advised that Apache Ant requires Java Virtual Machine to work. For futher
+details, head to http://ant.apache.org/.
+
+2. Download and unpack Apache Rat. Apache Rat is a release audit tool (hence
+the name) used by Apache Software Foundation projects. It can be obtained from
+http://creadur.apache.org/rat/download_rat.cgi. After unpacking downloaded zip
+or tarball, you should have a directory with several .jar files and a lib/
+directory.
+
+3. Make the directory with buildfile (build.xml file) your working directory.
+Then execute `ant -lib [path to Apache Rat lib/ directory]`, for example:
+
+ant -lib ../../../apache-rat-0.8/lib/
+
+The buildfile will be parsed by Apache Ant and after a couple of seconds, you
+should be presented with a file list along with potential licensing issues.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/647759f2/scripts/src-license-check/build.xml
----------------------------------------------------------------------
diff --git a/scripts/src-license-check/build.xml b/scripts/src-license-check/build.xml
new file mode 100644
index 0000000..b02cb31
--- /dev/null
+++ b/scripts/src-license-check/build.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+       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.
+-->
+<project name="Allura" default="license-report"
+	xmlns="antlib:org.apache.tools.ant"
+	xmlns:rat="antlib:org.apache.rat.anttasks">
+	<target name="license-report" 
+		description="outputs report about license(s) found in source code">
+		<rat:report format="styled">
+			<fileset dir="../../">
+				<excludesfile name="../../rat-excludes.txt" />
+			</fileset>
+			<stylesheet>
+				<file file="report_stylesheet.xsl" />
+			</stylesheet>
+		</rat:report>
+	</target>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/647759f2/scripts/src-license-check/report_stylesheet.xsl
----------------------------------------------------------------------
diff --git a/scripts/src-license-check/report_stylesheet.xsl b/scripts/src-license-check/report_stylesheet.xsl
new file mode 100644
index 0000000..051c858
--- /dev/null
+++ b/scripts/src-license-check/report_stylesheet.xsl
@@ -0,0 +1,81 @@
+<?xml version='1.0' ?>
+<!--
+ 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.                                           *
+-->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method='text'/>
+<xsl:template match='/'>
+*****************************************************
+Summary
+-------
+Generated at: <xsl:value-of select='rat-report/@timestamp'/>
+Notes: <xsl:value-of select='count(descendant::type[attribute::name="notice"])'/>
+Binaries: <xsl:value-of select='count(descendant::type[attribute::name="binary"])'/>
+Archives: <xsl:value-of select='count(descendant::type[attribute::name="archive"])'/>
+Standards: <xsl:value-of select='count(descendant::type[attribute::name="standard"])'/>
+
+Apache Licensed: <xsl:value-of select='count(descendant::header-type[attribute::name="AL   "])'/>
+Generated Documents: <xsl:value-of select='count(descendant::header-type[attribute::name="GEN  "])'/>
+
+Generated files do not required license headers
+
+<xsl:value-of select='count(descendant::header-type[attribute::name="?????"])'/> Unknown Licenses
+
+*******************************
+
+Unapproved licenses:
+
+<xsl:for-each select='descendant::resource[license-approval/@name="false"]'>
+  <xsl:text>  </xsl:text>
+  <xsl:value-of select='@name'/>
+  <xsl:text>
+</xsl:text>
+</xsl:for-each>
+*******************************
+
+Archives:
+<xsl:for-each select='descendant::resource[type/@name="archive"]'>
+ + <xsl:value-of select='@name'/>
+ <xsl:text>
+ </xsl:text>
+ </xsl:for-each>
+*****************************************************
+  Files with Apache License headers will be marked AL
+  Binary files (which do not require AL headers) will be marked B
+  Compressed archives will be marked A
+  Notices, licenses etc will be marked N
+ <xsl:for-each select='descendant::resource'>
+  <xsl:choose>
+	 <xsl:when test='license-approval/@name="false"'>!</xsl:when>
+	 <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+	 <xsl:when test='type/@name="notice"'>N    </xsl:when>
+	 <xsl:when test='type/@name="archive"'>A    </xsl:when>
+	 <xsl:when test='type/@name="binary"'>B    </xsl:when>
+	 <xsl:when test='type/@name="standard"'><xsl:value-of select='header-type/@name'/></xsl:when>
+	 <xsl:otherwise>!!!!!</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select='@name'/>
+ <xsl:text>
+ </xsl:text>
+ </xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file