summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-10-30 20:40:07 -0400
committerMatt A. Tobin <email@mattatobin.com>2021-10-30 20:40:07 -0400
commit15eb80d18e0e35e2095ea1ff83a88f38a88dbb6d (patch)
tree9571006edf31da3c88d01d6a034636e03079aa7f /python
parentd8f7291519d1b80437f0f6272ce8be341e5206e4 (diff)
downloadaura-central-15eb80d18e0e35e2095ea1ff83a88f38a88dbb6d.tar.gz
Issue %3031 - Remove the intellij/gradle build-backend
Diffstat (limited to 'python')
-rw-r--r--python/mozbuild/mozbuild/backend/mach_commands.py98
1 files changed, 0 insertions, 98 deletions
diff --git a/python/mozbuild/mozbuild/backend/mach_commands.py b/python/mozbuild/mozbuild/backend/mach_commands.py
deleted file mode 100644
index fc43eb667..000000000
--- a/python/mozbuild/mozbuild/backend/mach_commands.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from __future__ import absolute_import, print_function, unicode_literals
-
-import argparse
-import os
-import sys
-import subprocess
-import which
-
-from mozbuild.base import (
- MachCommandBase,
-)
-
-from mach.decorators import (
- CommandArgument,
- CommandProvider,
- Command,
-)
-
-@CommandProvider
-class MachCommands(MachCommandBase):
- @Command('ide', category='devenv',
- description='Generate a project and launch an IDE.')
- @CommandArgument('ide', choices=['eclipse', 'intellij'])
- @CommandArgument('args', nargs=argparse.REMAINDER)
- def eclipse(self, ide, args):
- if ide =='intellij':
- studio = ['idea']
- if sys.platform != 'darwin':
- try:
- which.which(studio[0])
- except:
- self.print_ide_error(ide)
- return 1
- else:
- # In order of preference!
- for d in self.get_mac_ide_preferences(ide):
- if os.path.isdir(d):
- studio = ['open', '-a', d]
- break
- else:
- print('IntelliJ IDEA 14 is not installed in /Applications.')
- return 1
-
- # Here we refresh the whole build. 'build export' is sufficient here and is probably more
- # correct but it's also nice having a single target to get a fully built and indexed
- # project (gives a easy target to use before go out to lunch).
- res = self._mach_context.commands.dispatch('build', self._mach_context)
- if res != 0:
- return 1
-
- if ide in ('intellij'):
- res = self._mach_context.commands.dispatch('package', self._mach_context)
- if res != 0:
- return 1
- else:
- # Generate or refresh the IDE backend.
- python = self.virtualenv_manager.python_path
- config_status = os.path.join(self.topobjdir, 'config.status')
- args = [python, config_status, '--backend=%s' % backend]
- res = self._run_command_in_objdir(args=args, pass_thru=True, ensure_exit_code=False)
- if res != 0:
- return 1
-
-
- if ide == 'intellij':
- gradle_dir = None
- if self.is_gradle_project_already_imported():
- gradle_dir = self.get_gradle_project_path()
- else:
- gradle_dir = self.get_gradle_import_path()
- process = subprocess.check_call(studio + [gradle_dir])
-
- def get_gradle_project_path(self):
- return os.path.join(self.topobjdir, 'mobile', 'gradle')
-
- def get_gradle_import_path(self):
- return os.path.join(self.get_gradle_project_path(), 'build.gradle')
-
- def is_gradle_project_already_imported(self):
- gradle_project_path = os.path.join(self.get_gradle_project_path(), '.idea')
- return os.path.exists(gradle_project_path)
-
- def get_mac_ide_preferences(self, ide):
- if sys.platform == 'darwin':
- return [
- '/Applications/IntelliJ IDEA 14 EAP.app',
- '/Applications/IntelliJ IDEA 14.app',
- '/Applications/IntelliJ IDEA 14 CE EAP.app',
- '/Applications/IntelliJ IDEA 14 CE.app']
-
- def print_ide_error(self, ide):
- if ide == 'intellij':
- print('IntelliJ is not installed in your PATH.')
- print('You can generate a command-line launcher from IntelliJ IDEA->Tools->Create Command-line launcher with script name \'idea\'')