#!/bin/bash

#  Copyright (c) 2016, Oracle and/or its affiliates.  All rights reserved.
#  
#  This software is dual-licensed to you under the MIT License (MIT) and
#  the Universal Permissive License (UPL).  See the LICENSE file in the root
#  directory for license terms.  You may choose either license, or both.
#  

clear
echo "============================================================================================"
if [ -f iotserver.pem ]; then
  rm iotserver.pem
fi
cd ..
echo "Clean old files..."
gradle -q clean
echo -e "\nCreate json folder..."
mkdir -p ./json
echo -e "\nBuild your jar file..."
gradle -q build

echo -e "\nUntar the files..."
tar -xf ./build/distributions/rest.tar -C ./build/distributions/

