taste-create-project 1.61 KB
Newer Older
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
1
#!/bin/bash -e
Maxime Perrotin's avatar
Maxime Perrotin committed
2 3
echo 'TASTE Project Creator'

Maxime Perrotin's avatar
Maxime Perrotin committed
4
if [ -t 1 ] ; then
Maxime Perrotin's avatar
Maxime Perrotin committed
5 6 7 8 9 10 11 12 13 14 15 16
    COLORON="\e[1m\e[32m"
    REDCOLORON="\e[1m\e[31m"
    COLOROFF="\e[0m"
else
    COLORON=""
    REDCOLORON=""
    COLOROFF=""
fi

INFO="${COLORON}[INFO]${COLOROFF}"
ERROR="${REDCOLORON}[ERROR]${COLOROFF}"

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
17 18 19

if [ -f InterfaceView.aadl ]
then
Maxime Perrotin's avatar
Maxime Perrotin committed
20 21
    echo -e "${ERROR} InterfaceView.aadl already exists. Use taste-edit-project instead."
    exit 1
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
22 23 24 25
fi

if [ ! -f DataView.aadl ]
then
Maxime Perrotin's avatar
Maxime Perrotin committed
26
    echo -e "${INFO} Creating a default ASN.1 data model."
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
27 28 29
    NONINTERACTIVE=1 taste-create-data-view
    NONINTERACTIVE=1 taste-create-acn-model
else
Maxime Perrotin's avatar
Maxime Perrotin committed
30
    echo -e "${INFO} Using existing DataView.aadl"
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
31 32
fi

Maxime Perrotin's avatar
Maxime Perrotin committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
# Add the components from the components library
FIRST=1
LIBDIR=$(taste-config --prefix)/share/components_library
for each in $LIBDIR/*
do
    if [ $FIRST -eq 1 ]
    then
        EXTRA_CMD+='--edit-aadl '
    else
        EXTRA_CMD+=,
    fi
    EXTRA_CMD+=$each/interfaceview.aadl
    FIRST=0
done

Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
48
# Invoke the GUI from Ellidiss
49 50 51 52 53 54
echo -e "${INFO} Running "
echo "    TASTE $EXTRA_CMD
          --data-view DataView.aadl 
          --load-interface-view InterfaceView.aadl 
          --load-deployment-view DeploymentView.aadl 
          --aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl
55
          --update-properties ConcurrencyView_Properties.aadl
56 57
"

Maxime Perrotin's avatar
Maxime Perrotin committed
58 59
TASTE $EXTRA_CMD \
      --data-view DataView.aadl \
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
60 61
      --load-interface-view InterfaceView.aadl \
      --load-deployment-view DeploymentView.aadl \
62 63
      --aadl-library $(taste-config --prefix)/share/ocarina/AADLv2/ocarina_components.aadl \
      --update-properties ConcurrencyView_Properties.aadl
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
64