You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2013/07/06 13:32:46 UTC
svn commit: r1500242 - in /cayenne/main/trunk: build-tools/rat-excludes
rat.sh
Author: aadamchik
Date: Sat Jul 6 11:32:45 2013
New Revision: 1500242
URL: http://svn.apache.org/r1500242
Log:
shell script for rat
Added:
cayenne/main/trunk/rat.sh (contents, props changed)
- copied, changed from r1500220, cayenne/main/trunk/build-tools/rat-excludes
Removed:
cayenne/main/trunk/build-tools/rat-excludes
Copied: cayenne/main/trunk/rat.sh (from r1500220, cayenne/main/trunk/build-tools/rat-excludes)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/rat.sh?p2=cayenne/main/trunk/rat.sh&p1=cayenne/main/trunk/build-tools/rat-excludes&r1=1500220&r2=1500242&rev=1500242&view=diff
==============================================================================
--- cayenne/main/trunk/build-tools/rat-excludes (original)
+++ cayenne/main/trunk/rat.sh Sat Jul 6 11:32:45 2013
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
# 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.
@@ -13,14 +15,45 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Note that entries must be regex matching the file name
-# AFAIAK directory name matching is not supported
+#
+# Runs Rat checks on the source code. Prints report to STDOUT.
+#
+# Usage:
+#
+# ./rat.sh /path/to/apache-rat.jar > report.txt
+#
+
+DIR=`dirname "$0"`
+NAME=`basename "$0"`
+
+RAT="$@"
+if [[ -z $RAT ]]
+then
+ echo "*** No rat jar specified" 1>&2
+ exit 1
+fi
+
+if [[ ! -f $RAT ]]
+then
+ echo "*** $RAT is not a file" 1>&2
+ exit 1
+fi
+
+echo "Deleting 'target' dirs..." 1>&2
+( find $DIR -type d -name target | xargs rm -rf )
+
+echo "Running rat, this may take a while..." 1>&2
+
+java -jar $RAT -d $DIR \
+ -e '.classpath' \
+ -e '.project' \
+ -e '.gitignore' \
+ -e '_*.java' \
+ -e '*.plist' \
+ -e 'index.eomodeld' \
+ -e '*.map.xml' \
+ -e 'cayenne-*.xml' \
+ -e 'CLOVER.txt' \
+ -e 'derby.log'
+
-.+\.plist$
-.+\.graffle$
-^\.gitignore$
-^\.classpath$
-^\.project$
-CLOVER.txt$
-.+\.map.xml$
-_[^\/]+\.java$
Propchange: cayenne/main/trunk/rat.sh
------------------------------------------------------------------------------
svn:executable = *