#!/bin/sh
#Dirs: src lib

mkdir -p bin
cd bin/
rm -f *.class
echo "Compiling.."
scalac -cp ../lib/jsoup-1.8.1.jar ../src/Main.scala ../src/Item.scala ../src/Geral.scala ../src/Categoria.scala
if [ $? -eq 0 ]; then
  echo "Generating jar.."
  mkdir -p ../exe/lib
  jar cfm ../exe/dl-internacional.jar ../manifest *.class 
  cp ../lib/* ../exe/lib/
  echo "done."
fi
cd ..