Bug 1057986 - Change the location of the eclipse workspace to be along side the srcdir. r=gps

This commit is contained in:
Benoit Girard 2014-09-03 16:09:36 -04:00
parent 94c0c31d3c
commit 1cb0f6a215

View File

@ -26,7 +26,7 @@ class CppEclipseBackend(CommonBackend):
CommonBackend._init(self)
self._paths_to_defines = {}
self._workspace_dir = os.path.join(self.environment.topobjdir, 'eclipse_workspace')
self._workspace_dir = self.get_workspace_path()
self._project_dir = os.path.join(self._workspace_dir, 'gecko')
self._macbundle = self.environment.substs['MOZ_MACBUNDLE_NAME']
@ -48,6 +48,14 @@ class CppEclipseBackend(CommonBackend):
self.summary.backend_detailed_summary = types.MethodType(detailed,
self.summary)
def get_workspace_path(self):
# Eclipse doesn't support having the workspace inside the srcdir.
# Since most people have their objdir inside their srcdir it's easier
# and more consistent to just put the workspace along side the srcdir
srcdir_parent = os.path.dirname(self.environment.topsrcdir)
workspace_dirname = "eclipse_" + os.path.basename(self.environment.topobjdir)
return os.path.join(srcdir_parent, workspace_dirname)
def consume_object(self, obj):
obj.ack()