From 8d71540829672e29b60c5e8820068a41a42505a0 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 26 Aug 2015 10:57:49 -0700 Subject: [PATCH] No bug - Add |mach android| command. r=me DONTBUILD NPOTB This adds a pass-thru |mach android| command. It's just here to make it easier to add and remove Android SDK packages: since most folks don't have the Android tools on their PATH, this saves them having to root through the object directory to find the path to the tool. --HG-- extra : commitid : HgCtltLK3V4 extra : rebase_source : 6c7db25c10b643c8fe655976e613c29db7cd0bc4 extra : histedit_source : fd95eb809a901fd3873968117c60966f3f82790c --- mobile/android/mach_commands.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mobile/android/mach_commands.py b/mobile/android/mach_commands.py index e5055e2db852..f5dcc9f56e45 100644 --- a/mobile/android/mach_commands.py +++ b/mobile/android/mach_commands.py @@ -39,6 +39,20 @@ and in IntelliJ select File > Import project... and choose @CommandProvider class MachCommands(MachCommandBase): + @Command('android', category='devenv', + description='Run the Android package manager tool.', + conditions=[conditions.is_android]) + @CommandArgument('args', nargs=argparse.REMAINDER) + def android(self, args): + # Avoid logging the command + self.log_manager.terminal_handler.setLevel(logging.CRITICAL) + + return self.run_process( + [os.path.join(self.substs['ANDROID_TOOLS'], 'android')] + args, + pass_thru=True, # Allow user to run gradle interactively. + ensure_exit_code=False, # Don't throw on non-zero exit code. + cwd=mozpath.join(self.topsrcdir)) + @Command('gradle', category='devenv', description='Run gradle.', conditions=[conditions.is_android])