Skip to content

Commit

Permalink
Removed android_old target and began update to sdk install
Browse files Browse the repository at this point in the history
  • Loading branch information
inclement committed Feb 1, 2019
1 parent 74e26fe commit 4936d31
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 423 deletions.
22 changes: 2 additions & 20 deletions buildozer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def __init__(self, filename='buildozer.spec', target=None):
def set_target(self, target):
'''Set the target to use (one of buildozer.targets, such as "android")
'''
target = self.translate_target(target)
self.targetname = target
m = __import__('buildozer.targets.{0}'.format(target),
fromlist=['buildozer'])
Expand Down Expand Up @@ -919,23 +918,6 @@ def package_full_name(self):
# command line invocation
#

def translate_target(self, target, inverse=False):
# FIXME at some point, refactor to remove completely android old toolchain
if inverse:
if target == "android":
target = "android_old"
elif target == "android_new":
target = "android"
else:
if target == "android":
target = "android_new"
elif target == "android_new":
self.error("ERROR: The target android_new is now android")
exit(1)
elif target == "android_old":
target = "android"
return target

def targets(self):
for fn in listdir(join(dirname(__file__), 'targets')):
if fn.startswith('.') or fn.startswith('__'):
Expand All @@ -946,7 +928,7 @@ def targets(self):
try:
m = __import__('buildozer.targets.{0}'.format(target),
fromlist=['buildozer'])
yield self.translate_target(target, inverse=True), m
yield target, m
except NotImplementedError:
pass
except:
Expand Down Expand Up @@ -1054,7 +1036,7 @@ def run_command(self, args):

# maybe it's a target?
targets = [x[0] for x in self.targets()]
if self.translate_target(command, inverse=True) not in targets:
if command not in targets:
print('Unknown command/target {}'.format(self.translate_target(command, inverse=True)))
exit(1)

Expand Down
Loading

0 comments on commit 4936d31

Please sign in to comment.