aboutsummaryrefslogtreecommitdiff
path: root/make-download.sh
blob: 7c8e3257b3782fb3ba0d820ac5c57d77eca7ae2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This script packages the ADK1 files into a downloadable zip
# by Joe Fernandez, June 2012
#
# creates a zip for downloading with the following structure:
# /app (demokit Android app)
# /arduino_libs
#   /AndroidAccessory
#     /examples/demokit (added here for ease of use with Arduino)
#   /USB_Host_Shield
# /hardware
# COPYING
# README


# Generic pause function
function pause {
    read -p " Press Enter to continue..."
}

# move up to accessory directory
cd ..

# Main execution
dateStamp=`date +"%Y%m%d"`

# create the directory structure
mkdir -p ADK_release_${dateStamp}/arduino_libs/AndroidAccessory/examples

# move the demokit firmware into the AndroidAccessory library, 
# so that it shows up in the Arduino IDE menus:
cp -r demokit/firmware/* ADK_release_${dateStamp}/arduino_libs/AndroidAccessory/examples

# copy in the app and hardware files
cp -r demokit/app ADK_release_${dateStamp}
cp -r demokit/hardware ADK_release_${dateStamp}

# copy in the README and license info
cp demokit/COPYING ADK_release_${dateStamp}
cp demokit/README ADK_release_${dateStamp}

# copy in the Arduino libraries and remove the make file
cp -r arduino/* ADK_release_${dateStamp}/arduino_libs
rm -f ADK_release_${dateStamp}/arduino_libs/Android.mk

echo "packaged directories assembled. Next: create zip"
#pause

# create the zip download
if [ -e ADK_release_${dateStamp}.zip ]; then
    rm -f ADK_release_${dateStamp}.zip
fi
zip -r ADK_release_${dateStamp}.zip ADK_release_${dateStamp}/*

echo "download zip assembled. Next: remove package directories"
#pause

rm -rf ADK_release_${dateStamp}