#!/usr/bin/env bash
# Build the project's product(s).
#
# Copyright (c) 2019 Cisco and/or its affiliates.
# License: MIT


set -e
cd "$(dirname "$0")/.."


# Default build
all=true


# Process Script Arguments
for i in ${@}; do
    case ${i} in
        package)
        all=
        package=true
        ;;

        *)
        echo "Unknown argument: $i"
        exit 1
        ;;
    esac
done


echo "==> Cleaning previous build artifacts"
script/clean


# Project build steps
if [ ${all} ] || [ ${package} ]; then
    echo "==> Building the Source Distribution package"
    python3 setup.py sdist
fi
