From c6537872b09ab78ffcbb3756649372866ff8cc75 Mon Sep 17 00:00:00 2001 From: Francois Best Date: Wed, 16 Apr 2014 08:52:33 +0200 Subject: [PATCH] Reworked packaging script. --- .gitignore | 1 + res/packaging | 50 ------------------------------------------- res/packaging.command | 36 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 50 deletions(-) delete mode 100755 res/packaging create mode 100755 res/packaging.command diff --git a/.gitignore b/.gitignore index d44cbfe..6681cf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.sublime-workspace *.pyc logs/ +build/ diff --git a/res/packaging b/res/packaging deleted file mode 100755 index 33ee9c3..0000000 --- a/res/packaging +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Generate an archive with packaged content for easier delivery. -# The generated archive contains: -# - Source files (MIDI.cpp / MIDI.h) -# - Resources (keywords.txt) -# - Documentation (Doxygen) -# - Examples for Arduino IDE -# - Installation scripts - - -# Create a temporary destination folder -mkdir -p temp/doc -mkdir -p temp/examples - -# Copy sources -cp ../src/* temp - -# Copy resources -cp keywords.txt temp -cp install_* temp -rm temp/install_local_* - -# Copy examples -cp -r examples/* temp/examples - -# Generate & copy doc -cd ../doc -/Applications/Doxygen.app/Contents/Resources/doxygen Doxyfile -rm -rf latex -cd ../res - -cp -r ../doc/* temp/doc - -# Generate package -mv temp MIDI -zip -r MIDI.zip MIDI - - -# Remove temp folder -rm -rf MIDI - -# Archive generated packaged - -if [[ !( -d ../bin ) ]] -then - mkdir ../bin # Create archives location -fi - -mv MIDI.zip ../bin/Arduino_MIDI_Library.zip diff --git a/res/packaging.command b/res/packaging.command new file mode 100755 index 0000000..5f6a7e8 --- /dev/null +++ b/res/packaging.command @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Generate an archive with packaged content for easier delivery. +# The generated archive contains: +# - Source files (MIDI.cpp / MIDI.h) +# - Resources (keywords.txt) +# - Examples for Arduino IDE +# - Installation scripts + +cd "`dirname "${0}"`" + +root="${PWD}/.." +build="$root/build/MIDI" + +echo root $root +echo build $build + +# Create a temporary destination folder +mkdir -p "$build" +mkdir -p "$build/examples" + +# Copy sources +cd "$root/src/" +cp * "$build/" + +# Copy resources +cd "$root/res/" +cp keywords.txt "$build/" + +# Copy examples +cd "$root/res/examples/" +cp -r * "$build/examples" + +# Generate package +cd "$build/.." +zip -r Arduino_MIDI_Library.zip MIDI