ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Pogonyshev <p.pogonys...@finamatics.com>
Subject one more problem
Date Mon, 20 Feb 2006 13:28:13 GMT
Hi,

I'm stuck again :(

I need to translate the following part of a shell script to Ant (with
Ant-Contrib in place; using external `sed' is not an option, I want
to minimize dependencies for Windows boxes):


for PO_FILE in *.po; do
  LOCALE=$(echo "$PO_FILE" | sed -e 's/\.po$//')
  RESOURCE_FILE=$(echo "$RESOURCE_NAME" | sed -e "s/\./\//g")
  CLASS_FILE="$RESOURCE_DIRECTORY/${RESOURCE_FILE}_$LOCALE.class"

  if test "$CLASS_FILE" -ot "$PO_FILE"; then
    mkdir -p "$RESOURCE_DIRECTORY"/$(echo "$RESOURCE_NAME" | sed -e "s/^[^.]\+$//" -e "s/\.[^.]\+$//"
-e "s/\./\//g")
    msgfmt  --java2			\
	    --resource="$RESOURCE_NAME"	\
	    --locale="$LOCALE"		\
	    -d"$RESOURCE_DIRECTORY"	\
	    --check --statistics	\
	    "$PO_FILE"
  fi
done


I'm having problems with variable calculation.  RESOURCE_NAME in
the script has the form of `org.foo.bar.L10n', how do I compute
`org/foo/bar/L10n' out of it in Ant?

Also, I'd like to compute the locale out of file name, though
this is not important.

Thanks in advance,
  Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message