From 48f363ad016ee9bbe6a02046b0779434ccc54665 Mon Sep 17 00:00:00 2001 From: philippe lhardy Date: Wed, 25 Feb 2015 22:58:59 +0100 Subject: [PATCH] rely fully on artlog_toolbox github . Signed-off-by: philippe lhardy --- artlog_toolbox/deploy.sh | 45 ----- artlog_toolbox/scripts/Makefile | 65 ------- artlog_toolbox/scripts/absant.sh | 12 -- artlog_toolbox/scripts/antify.sh | 50 ------ artlog_toolbox/scripts/debianize.sh | 67 ------- artlog_toolbox/scripts/doit.sh | 270 ---------------------------- init.sh | 7 + 7 files changed, 7 insertions(+), 509 deletions(-) delete mode 100755 artlog_toolbox/deploy.sh delete mode 100644 artlog_toolbox/scripts/Makefile delete mode 100755 artlog_toolbox/scripts/absant.sh delete mode 100755 artlog_toolbox/scripts/antify.sh delete mode 100755 artlog_toolbox/scripts/debianize.sh delete mode 100755 artlog_toolbox/scripts/doit.sh diff --git a/artlog_toolbox/deploy.sh b/artlog_toolbox/deploy.sh deleted file mode 100755 index a4dfda2..0000000 --- a/artlog_toolbox/deploy.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -A_TOOLBOX=artlog_toolbox - -if [[ ! -d $A_TOOLBOX ]] -then - echo "[ERROR] this tool should be run from parent dir of $A_TOOLBOX this way : ${A_TOOLBOX}/deploy.sh" >&2 - exit 1 -fi - -destroy=0 - -while [[ $# -gt 0 ]] -do - case $1 in - destroy) - destroy=1 - ;; - *) - echo "[ERROR] unrecognized '$1' argument for $0" >&2 - exit 1 - ;; - esac - shift 1 -done - -if [[ $destroy != 1 ]] -then - echo "Deploying scripts..." - - pushd ${A_TOOLBOX} - cp scripts/* .. - popd -else - echo "destroy deployed toolbox" - for script in $(ls ${A_TOOLBOX}/scripts) - do - if [[ -f $script ]] - then - shortscript=$(basename "$script") - echo "deleting '$shortscript'" - rm "$shortscript" - fi - done -fi diff --git a/artlog_toolbox/scripts/Makefile b/artlog_toolbox/scripts/Makefile deleted file mode 100644 index 87e8670..0000000 --- a/artlog_toolbox/scripts/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -PROJECT_VERSION=`./debianize.sh getversion` -DISTPREFIX=artloglaby -DISTJAR=$(DISTPREFIX)-$(PROJECT_VERSION).jar -JDEE_VERSION=2.4.1 - -all: build.xml dist/lib/$(DISTJAR) - -getname: - @echo dist/lib/$(DISTJAR) - -dist: - mkdir -p dist - -dist/lib/$(DISTJAR): dist - ant dist - -build.xml: - ./antify.sh >$@ - -clean: - rm -f build.xml - rm -f dist/lib/$(DISTPREFIX)*.jar - rm -rf build - cd java; make clean - -cleanall: clean - rm -rf debian - rm -rf deb - rm -rf download - @( [ -d ~/.emacs.d/jdee-$(JDEE_VERSION) ] && echo "DON'T remove installed ~/.emacs.d/jdee-$(JDEE_VERSION). To remove jdee do 'make removejdee'" ) || true - -debian: - mkdir debian - -deb/%: - mkdir -p deb - touch $@ - ./debianize.sh create $@ - -debian/compat: - echo "7" >$@ - -debian/%: - ./debianize.sh create $@ >$@ - -deb: debian debian/rules debian/control debian/compat debian/changelog deb/javadoc deb/jlibs - dpkg-buildpackage -uc -us - -/usr/bin/emacs: - sudo apt-get install emacs - -download/jdee-bin-$(JDEE_VERSION).tar.bz2: - mkdir -p download; cd download; wget http://sourceforge.net/projects/jdee/files/jdee/$(JDEE_VERSION)/jdee-bin-$(JDEE_VERSION).tar.bz2 - -~/.emacs.d/jdee-$(JDEE_VERSION): /usr/bin/emacs download/jdee-bin-$(JDEE_VERSION).tar.bz2 - mkdir -p ~/.emacs.d; tar -xjf download/jdee-bin-$(JDEE_VERSION).tar.bz2 -C ~/.emacs.d - echo "(add-to-list 'load-path \"~/.emacs.d/jdee-$(JDEE_VERSION)/lisp\")\n(load \"jde\")" >>~/.emacs.d/init.el - -emacsdevenv: ~/.emacs.d/jdee-$(JDEE_VERSION) - -removejdee: - rm -rf ~/.emacs.d/jdee-$(JDEE_VERSION) - sed -i -n -e "/^(add-to-list 'load-path \"~\/\.emacs\.d\/jdee-$(JDEE_VERSION)\/lisp\")$$/d" -e "/^(load \"jde\")$$/d" -e"/^.*$$/p" ~/.emacs.d/init.el - -.PHONY: clean all cleanall getname deb emacsdevenv removejdee diff --git a/artlog_toolbox/scripts/absant.sh b/artlog_toolbox/scripts/absant.sh deleted file mode 100755 index 6b87496..0000000 --- a/artlog_toolbox/scripts/absant.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -buildscript=$1 - -if [[ -e $buildscript ]] -then - # protect ${ variables. - sed 's/\${/\\\${/g' build.xml -else - echo "[ERROR] this $0 tool expect an initial argument with buildscript" >&2 -fi - diff --git a/artlog_toolbox/scripts/antify.sh b/artlog_toolbox/scripts/antify.sh deleted file mode 100755 index 8fc26e5..0000000 --- a/artlog_toolbox/scripts/antify.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -source ./project_params - -# TODO reuse internal tsamp ${DSTAMP} - -cat < - - simple example build file - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF diff --git a/artlog_toolbox/scripts/debianize.sh b/artlog_toolbox/scripts/debianize.sh deleted file mode 100755 index 3677ae9..0000000 --- a/artlog_toolbox/scripts/debianize.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -action=$1 -file=$2 - -maintainer="Artlog " - -if [[ $action == getversion ]] -then - source ./project_params - echo $project_version -elif [[ $action == create ]] -then - source ./project_params - - if [[ $file == debian/control ]] - then - - cat <= 7.0.50~), javahelper (>=0.25) -Build-Depends-Indep: default-jdk, default-jdk-doc, libtrove-java, libtrove-java-doc, ant -Standards-Version: ${project_version} -Section: java - -Package: ${project_name}-java -Architecture: all -Depends: \${java:Depends}, \${misc:Depends} -Recommends: \${java:Recommends} -Description: Labyrinth generator - Labyrinth generator - -Package: ${project_name}-java-doc -Architecture: all -Depends: \${java:Depends}, \${misc:Depends} -Recommends: \${java:Recommends} -Description: Labyrinth generator (documentation) - Labyrinth generator -EOF - elif [[ $file = debian/changelog ]] - then - cat <debian/${project_name}-java-doc.javadoc - elif [[ $file = deb/jlibs ]] - then - echo "dist/lib/${project_name}-${project_version}.jar" >debian/${project_name}-java.jlibs - fi -fi diff --git a/artlog_toolbox/scripts/doit.sh b/artlog_toolbox/scripts/doit.sh deleted file mode 100755 index 0fb6d5a..0000000 --- a/artlog_toolbox/scripts/doit.sh +++ /dev/null @@ -1,270 +0,0 @@ -#!/bin/bash - -setup() -{ - if [[ ! -d java ]] - then - echo "[FATAL] this tools $0 is intended to be run within laby project. Missing java directory." >&2 - exit 1 - fi - if [[ ! -d lab ]] - then - echo "[INFO] Creating directory lab to save default lab created" - mkdir lab - fi -} - -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 - } - -} - -edit_properties() -{ - local property_file=$1 - if [[ -f $property_file ]] - then - modified=0 - s=() - properties=() - values=() - { - while read codeline - do - if [[ $codeline =~ (^[a-zA-Z_]*)=(.*) ]] - then - property=${BASH_REMATCH[1]} - value=${BASH_REMATCH[2]} - s+=("$property" "$value") - properties+=("$property") - values+=("$value") - fi - done - s+=(exit "Exit") - } < $property_file - - while true - do - property=$($DIALOG --menu "Edit '$property_file'" 20 100 10 ${s[@]} 3>&1 1>&2 2>&3) - if [[ $? = 0 ]] - then - if [[ -n $property ]] - then - if [[ $property == exit ]] - then - return 1 - elif [[ $property == save ]] - then - for (( i=0; i<${prop_len}; i++ )); - do - echo "${properties[$i]}=${values[$i]}" - done >$property_file - return 0 - fi - prop_len="${#properties[@]}" - for (( i=0; i<${prop_len}; i++ )); - do - if [[ ${properties[$i]} == $property ]] - then - init_value=${values[$i]} - fi - done - value=$($DIALOG --inputbox "Enter $property value" 10 80 "$init_value" 3>&1 1>&2 2>&3) - if [[ $? = 0 ]] - then - prop_len="${#properties[@]}" - s=() - if [[ "$value" != "$init_value" ]] - then - modified=$(( modified + 1 )) - fi - for (( i=0; i<${prop_len}; i++ )); - do - if [[ ${properties[$i]} == $property ]] - then - values[$i]=$value - fi - s+=("${properties[$i]}" "${values[$i]}") - echo "${properties[$i]}=${values[$i]}" - done - s+=(exit "Exit") - if [[ $modified != 0 ]] - then - s+=(save "Save") - fi - fi - fi - else - return 2 - fi - done - else - echo "[ERROR] property_file '$propertyfile' not found" >&2 - fi - -} - -# first argument mandatory : directory containing generated .lab and .stl files ( usualy ./lab ) -list_labs() -{ - local lab_dir=$1 - if [[ -d $lab_dir ]] - then - modified=0 - s=() - properties=() - values=() - { - pushd $lab_dir - for stl_lab in $(ls *lab*.stl) - do - if [[ $stl_lab =~ ^([^0-9]*[0-9]*x[0-9]*).stl ]] - then - property=${BASH_REMATCH[1]} - value=$stl_lab - s+=("$property" "$value") - properties+=("$property") - values+=("$value") - fi - done - s+=(exit "Exit") - popd - } - - while true - do - property=$($DIALOG --menu "Show stl file from $lab_dir" 20 100 10 ${s[@]} 3>&1 1>&2 2>&3) - if [[ $? = 0 ]] - then - if [[ -n $property ]] - then - if [[ $property == exit ]] - then - return 1 - elif [[ $property == save ]] - then - echo "TODO" - return 0 - fi - prop_len=${#properties[*]} - for (( i=0; i<${prop_len}; i++ )); - do - if [[ ${properties[$i]} == $property ]] - then - blender --python blender_import.py -- $lab_dir/${values[$i]} - fi - done - - fi - else - return 2 - fi - done - else - echo "[ERROR] lab dir '$propertyfile' not found" >&2 - 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 "[ERROR] no console gui support (no dialog tool found within $possible_console_gui) => no menus " >&2 - exit 1 -fi - -setup - -action=initial - -while [[ $action != quit ]] -do - action=$($DIALOG --menu "Ultra Light IDE" 20 80 12 readme "Read me" clean "Clean All" ant "Ant build" run "Run it" list_labs "Show Labyrinth with blender" test "Test it" code "Code" codebg "Code in background" deb "Debian package" properties "Edit Properties" create "Create a new class" emacsdevenv "Setup Emacs java bindings JDEE" 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 40 80 --scrolltext - elif [[ $action == properties ]] - then - edit_properties project_params - elif [[ $action == create ]] - then - newclass=$($DIALOG --inputbox "Enter new class name" 10 80 "NewClass" 3>&1 1>&2 2>&3) - if [[ $? = 0 ]] - then - if [[ -n $newclass ]] - then - pushd java - make work/$newclass - popd - fi - fi - elif [[ $action == list_labs ]] - then - list_labs ./lab - elif [[ $action == emacsdevenv ]] - then - make $action - fi -done diff --git a/init.sh b/init.sh index 007255a..681a353 100755 --- a/init.sh +++ b/init.sh @@ -1,3 +1,10 @@ #!/bin/bash +if [[ ! -d artlog_toolbox ]] +then + git clone https://github.com/artlog/artlog_toolbox.git artlog_toolbox + pushd artlog_toolbox + git checkout labystl + popd +fi artlog_toolbox/deploy.sh