Commit b689b2a1 authored by Maxime Perrotin's avatar Maxime Perrotin

use progress bar when generating skeletons

parent 6a899ca5
#!/bin/bash -e
#!/bin/bash
# $1 may be the interfaceview in AADL (optional if a file called InterfaceView.aadl is present)
# $2 is the output directory
# this script builds a unique dataview.aadl file and calls buildsupport with --gw --aadlv2 -o $2 --keep-case
# Initialise the progress bar
( cat ) | taste-progress-dialog.py &
log_pid=$!
# First check if an existing file is given as first argument (interface view)
# If not, check for the presence of a file called "InterfaceView.aadl".
# If no file is present or given, return an error with the command line.
......@@ -14,6 +18,8 @@ then
else
echo 'Error: interface view not found
Usage: [FORCE=1] taste-generate-skeletons [InterfaceView.aadl] [output-directory]'
# Must kill the cat command still running in the background to release TASTE GUI
kill $(pstree -p $(jobs -x echo %1) | grep cat | cut -d \( -f 3 | cut -d \) -f 1)
exit -1
fi
else
......@@ -28,6 +34,8 @@ grep -i taste-directives.aadl "$INTERFACEVIEW" >/dev/null && {
echo " taste-upgrade-IF-view oldIFview newIFview"
echo
echo ...and use the newIFview instead.
# Must kill the cat command still running in the background to release TASTE GUI
kill $(pstree -p $(jobs -x echo %1) | grep cat | cut -d \( -f 3 | cut -d \) -f 1)
exit 1
}
......@@ -51,6 +59,8 @@ then
If you want to force generation of the skeletons anyway, type:
$ FORCE=1 taste-generate-skeletons
'
# Must kill the cat command still running in the background to release TASTE GUI
kill $(pstree -p $(jobs -x echo %1) | grep cat | cut -d \( -f 3 | cut -d \) -f 1)
exit 0
fi
fi
......@@ -60,22 +70,36 @@ md5sum "$INTERFACEVIEW" > InterfaceView.md5
# Detect models from Ellidiss tools v2, and convert them to 1.3
grep "version => \"2" "$INTERFACEVIEW" >/dev/null && {
echo '[INFO] Converting interface view from V2 to V1.3'
echo '20 Analyse Interface View' > /proc/$log_pid/fd/0
cp -f "$INTERFACEVIEW" "$output_dir"/__interfaceview-v2.aadl
TASTE --load-interface-view "$output_dir"/__interfaceview-v2.aadl --export-interface-view-to-1_3 "$INTERFACEVIEW"
};
mkdir -p "$output_dir" 2>/dev/null && shift || output_dir=.
echo '[INFO] Collecting ASN.1 files'
echo '40 Collect and process ASN.1 models' > /proc/$log_pid/fd/0
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j "$output_dir"/dataview-uniq.asn
echo '[INFO] Generating AADL data view'
asn2aadlPlus "$output_dir"/dataview-uniq.asn "$output_dir"/dataview-uniq.aadl -aadlv2
asn2aadlPlus "$output_dir"/dataview-uniq.asn "$output_dir"/dataview-uniq-v1.aadl
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -k "$output_dir"/dataview-uniq.asn
echo '[INFO] Parsing AADL and generating skeletons with buildsupport'
echo '80 Generate code skeletons' > /proc/$log_pid/fd/0
buildsupport -i "$INTERFACEVIEW" -d "$output_dir"/dataview-uniq.aadl --gw --aadlv2 -o "$output_dir" --keep-case "$AADL_PROPERTIES" "$@"
if [ $? -eq 0 ]
then
echo '100 Done' > /proc/$log_pid/fd/0
ret=0
else
ret=1
fi
cp -f __interfaceview-v2.aadl "$INTERFACEVIEW" 2>/dev/null || :
rm -f "$output_dir"/dataview-uniq.asn "$output_dir"/dataview-uniq.aadl "$output_dir"/dataview-uniq-v1.aadl \
"$output_dir"/__interfaceview-v2.aadl
echo '100 Done' > /proc/$log_pid/fd/0
# Must kill the cat command still running in the background to release TASTE GUI
kill $(pstree -p $(jobs -x echo %1) | grep cat | cut -d \( -f 3 | cut -d \) -f 1)
exit $ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment