[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 885
Date       : Tue Apr 25 21:27:12 BST 2006

Changed paths:
   A /Trunk/XaraLX/Scripts/build-resources.sh

Added static script to build resources.cpp


Diff:
Index: Trunk/XaraLX/Scripts/build-resources.sh
===================================================================
--- Trunk/XaraLX/Scripts/build-resources.sh	(revision 0)
+++ Trunk/XaraLX/Scripts/build-resources.sh	(revision 885)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# We should really only set TOPDIR if it's not already set to allow
+# out of tree builds
+TOPDIR=`pwd`
+
+# We should set this to 0
+NEWRES=1
+# A checksum routine - it doesn't much matter what it is
+CHECKSUM=md5sum
+ZIP=zip
+XARALANGUAGE=EN
+XGETTEXT=xgettext
+
+cd wxOil
+echo Testing for new resources... 1>&2
+if ( test ! -d xrc ) ; then mkdir xrc; fi;
+if ! [ -e xrc/xrc.d ] ; then touch xrc/xrc.d ; sleep 1 ; fi
+( find $TOPDIR/wxOil/xrc/$XARALANGUAGE -maxdepth 1 -name '*.xrc' ; find $TOPDIR/wxOil/xrc -maxdepth 1 -name '*.png' -or -name '*.ico' -or -name '*.cur' -or -name '*.bmp' -or -name '*.res' -or -name '*.xar' ) | perl -e 'while(<>) {chomp; s/
//; push @F, $_}; printf "xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst xrc/xaralx.po: xrc/xrc.stamp %s
",join (" ",sort @F);' > xrc/xrc.d.$$ ;
+if ( ! ( cmp -s xrc/xrc.d.$$ xrc/xrc.d) ) ; then touch xrc/xrc.stamp ; mv xrc/xrc.d.$$ xrc/xrc.d ; echo Found new resources 1>&2 ; else rm -f xrc/xrc.d.$$; fi ;
+if ! [ -e xrc/xrc.stamp ] ; then touch xrc/xrc.stamp ; fi
+
+# we should here go through all the files in xrc.d and check their dates
+
+if test "$NEWRES" -eq 1 ; then
+	echo "Rebuilding resources" 1>&2
+	rm -f xrc/xrc.check xrc/resources.xrs xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst 1>&2 2>/dev/null;
+
+	XRCDIALOGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ && $f!~/-strings\.xrc$/};print join(" ",@G)."
";' < xrc/xrc.d`
+	XRCSTRINGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ };print join(" ",@G)."
";' < xrc/xrc.d`
+	XRCBITMAPS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/\.(png|ico|cur|bmp|res|xar)$/};print join(" ",@G)."
";' < xrc/xrc.d`
+
+	echo "Combining dialog & string resources" 1>&2 && \
+	touch xrc/strings.xrc && \
+	$TOPDIR/Scripts/combinexrc.pl -b missing.png -o xrc/dialogs.xrc $XRCDIALOGS && \
+	$TOPDIR/Scripts/combinexrc.pl -b missing.png -t -s -o xrc/strings.lst $XRCSTRINGS && \
+	( perl -ne 'chomp;s/^\S+	//;print "_(\"$_\");
";' < xrc/strings.lst && @WXRC@ -g xrc/dialogs.xrc) | sort -u | \
+	perl -ne 'print unless /^_\(\"\"\)\;\s+$/;' | sed 's/&amp;/\&/g' | \
+	$XGETTEXT --force-po -k_ -C -i - --no-location --copyright-holder "Xara Group Ltd" --msgid-bugs-address=bugs@xxxxxxxx -d xaralx -o xrc/xaralx.po
+
+	echo "Generating resource checksum" 1>&2 && \
+	( cat xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst $XRCBITMAPS | $CHECKSUM | awk '{print $1}' > xrc/xrc.check ) && \
+	$ZIP -9 -j -q xrc/resources.xrs xrc/xrc.check xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst $XRCBITMAPS
+
+	$TOPDIR/Scripts/bin2cpp.pl -f CamResource::GetBinaryFileInfo xrc/resources.xrs resources.cpp
+fi

Property changes on: Trunk/XaraLX/Scripts/build-resources.sh
___________________________________________________________________
Name: svn:executable
   + *


Xara