From 1cb0f6a215efac5ef50314638b77cdcdd63aa650 Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Wed, 3 Sep 2014 16:09:36 -0400 Subject: [PATCH] Bug 1057986 - Change the location of the eclipse workspace to be along side the srcdir. r=gps --- python/mozbuild/mozbuild/backend/cpp_eclipse.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/mozbuild/mozbuild/backend/cpp_eclipse.py b/python/mozbuild/mozbuild/backend/cpp_eclipse.py index 090dc66f199..07c81a9c3f5 100644 --- a/python/mozbuild/mozbuild/backend/cpp_eclipse.py +++ b/python/mozbuild/mozbuild/backend/cpp_eclipse.py @@ -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()