add creation of zip to distribute

This commit is contained in:
philippe lhardy
2017-12-09 22:17:52 +01:00
parent f3a8895547
commit 6066e47330
2 changed files with 44 additions and 5 deletions

View File

@@ -1,7 +1,11 @@
<project name="artloglaby" default="dist" basedir="/home/plhardy/artisanlogiciel/code/laby_github">
<description>
simple example build file
</description>
<!-- for document on apache ant see https://ant.apache.org/manual-1.9.x/index.html -->
<!-- don't set basedir since it default to parent directory of this file, it is what we want -->
<project name="artloglaby" default="dist">
<description>
2D Maze generator ( generate .stl for one 3D layer )
</description>
<!-- set global properties for this build -->
<property name="src" location="java"/>
<property name="build" location="build"/>
@@ -43,4 +47,5 @@
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>

View File

@@ -8,13 +8,46 @@ specific_run()
list_labs ./lab
elif [[ $action == emacsdevenv ]]
then
make -f ${JAVA_MAKEFILE} $action
make -f ${JAVA_MAKEFILE} $action
elif [[ $action == create_zip_package ]]
then
create_zip_package
else
echo "[ERROR] unrecognized specific action $action" >&2
return
fi
}
create_zip_package()
{
dest=artloglaby/
if [[ -e $dest ]]
then
echo "[ERROR] $dest already exists ! move it away ">&2
else
zip_package=laby.zip
if [[ -e $zip_package ]]
then
echo "[WARNING] zip package $zip_package already exists" >&2
fi
mkdir $dest
# will be used at run time to save mazes
mkdir $dest/lab
cp scripts/laby.sh $dest
cp LISEZMOI $dest
cp libs/* $dest
cp dist/lib/* $dest
zip -r $zip_package $dest
if [[ $? == 0 ]]
then
rm -r $dest
echo "[INFO] zip package created : $zip_package"
else
echo "[ERROR] zip package $zip_package creation failed" >&2
fi
fi
}
# first argument mandatory : directory containing generated .lab and .stl files ( usualy ./lab )
list_labs()
@@ -86,4 +119,5 @@ then
fi
specific_menus+=(list_labs "Show_Labyrinth_with_blender")
specific_menus+=(create_zip_package "Create_Zip_Package")