You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by bo...@apache.org on 2011/07/19 06:07:55 UTC

svn commit: r1148145 - in /incubator/rat/main/trunk/apache-rat-tasks/src: main/java/org/apache/rat/anttasks/Report.java site/apt/report.apt site/site.xml

Author: bodewig
Date: Tue Jul 19 04:07:54 2011
New Revision: 1148145

URL: http://svn.apache.org/viewvc?rev=1148145&view=rev
Log:
basic documentation of the report task

Added:
    incubator/rat/main/trunk/apache-rat-tasks/src/site/apt/report.apt
Modified:
    incubator/rat/main/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
    incubator/rat/main/trunk/apache-rat-tasks/src/site/site.xml

Modified: incubator/rat/main/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java?rev=1148145&r1=1148144&r2=1148145&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java (original)
+++ incubator/rat/main/trunk/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java Tue Jul 19 04:07:54 2011
@@ -146,7 +146,7 @@ public class Report extends Task {
     }
 
     /**
-     * Wether to add license headers.
+     * Whether to add license headers.
      */
     public void setAddLicenseHeaders(AddLicenseHeaders pAdd) {
         if (pAdd == null) {

Added: incubator/rat/main/trunk/apache-rat-tasks/src/site/apt/report.apt
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-tasks/src/site/apt/report.apt?rev=1148145&view=auto
==============================================================================
--- incubator/rat/main/trunk/apache-rat-tasks/src/site/apt/report.apt (added)
+++ incubator/rat/main/trunk/apache-rat-tasks/src/site/apt/report.apt Tue Jul 19 04:07:54 2011
@@ -0,0 +1,104 @@
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~ Licensed 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.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+                -----
+                The Report Task
+                -----
+
+Report Task
+
+  The Report task is the heart of the Apache RAT Ant Task Library, it
+  runs RAT on a given set of resources and generates the report.
+
+  The task can work on any Ant
+  {{{http://ant.apache.org/manual/Types/resources.html}resource or
+  resource collection}} and the usual Ant selector can be applied to
+  restrict things even further.
+
+  Reports can be RAT's internal XML or plain text format or be styled
+  by a custon XSLT stylesheet.
+
+  It is possible to define custom matchers for licenses not supported
+  by RAT via nested elements to the Report task.
+
+Attributes of the Task
+
+*-------------------------*-------------------------------+
+|Name                     |Description                    |
+*-------------------------*-------------------------------+
+| reportFile | Name of the file to write the report to.  If ommitted the report will be sent to Ant's logging system instead.
+*-------------------------*-------------------------------+
+| format | The format to use for the report.
+| | Choices are <<<xml>>> for RAT's XML format,
+| | <<<plain>>> for plain text using RAT's built-in stylesheet,
+| | <<<styled>>> transforms the XML output using the given stylesheet. The stylesheet nested element must be set as well if this attribute is used. 
+| | Defaults to <<<plain>>>|
+*-------------------------*-------------------------------+
+| addDefaultLicenseMatchers | Whether to use RAT's built-in set of license matchers in addition to those specified as nested elements.
+| |Boolean, Defaults to <<<true>>>|
+*-------------------------*-------------------------------+
+| addLicenseHeaders | Whether to add license headers to files that don't have one.
+| | Choices are <<<true>>>, <<<false>>> and <<<forced>>> where <<<forced>>> would add a license even if RAT already found one.
+| | Defaults to <<<false>>>|
+*-------------------------*-------------------------------+
+
+Nested Elements
+
+* Resources
+
+  The files to be checked by RAT are specified as a nested
+  {{{http://ant.apache.org/manual/Types/resources.html} resource
+  (collection)}}, the most basic one would probably be a
+  {{{http://ant.apache.org/manual/Types/fileset.html} fileset}}.
+
+  For example the following would check all Java files in the
+  <<<src>>> directory.
+
+---
+<rat:report>
+  <fileset dir="src" includes="**/*.java"/>
+</rat:report>
+---
+
+* Stylesheet
+
+  If the <<<format>>> attribute has been set to <<<styled>>> the XSLT
+  stylesheet to apply is specified as a nested resource element.  For
+  example
+ 
+---
+<rat:report format="styled" reportFile="rat-report.html">
+  ...
+  <stylesheet>
+    <file file="my/rat-xml-2-html.xslt"/>
+  </stylesheet>
+</rat:report>
+---
+
+* License Matchers
+
+  Any defined Ant type that implements the <<<IHeaderMatcher>>>
+  interface can be used as nested element to provide a matcher to RAT.
+
+  The Ant library already contains types for the built-in license
+  matchers but you can define your own classes for custom matchers.
+
+* License Families
+
+  Any defined Ant type that implements the <<<ILicenseFamily>>>
+  interface can be used as nested element to provide a license family
+  to RAT.
+
+  The Ant library already contains types for the built-in license
+  families but you can define your own classes for custom families.

Modified: incubator/rat/main/trunk/apache-rat-tasks/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-tasks/src/site/site.xml?rev=1148145&r1=1148144&r2=1148145&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-tasks/src/site/site.xml (original)
+++ incubator/rat/main/trunk/apache-rat-tasks/src/site/site.xml Tue Jul 19 04:07:54 2011
@@ -19,6 +19,7 @@
     <menu ref="parent"/>
     <menu name="Overview">
       <item name="Introduction" href="index.html"/>
+      <item name="Report Task" href="report.html"/>
     </menu>
     <menu ref="reports"/>
   </body>