mi024

College project master 1 "Projet IAD"
git clone https://esimon.eu/repos/mi024.git
Log | Files | Refs | README

commit 69f35ff0382a5fbdfdfc4dbbce299e23f720fcb6
parent 13fcd6f97a5e803f4bd3755413c9d27a28eee69a
Author: Étienne Simon <etienne.jl.simon@gmail.com>
Date:   Mon,  6 May 2013 03:06:43 +0200

Add a script to format the project into the specified format.

Diffstat:
Ascripts/format for rendering.sh | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+), 0 deletions(-)

diff --git a/scripts/format for rendering.sh b/scripts/format for rendering.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "usage: $0 path_to_repository_root" + exit 1 +fi + +repo_root=$1 +calling_dir=$PWD +[ $walfu_dir ] || walfu_dir=`cd "$repo_root/../WALFU"; pwd` +[ $tmpdir ] || tmpdir="/tmp/mi024s07_`date +%s`" +[ $# -eq 2 ] && tmpdir=$2 + +output_zip_name='PIAD07_final.zip' + +mkdir -p "$tmpdir" +echo -n 'Copying the repository to Sources...' +cp -R "$repo_root" "$tmpdir/Sources" +echo ' done' + +ln -s "$walfu_dir" "$tmpdir/WALFU" + +mkdir "$tmpdir/Build" +cd "$tmpdir/Build" + +echo -n 'Configuring Makefiles...' +if [ $VERBOSE ]; then + cmake ../Sources +else + cmake ../Sources >> /dev/null 2>&1 +fi +if [ $? -ne 0 ]; then + echo ' FAIL' + exit 1 +fi +echo ' done' + +echo -n 'Building binaries...' +if [ $VERBOSE ]; then + make all +else + make all >> /dev/null 2>&1 +fi +if [ $? -ne 0 ]; then + echo ' FAIL' + exit 1 +fi +echo ' done' + +echo -n 'Building documentations...' +if [ $VERBOSE ]; then + make doc +else + make doc >> /dev/null 2>&1 +fi +if [ $? -ne 0 ]; then + echo ' FAIL' + exit 1 +fi +echo ' done' + +cd "$tmpdir" + +mkdir Install +echo -n 'Populating Install with executables...' +mv 'Build/src/supervisor' 'Install/supervisor' +mv 'Build/src/view_ctl' 'Install/view_ctl' +mv 'Build/src/test_serialization' 'Install/test_serialization' +cp 'Sources/scripts/format for rendering.sh' 'Install/format for rendering.sh' +cp 'Sources/scripts/setup database.sh' 'Install/setup database.sh' +echo ' done' + +mkdir Rapports +echo -n 'Populating Rapports with documentations...' +mv 'Build/doc/specifications.pdf' 'Rapports/specifications.pdf' +mv 'Build/doc/operational plan.pdf' 'Rapports/operational plan.pdf' +mv 'Build/doc/html' 'Rapports/developer documentation' +cp 'Sources/README' 'Rapports/README' +cp 'Sources/INSTALL' 'Rapports/INSTALL' +echo ' done' + +echo -n 'Cleaning build files...' +rm -rf Build +rm -f WALFU +echo ' done' + +echo -n 'Zipping...' +if [ $VERBOSE ]; then + zip -r "$output_zip_name" Sources Install Rapports +else + zip -r "$output_zip_name" Sources Install Rapports >> /dev/null 2>&1 +fi +echo ' done' + +cd $calling_dir +mv "$tmpdir/$output_zip_name" "$output_zip_name" + +echo -n 'Cleaning temporary files...' +rm -rf "$tmpdir" +echo ' done'