Merge pull request #337 from kived/fix-android-branch

fix changing android branch
This commit is contained in:
Ryan Pessa 2016-05-08 17:45:24 -05:00
commit d560bef7d3

View file

@ -485,10 +485,14 @@ class TargetAndroid(Target):
cwd=self.buildozer.platform_dir)
elif self.platform_update:
cmd('git clean -dxf', cwd=pa_dir)
cmd('git pull origin {}'.format(source), cwd=pa_dir)
if source:
cmd('git checkout {branch}'.format(branch=source), cwd=pa_dir)
current_branch = cmd('git rev-parse --abbrev-ref HEAD',
get_stdout=True, cwd=pa_dir)[0].strip()
if current_branch == source:
cmd('git pull', cwd=pa_dir)
else:
cmd('git fetch --tags origin {0}:{0}'.format(source),
cwd=pa_dir)
cmd('git checkout {}'.format(source), cwd=pa_dir)
self._install_apache_ant()
self._install_android_sdk()