Skip to content

Commit c9023a3

Browse files
committed
update documentation to add how to extend PATH for including android tool + proper handling of error in build.py. closes kivy#2
1 parent 39f87f2 commit c9023a3

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

docs/source/prerequisites.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ After installing them, export both installation path, NDK version and API to use
4242
export ANDROIDNDKVER=r7
4343
export ANDROIDAPI=14
4444

45+
Also, you must configure you're PATH to add the ``android`` binary::
46+
47+
export PATH=/path/to/android-sdk-linux/tools:$PATH
4548

src/build.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ def make_package(args):
238238
args=args)
239239

240240
# Update the project to a recent version.
241-
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', 'android-8'])
241+
try:
242+
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', 'android-8'])
243+
except IOError:
244+
print 'An error occured while calling', ANDROID, 'update'
245+
print 'Your PATH must include android tools.'
246+
sys.exit(-1)
242247

243248
# Delete the old assets.
244249
if os.path.exists('assets/public.mp3'):
@@ -265,7 +270,12 @@ def make_package(args):
265270
shutil.copy(args.presplash or default_presplash, 'res/drawable/presplash.jpg')
266271

267272
# Build.
268-
map(lambda arg: subprocess.call([ANT, arg]), args.command)
273+
try:
274+
map(lambda arg: subprocess.call([ANT, arg]), args.command)
275+
except IOError:
276+
print 'An error occured while calling', ANT
277+
print 'Did you install ant on your system ?'
278+
sys.exit(-1)
269279

270280
if __name__ == '__main__':
271281
import argparse

0 commit comments

Comments
 (0)