#!/bin/sh
set -C -e -f -u

TOP_SOURCE_DIR=`pwd`
cd "$ADTTMP"

cat > p.gpr <<EOF
with "xmlada";
project P is
   for Source_Dirs use ("$TOP_SOURCE_DIR/docs/dom");
   for Main use ("domexample.adb");
end P;
EOF

gprbuild p.gpr

# domexample needs pref.xml in the current directory.
cd "$TOP_SOURCE_DIR/docs/dom"
"$ADTTMP/domexample"
