Bug 1428608: Use EXTERNAL_SOURCE_DIRS to explicity refer to paths in comm-central, when building with c-c as topsrcdir; r?Build,Fallen,frg
MozReview-Commit-ID: LXOqqcLfZQF
--- a/mail/app.mozbuild
+++ b/mail/app.mozbuild
@@ -1,31 +1,31 @@
# vim: set filetype=python:
# 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/.
# Note that paths in this file are relative to the top directory, which may be
# m-c or c-c.
+include('/toolkit/toolkit.mozbuild')
include('../mailnews/mailnews.mozbuild')
-DIRS += ['/%s/mail/components' % CONFIG['commreltopsrcdir']]
-
-include('/%s/toolkit/toolkit.mozbuild' % CONFIG['mozreltopsrcdir'])
-
if CONFIG['MOZ_EXTENSIONS']:
- DIRS += ['/%s/extensions' % CONFIG['mozreltopsrcdir']]
+ DIRS += ['/extensions']
-DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
-
+if CONFIG['EXTERNAL_SOURCE_DIR']:
+ EXTERNAL_SOURCE_DIRS += ['/{}'.format(CONFIG['MOZ_BRANDING_DIRECTORY'])]
+else:
+ DIRS += ['/{}'.format(CONFIG['MOZ_BRANDING_DIRECTORY'])]
if CONFIG['MOZ_CALENDAR']:
- DIRS += [
- '/%s/calendar/lightning' % CONFIG['commreltopsrcdir'],
- '/%s/calendar/timezones' % CONFIG['commreltopsrcdir']
- ]
+ AddCommDirs([
+ '/calendar/lightning',
+ '/calendar/timezones',
+ ])
-DIRS += [
- '/%s/chat' % CONFIG['commreltopsrcdir'],
- '/%s/editor/ui' % CONFIG['commreltopsrcdir'],
- '/%s/mail' % CONFIG['commreltopsrcdir'],
-]
+AddCommDirs([
+ '/chat',
+ '/editor/ui',
+ '/mail',
+ '/mail/components',
+])
--- a/mailnews/mailnews.mozbuild
+++ b/mailnews/mailnews.mozbuild
@@ -1,16 +1,23 @@
# vim: set filetype=python:
# 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/.
-if CONFIG['MOZ_LDAP_XPCOM']:
- DIRS += [
- '/%s/ldap' % CONFIG['commreltopsrcdir'],
- '/%s/ldap/xpcom' % CONFIG['commreltopsrcdir'],
- ]
+@template
+def AddCommDirs(dirs):
+ if CONFIG['EXTERNAL_SOURCE_DIR']:
+ EXTERNAL_SOURCE_DIRS += dirs
+ else:
+ DIRS += ['/comm/{}'.format(dir) for dir in dirs]
+
-DIRS += [
- '/%s/mailnews' % CONFIG['commreltopsrcdir'],
- '/%s/db' % CONFIG['commreltopsrcdir'],
-]
+if CONFIG['MOZ_LDAP_XPCOM']:
+ AddCommDirs([
+ '/ldap',
+ '/ldap/xpcom',
+ ])
+AddCommDirs([
+ '/mailnews',
+ '/db',
+])
--- a/suite/app.mozbuild
+++ b/suite/app.mozbuild
@@ -1,25 +1,26 @@
# vim: set filetype=python:
# 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/.
-include('/%s/mailnews/mailnews.mozbuild' % CONFIG['commreltopsrcdir'])
-
include('/toolkit/toolkit.mozbuild')
+include('../mailnews/mailnews.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
-
-DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
+if CONFIG['EXTERNAL_SOURCE_DIR']:
+ EXTERNAL_SOURCE_DIRS += ['/{}'.format(CONFIG['MOZ_BRANDING_DIRECTORY'])]
+else:
+ DIRS += ['/{}'.format(CONFIG['MOZ_BRANDING_DIRECTORY'])]
if CONFIG['MOZ_CALENDAR']:
- DIRS += [
- '/%s/calendar/lightning' % CONFIG['commreltopsrcdir'],
- '/%s/calendar/timezones' % CONFIG['commreltopsrcdir']
- ]
+ AddCommDirs([
+ '/calendar/lightning',
+ '/calendar/timezones',
+ ])
-DIRS += [
- '/%s/editor/ui' % CONFIG['commreltopsrcdir'],
- '/%s/suite' % CONFIG['commreltopsrcdir'],
-]
+AddCommDirs([
+ '/editor/ui',
+ '/suite',
+])