dev@javaserverfaces.java.net

Improvement of the changebundle generation script

From: Manuel Bernhardt <bernhardt.manuel_at_gmail.com>
Date: Wed, 22 Sep 2010 18:21:40 +0200

Hi,

I'm a bit annoyed by having to edit the generated changebundle.txt by
hand after each generation and remove e.g. the modified IDE files.

Here's a patch that allows to exclude specific files by adding them in
a "cb-excludes.txt" file at the root of the project. I tested this on
linux and os x. For windows though there's a need to tweak the .bat
script, but I guess this is a start.
Note that this will only work if the cb-excludes.txt file exists (so
it would need to be there by default, I for now added some Idea files
that got modified on my machine).

Manuel


SECTION: Modified Files
----------------------------
M common/ant/bin/cb.sh

A cb-excludes.txt


SECTION: Diffs
----------------------------
Index: common/ant/bin/cb.sh
===================================================================
--- common/ant/bin/cb.sh (revision 8615)
+++ common/ant/bin/cb.sh (working copy)
@@ -43,12 +43,13 @@

 FILE=/tmp/lmtxt
 CB=$PWD/changebundle.txt
+EXCLUDES=$PWD/cb-excludes.txt
 DIFF=/tmp/diff.txt
 ZIP=newfiles.zip

 echo "Scanning for modifications..."

-svn status > $FILE 2>&1
+svn status | grep -v -f $EXCLUDES > $FILE 2>&1

 modifiedFiles=`grep ^"M " $FILE`
 addedFiles=`grep ^"A " $FILE`
@@ -93,7 +94,7 @@
     if [ -n "$modifiedFiles" ]; then
         echo "SECTION: Diffs" >> $CB
         echo "----------------------------" >> $CB
- svn diff > $DIFF
+ svn diff `grep ^"M " $FILE | cut -c8-` > $DIFF
         grep -v ^\? $DIFF >> $CB
     fi

Index: cb-excludes.txt
===================================================================
--- cb-excludes.txt (revision 0)
+++ cb-excludes.txt (revision 0)
@@ -0,0 +1,4 @@
+Mojarra-2.0.ipr
+Mojarra-2.0.iws
+jsf-ri/impl.iml
+jsf-demo/demo.iml