Files
artloglaby/doit.sh
philippe lhardy 2a8f80154f - allows to create a debian package ( yet unsigned )
- create a jar, gnerate a ant build.xml
- version of jar

Signed-off-by: philippe lhardy <philippe@pavilionartlogiciel>
2015-02-16 23:07:20 +01:00

88 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
do_code()
{
background=$1
find java/org/artisanlogiciel/games/ -name "*.java" |
{
s=()
while read codeline
do
javafile=$(basename "$codeline")
javaclass=${javafile/.java/}
echo "$javafile $javaclass"
s+=("$javaclass" "$codeline")
done
javaclass=$($DIALOG --menu "Edit it" 20 100 10 ${s[@]} 3>&1 1>&2 2>&3)
if [[ -n $javaclass ]]
then
pushd java
if [[ $background == codebg ]]
then
nohup make work/$javaclass &
else
make work/$javaclass
fi
popd
fi
}
}
possible_console_gui="whiptail dialog"
for DIALOG in $possible_console_gui
do
DIALOG=$(which $DIALOG)
if [[ -n $DIALOG ]]
then
break
fi
done
if [[ -z $DIALOG ]]
then
echo "no console gui support (within $possible_console_gui) => no menus "
exit 1
fi
action=initial
while [[ $action != quit ]]
do
action=$($DIALOG --menu "Ultra Light IDE" 20 80 8 run "Run it" clean "Clean All" ant "Ant build" test "Test it" readme "Read me" code "Code" codebg "Code in background" deb "Debian package" quit "Quit" 3>&1 1>&2 2>&3)
if [[ $action == run ]]
then
echo "run it"
java -jar $(make getname)
elif [[ $action == ant ]]
then
make clean
make
ant compile
elif [[ $action == clean ]]
then
make clean
pushd java
make clean
popd
elif [[ $action == test ]]
then
echo "test it"
pushd java
make display
popd
elif [[ $action == deb ]]
then
make deb
elif [[ $action =~ code ]]
then
do_code $action
elif [[ $action == readme ]]
then
$DIALOG --textbox README 20 80
fi
done