4 Setup a build environment
8 ANDROID_STUDIO_VERSION
=1.1.0
9 ANDROID_STUDIO_BUILD
=135.1740770
10 ANDROID_STUDIO_FILE
=android-studio-ide-
$ANDROID_STUDIO_BUILD-linux.
zip
12 ANDROID_SDK_VERSION
=r24.1
.2
13 ANDROID_SDK_FILE
=android-sdk_
$ANDROID_SDK_VERSION-linux.tgz
14 ANDROID_SDK_URL
=http
://dl.google.com
/android
/${ANDROID_SDK_FILE}
15 ANDROID_API_LEVELS
=android-20
,android-21
,android-22
16 ANDROID_BUILD_TOOLS_VERSION
=21.1.2
18 # Setup a build environment
19 sudo add-apt-repository
--yes ppa
:librepilot
/tools
20 sudo apt-get
--yes --force-yes update
21 sudo apt-get
--yes --force-yes install build-essential ccache debhelper git-core git-doc flex graphviz bison libudev-dev libusb-1.0
-0-dev libsdl1.2
-dev python libopenscenegraph-dev qt56-meta-minimal qt56svg qt56script qt56serialport qt56multimedia qt56translations qt56tools qt56quickcontrols libosgearth-dev openscenegraph-plugin-osgearth
22 sudo apt-get
--yes --force-yes install libc6-i386
26 if [ "$ANDROID_ENV" = "true" ]; then
29 sudo
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo
tee /etc
/apt
/sources.list.d
/webupd8team-java.list
30 sudo
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo
tee -a /etc
/apt
/sources.list.d
/webupd8team-java.list
31 sudo apt-key adv
--keyserver keyserver.ubuntu.com
--recv-keys EEA14886
33 # accept the license agreement
34 echo oracle-java7-installer shared
/accepted-oracle-license-v1-1
select true | sudo
/usr
/bin
/debconf-set-selections
36 sudo apt-get
--yes --force-yes install oracle-java7-installer
38 # make a place to install development tools
39 mkdir
-p ~
/workspace
/tools
42 # download and unpack android-studio
43 wget https
://dl.google.com
/dl
/android
/studio
/ide-zips
/$ANDROID_STUDIO_VERSION/$ANDROID_STUDIO_FILE
44 unzip $ANDROID_STUDIO_FILE
45 rm $ANDROID_STUDIO_FILE
47 # create a launcher for android-studio
48 mkdir
/home
/vagrant
/Desktop
/
54 Exec=/home/vagrant/workspace/tools/android-studio/bin/studio.sh
55 Icon=/home/vagrant/workspace/tools/android-studio/bin/idea.png
56 Path=/home/vagrant/workspace/tools/android-studio
59 GenericName=" >> "/home/vagrant/Desktop/Android-Studio.desktop"
61 chmod u
+x
/home
/vagrant
/Desktop
/Android-Studio.desktop
63 # download android sdk
64 wget http
://dl.google.com
/android
/$ANDROID_SDK_FILE
65 tar -zxf $ANDROID_SDK_FILE
68 # install android sdk extras to get google libs
69 ANDROID
=/home
/vagrant
/workspace
/tools
/android-sdk-linux
/tools
/android
70 echo y |
$ANDROID update sdk
--no-ui --filter extra-android-support
,extra-android-m2repository
,extra-google-m2repository
,tools
,platform-tools
,${ANDROID_API_LEVELS},build-tools-
${ANDROID_BUILD_TOOLS_VERSION},build-tools-20.0
.0
77 git clone https
://bitbucket.org
/librepilot
/librepilot.git
81 # Dev Tools Installation
82 make build_sdk_install