Joe Fernandez | 7dfe7f8 | 2012-05-30 16:19:51 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # This script packages the ADK1 files into a downloadable zip |
| 3 | # by Joe Fernandez, June 2012 |
| 4 | # |
| 5 | # creates a zip for downloading with the following structure: |
| 6 | # /app (demokit Android app) |
| 7 | # /arduino_libs |
| 8 | # /AndroidAccessory |
| 9 | # /examples/demokit (added here for ease of use with Arduino) |
| 10 | # /USB_Host_Shield |
| 11 | # /hardware |
| 12 | # COPYING |
| 13 | # README |
| 14 | |
| 15 | |
| 16 | # Generic pause function |
| 17 | function pause { |
| 18 | read -p " Press Enter to continue..." |
| 19 | } |
| 20 | |
| 21 | # move up to accessory directory |
| 22 | cd .. |
| 23 | |
| 24 | # Main execution |
| 25 | dateStamp=`date +"%Y%m%d"` |
| 26 | |
| 27 | # create the directory structure |
| 28 | mkdir -p ADK_release_${dateStamp}/arduino_libs/AndroidAccessory/examples |
| 29 | |
| 30 | # move the demokit firmware into the AndroidAccessory library, |
| 31 | # so that it shows up in the Arduino IDE menus: |
| 32 | cp -r demokit/firmware/* ADK_release_${dateStamp}/arduino_libs/AndroidAccessory/examples |
| 33 | |
| 34 | # copy in the app and hardware files |
| 35 | cp -r demokit/app ADK_release_${dateStamp} |
| 36 | cp -r demokit/hardware ADK_release_${dateStamp} |
| 37 | |
| 38 | # copy in the README and license info |
| 39 | cp demokit/COPYING ADK_release_${dateStamp} |
| 40 | cp demokit/README ADK_release_${dateStamp} |
| 41 | |
| 42 | # copy in the Arduino libraries and remove the make file |
| 43 | cp -r arduino/* ADK_release_${dateStamp}/arduino_libs |
| 44 | rm -f ADK_release_${dateStamp}/arduino_libs/Android.mk |
| 45 | |
| 46 | echo "packaged directories assembled. Next: create zip" |
| 47 | #pause |
| 48 | |
| 49 | # create the zip download |
| 50 | if [ -e ADK_release_${dateStamp}.zip ]; then |
| 51 | rm -f ADK_release_${dateStamp}.zip |
| 52 | fi |
| 53 | zip -r ADK_release_${dateStamp}.zip ADK_release_${dateStamp}/* |
| 54 | |
| 55 | echo "download zip assembled. Next: remove package directories" |
| 56 | #pause |
| 57 | |
| 58 | rm -rf ADK_release_${dateStamp} |
| 59 | |
| 60 | |
| 61 | |