#!/bin/bash
# (C) 2016 Esteban D.Dortta
#
# tools/adb-build
# YeAPF 0.8.61-173 built on 2018-12-12 17:54 (-2 DST)
# Copyright (C) 2004-2018 Esteban Daniel Dortta - dortta@yahoo.com
# 2018-07-09 14:57:44 (-2 DST)
#
# This set of scripts requires adb/android-sdk/cordova installed on your device.
# Has been well tested under Ubuntu 16 and MacOSX 10.11.6
# It is supposed to run on Cygwin


if [ -f www/js/version.js ]; then
	my_dir="$(dirname "$0")"
	source "$my_dir/adb-lib.inc.sh"

	newVersion=$(increaseVersion)

	echo "Compiling $newVersion"
	jshint www/js/index.js && \
	echo "-----------" && \
	date && \
	cordova run android && \
	echo "----------------" && \
	tput bel && \
	./adb-debug.sh
else
	echo "www/js/version.js file not found"
fi