Ignore:
Timestamp:
05/28/12 23:47:41 (9 years ago)
Author:
davidb
Message:

Improved reporting of what processing was undertaken, and other adjustments to make the scripts work on Cygwin under Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gli-rsyntax-textarea/REGENERATE-FLEX.sh

    r25680 r25684  
    11#!/bin/bash
    22
    3 pushd src/java/org/fife/ui/rsyntaxtextarea/modes/
     3pushd src/java/org/fife/ui/rsyntaxtextarea/modes/ > /dev/null
     4
     5
     6editedFlex=0;
     7unchangedFlex=0;
     8
     9flex_jar=$GEXTRSYNTAX/lib/JFlex.jar
     10
     11if [ "x$GSDLOS" = "xcygwin" ] ; then
     12  flex_jar=`cygpath -w $flex_jar | sed 's/\\\\/\\\\\\\\/g'`
     13elif [ "x$GSDLOS" = "xmingw" ] ; then
     14  flex_jar=`echo $flex_jar | sed 's/^\/\(.\)/\1:/' | sed 's@/@\\\\@g'`
     15fi
    416
    517
    618for f in *.flex ; do
    7   echo "Checking $f ..."
    8   if [ $f -nt ${f%.*}.java ] ; then
    9     jflex $f
    10     echo "... regenerated"
     19#  echo "Checking $f ..."
     20  j="${f%.*}.java"
     21  if [ "$f" -nt "$j" ] ; then
     22    echo ""
     23    echo "****"
     24    echo "* Regenerating $f"
     25    echo "****"
     26    echo ""
     27
     28    java -cp "$flex_jar" JFlex.Main $f
     29    #bash -x jflex $f
     30
     31    cat $j \
     32      | sed 's/yyreset/YYRESETOLD/g' \
     33      | sed 's/YYRESETNEW/yyreset/g' \
     34      | sed 's/zzRefill/YYREFILLOLD/g' \
     35      | sed 's/ZZREFILLNEW/zzRefill/g' \
     36      > $j.new   
     37
     38    /bin/mv $j.new $j
     39    ((editedFlex +=1))
     40
    1141  else
    12     echo "... does not need to be regenerated"
     42#    echo "... does not need to be regenerated"
     43    ((unchangedFlex +=1))
    1344  fi
    1445
     
    1647done
    1748
    18 popd
     49echo "===="
     50echo "$unchangedFlex Flex files unchanged"
     51echo ""
     52
     53if [ $editedFlex -ge "1" ] ; then
     54  echo ""
     55  echo "****"
     56  echo "* $editedFlex flex file(s) regenerated."
     57  echo "* Use ./COMPILE.sh to recompile the modified code and regenerate the jar file"
     58  echo "****"
     59  echo ""
     60fi
     61
     62popd > /dev/null
     63
Note: See TracChangeset for help on using the changeset viewer.