Skip to content

Commit 6ffe47e

Browse files
committed
Merge pull request kivy#11 from hansent/master
use ANDROIDSDK path in build.py
2 parents 7c3488f + 583adbb commit 6ffe47e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
ANDROID = 'android'
2323
ANT = 'ant'
2424

25+
#if ANDROIDSDK is on path, use android from this path
26+
ANDROIDSDK = os.environ.get('ANDROIDSDK')
27+
if ANDROIDSDK:
28+
ANDROID = os.path.join(ANDROIDSDK, 'tools', ANDROID)
29+
2530
curdir = dirname(__file__)
2631

2732
# Try to find a host version of Python that matches our ARM version.
@@ -240,7 +245,7 @@ def make_package(args):
240245
# Update the project to a recent version.
241246
try:
242247
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', 'android-8'])
243-
except IOError:
248+
except (OSError, IOError):
244249
print 'An error occured while calling', ANDROID, 'update'
245250
print 'Your PATH must include android tools.'
246251
sys.exit(-1)
@@ -272,7 +277,7 @@ def make_package(args):
272277
# Build.
273278
try:
274279
map(lambda arg: subprocess.call([ANT, arg]), args.command)
275-
except IOError:
280+
except (OSError, IOError):
276281
print 'An error occured while calling', ANT
277282
print 'Did you install ant on your system ?'
278283
sys.exit(-1)

0 commit comments

Comments
 (0)