#!/bin/bash -e
echo 'TASTE Project Creator - Use only the SAVE button - not \"Save as..\" !'

if [ -f InterfaceView.aadl ]
then
    echo 'InterfaceView.aadl already exists. Use taste-edit-project instead.'
    exit 0
fi

if [ ! -f DataView.aadl ]
then
    echo 'Creating a default ASN.1 data model.'
    NONINTERACTIVE=1 taste-create-data-view
    NONINTERACTIVE=1 taste-create-acn-model
else
    echo Using existing DataView.aadl
fi

# Invoke the GUI from Ellidiss
TASTE --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

