Bug 1439469: Package lightning directly as part of thunderbird; r?Fallen draft
authorTom Prince <mozilla@hocat.ca>
Sun, 28 Jan 2018 10:29:01 -0700
changeset 59922 1f1e3caee5055632242c36aed671ff6bbb171f4b
parent 59921 a02cd8ee7a96f01ce46a0313a0b861da1b0d7ee3
child 59923 8e09c4f1dbbec7e0a33b457ff6cad80e57646bf8
push id6044
push usermozilla@hocat.ca
push dateWed, 04 Apr 2018 19:50:30 +0000
treeherdertry-comm-central@cb0cf327b63e [default view] [failures only]
reviewersFallen
bugs1439469
Bug 1439469: Package lightning directly as part of thunderbird; r?Fallen Differential Revision: https://phabricator.services.mozilla.com/D514
calendar/defs.mk
calendar/lightning/Makefile.in
calendar/lightning/lightning-tests.mk
calendar/lightning/locales/Makefile.in
calendar/lightning/locales/jar.mn
calendar/lightning/locales/moz.build
calendar/lightning/moz.build
calendar/lightning/versions.mk
calendar/locales/Makefile.in
calendar/locales/jar.mn
calendar/locales/moz.build
calendar/providers/moz.build
calendar/test/unit/xpcshell-shared.ini
mail/build.mk
mail/locales/Makefile.in
mail/locales/l10n.toml
mail/testsuite-targets.mk
new file mode 100644
--- /dev/null
+++ b/calendar/defs.mk
@@ -0,0 +1,8 @@
+# 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/.
+
+# The variables defined here will be set for all files within the mail/
+# subdirectory.
+
+XPI_ROOT_APPID=$(MOZ_APP_ID)
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -37,53 +37,34 @@ ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)'
 endif
 
 MOZ_SOURCE_REPO := $(shell hg -R $(moztopsrcdir) showconfig paths.default 2>/dev/null | sed -e 's/^ssh:/http:/')
 ifdef MOZ_SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO='$(MOZ_SOURCE_REPO)'
 endif
 
-ifdef NIGHTLY_BUILD
-# On nightly builds, install as a global extension in
-# dist/bin/extensions/
-XPI_INSTALL_EXTENSION = $(XPI_EM_ID)
-else
-# For beta and release builds, install as a distribution extension in
-# dist/bin/distribution/extensions/
-INSTALL_EXTENSION_ID = $(XPI_EM_ID)
-endif
-
 DEFINES += -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
            -DTHUNDERBIRD_MAXVERSION=$(THUNDERBIRD_MAXVERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \
            -DLIGHTNING_VERSION=$(LIGHTNING_VERSION) \
            -DXPI_EM_ID="$(XPI_EM_ID)" \
            $(NULL)
 
 MOZ_BUILDID = $(shell $(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
 DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
 
 LOCALE_TOPDIR=$(commtopsrcdir)
 LOCALE_RELATIVEDIR=calendar/lightning
 
 include $(moztopsrcdir)/config/rules.mk
 include $(srcdir)/versions.mk
-include $(srcdir)/lightning-packager.mk
 include $(srcdir)/lightning-tests.mk
 
-# For Lightning, we also need to preprocess the l10n prefs. Pull in the en-US
-# copy if the files doesn't exist.
-repack-process-extrafiles: lightning-extrafiles
-lightning-extrafiles: LTN_ABCD_L10NJS=$(call EXPAND_LOCALE_SRCDIR,calendar/locales)/lightning-l10n.js
-lightning-extrafiles: LTN_ANY_L10NJS=$(if $(wildcard $(LTN_ABCD_L10NJS)),$(LTN_ABCD_L10NJS),$(commtopsrcdir)/calendar/locales/en-US/lightning-l10n.js)
-lightning-extrafiles:
-	$(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $(LTN_ANY_L10NJS) -o $(DIST)/xpi-stage/$(L10N_XPI_NAME)/$(PREF_DIR)/lightning-l10n.js)
-
 ident:
 	@printf 'comm_revision '
 	@$(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/app.ini App SourceStamp
 	@printf 'moz_revision '
 	@$(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/app.ini Build SourceStamp
 	@printf 'buildid '
--- a/calendar/lightning/lightning-tests.mk
+++ b/calendar/lightning/lightning-tests.mk
@@ -1,23 +1,16 @@
 # 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/.
 
 PKG_STAGE = $(DIST)/test-stage
 
 # This is the target that should be called externally
-stage-package: stage-extension stage-mozmill
-
-# stage the extension, avoiding per-platform differences so that the mac unify
-# target works.
-stage-extension:
-	$(NSINSTALL) -D $(PKG_STAGE)/extensions/$(XPI_EM_ID)
-	(cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/extensions/$(XPI_EM_ID) && tar -xf -)
-	grep -v em:targetPlatform $(FINAL_TARGET)/install.rdf > $(PKG_STAGE)/extensions/$(XPI_EM_ID)/install.rdf
+stage-package: stage-mozmill
 
 # stage mozmill tests and shared modules. Cross your fingers that there are no
 # name conflicts between calendar/ and mail/
 stage-mozmill:
 	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/shared-modules
 	(cd $(commtopsrcdir)/calendar/test/mozmill && tar $(TAR_CREATE_FLAGS) - `cat $(commtopsrcdir)/calendar/test/mozmill/mozmilltests.list`) | (cd $(PKG_STAGE)/mozmill && tar -xf -)
 	(cd $(commtopsrcdir)/calendar/test/mozmill/shared-modules && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/shared-modules && tar -xf -)
 	$(call py_action,buildlist,$(PKG_STAGE)/mozmill/mozmilltests.list $(shell cat $(commtopsrcdir)/calendar/test/mozmill/mozmilltests.list))
deleted file mode 100644
--- a/calendar/lightning/locales/Makefile.in
+++ /dev/null
@@ -1,11 +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/.
-
-# Setting this to calendar/locales sets up LOCALE_SRCDIR to the correct locale
-# directory
-relativesrcdir = $(commreltopsrcdir)/calendar/locales
-
-DEFINES += -DTHEME=$(THEME) \
-           -DLOCALE_SRCDIR=$(LOCALE_SRCDIR) \
-           $(NULL)
deleted file mode 100644
--- a/calendar/lightning/locales/jar.mn
+++ /dev/null
@@ -1,11 +0,0 @@
-#filter substitution
-# 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/.
-
-
-lightning-@AB_CD@.jar:
-% locale lightning @AB_CD@ %locale/@AB_CD@/lightning/
-  locale/@AB_CD@/lightning/lightning.dtd         (%chrome/lightning/lightning.dtd)
-  locale/@AB_CD@/lightning/lightning-toolbar.dtd (%chrome/lightning/lightning-toolbar.dtd)
-  locale/@AB_CD@/lightning/lightning.properties  (%chrome/lightning/lightning.properties)
deleted file mode 100644
--- a/calendar/lightning/locales/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# 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/.
-
-DIRS += ['../../locales']
-
-JAR_MANIFESTS += ['jar.mn']
--- a/calendar/lightning/moz.build
+++ b/calendar/lightning/moz.build
@@ -5,24 +5,27 @@
 
 DIRS += [
     '../libical',
     '../base',
     '../providers',
     '../import-export',
     '../itip',
     'components',
-    'locales',
+    '../locales',
     'modules',
 ]
 
 TEST_DIRS += ['../test']
 
-XPI_NAME = 'lightning'
-export('XPI_NAME')
+if CONFIG['NIGHTLY_BUILD']:
+    DIST_SUBDIR = 'extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}'
+else:
+    DIST_SUBDIR = 'distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}'
+export('DIST_SUBDIR')
 
 FINAL_TARGET_PP_FILES += [
     'app.ini',
     'install.rdf',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
--- a/calendar/lightning/versions.mk
+++ b/calendar/lightning/versions.mk
@@ -7,17 +7,17 @@ THUNDERBIRD_VERSION := $(shell cat $(com
 SEAMONKEY_VERSION := $(shell cat $(commtopsrcdir)/suite/config/version.txt)
 
 ifdef MOZ_SUITE
 LIGHTNING_VERSION := $(shell $(PYTHON) $(commtopsrcdir)/calendar/lightning/build/makeversion.py $(THUNDERBIRD_VERSION))
 else
 LIGHTNING_VERSION := $(shell $(PYTHON) $(commtopsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 endif
 
-GDATA_VERSION := $(shell $(PYTHON) $(commtopsrcdir)/calendar/providers/gdata/makeversion.py $(LIGHTNING_VERSION))
+#GDATA_VERSION := $(shell $(PYTHON) $(commtopsrcdir)/calendar/providers/gdata/makeversion.py $(LIGHTNING_VERSION))
 
 # For extensions we require a max version that is compatible across security releases.
 # THUNDERBIRD_MAXVERSION and SEAMONKEY_MAXVERSION is our method for doing that.
 # Alpha versions 10.0a1 and 10.0a2 aren't affected
 # For Seamonkey, 2.17 becomes 2.17.*, 2.17.1 becomes 2.17.*
 # For Thunderbird, 10.0 becomes 10.*, 10.0.1 becomes 10.*
 THUNDERBIRD_MAXVERSION := $(THUNDERBIRD_VERSION)
 ifneq (a,$(findstring a,$(THUNDERBIRD_VERSION)))
new file mode 100644
--- /dev/null
+++ b/calendar/locales/Makefile.in
@@ -0,0 +1,6 @@
+# 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/.
+
+LOCALE_TOPDIR=$(commtopsrcdir)
+LOCALE_RELATIVEDIR=calendar/locales
--- a/calendar/locales/jar.mn
+++ b/calendar/locales/jar.mn
@@ -29,8 +29,14 @@ calendar-@AB_CD@.jar:
     locale/@AB_CD@/calendar/preferences/alarms.dtd         (%chrome/calendar/preferences/alarms.dtd)
     locale/@AB_CD@/calendar/preferences/categories.dtd     (%chrome/calendar/preferences/categories.dtd)
     locale/@AB_CD@/calendar/preferences/general.dtd        (%chrome/calendar/preferences/general.dtd)
     locale/@AB_CD@/calendar/preferences/preferences.dtd    (%chrome/calendar/preferences/preferences.dtd)
     locale/@AB_CD@/calendar/preferences/views.dtd          (%chrome/calendar/preferences/views.dtd)
     locale/@AB_CD@/calendar/dialogs/calendar-event-dialog-reminder.dtd  (%chrome/calendar/dialogs/calendar-event-dialog-reminder.dtd)
     locale/@AB_CD@/calendar/calendar-event-dialog-attendees.properties  (%chrome/calendar/calendar-event-dialog-attendees.properties)
     locale/@AB_CD@/calendar/calendar-extract.properties  (%chrome/calendar/calendar-extract.properties)
+
+lightning-@AB_CD@.jar:
+% locale lightning @AB_CD@ %locale/@AB_CD@/lightning/
+  locale/@AB_CD@/lightning/lightning.dtd         (%chrome/lightning/lightning.dtd)
+  locale/@AB_CD@/lightning/lightning-toolbar.dtd (%chrome/lightning/lightning-toolbar.dtd)
+  locale/@AB_CD@/lightning/lightning.properties  (%chrome/lightning/lightning.properties)
--- a/calendar/locales/moz.build
+++ b/calendar/locales/moz.build
@@ -1,6 +1,10 @@
 # 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/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+LOCALIZED_PP_FILES.defaults.preferences += [
+    'en-US/lightning-l10n.js'
+]
--- a/calendar/providers/moz.build
+++ b/calendar/providers/moz.build
@@ -1,15 +1,14 @@
 # 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/.
 
 DIRS += [
     'caldav',
     'composite',
-    'gdata',
     'ics',
     'memory',
     'storage',
     'wcap',
 ]
 
--- a/calendar/test/unit/xpcshell-shared.ini
+++ b/calendar/test/unit/xpcshell-shared.ini
@@ -24,18 +24,18 @@
 [test_datetime_before_1970.js]
 [test_datetimeformatter.js]
 [test_deleted_items.js]
 [test_duration.js]
 [test_extract.js]
 [test_email_utils.js]
 [test_freebusy.js]
 [test_freebusy_service.js]
-[test_gdata_provider.js]
-requesttimeoutfactor = 2
+#[test_gdata_provider.js]
+#requesttimeoutfactor = 2
 [test_hashedarray.js]
 [test_ics.js]
 [test_ics_parser.js]
 [test_ics_service.js]
 [test_imip.js]
 [test_items.js]
 [test_ltninvitationutils.js]
 [test_providers.js]
--- a/mail/build.mk
+++ b/mail/build.mk
@@ -18,20 +18,16 @@ stage-package:
 install::
 	@$(MAKE) -C $(commtopobjdir)/mail/installer install
 
 source-package::
 	@$(MAKE) -C $(commtopobjdir)/mail/installer source-package
 
 upload::
 	@$(MAKE) -C $(commtopobjdir)/mail/installer upload
-ifdef MOZ_CALENDAR
-	@$(MAKE) -C $(commtopobjdir)/calendar/lightning upload
-	@$(MAKE) -C $(commtopobjdir)/calendar/providers/gdata upload
-endif
 
 source-upload::
 	@$(MAKE) -C $(commtopobjdir)/mail/installer source-upload
 
 hg-bundle::
 	@$(MAKE) -C $(commtopobjdir)/mail/installer hg-bundle
 
 l10n-check::
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -83,25 +83,23 @@ searchplugins:: $(list-json)
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
 libs-%: AB_CD=$*
 libs-%:
 # merge if we're not en-US. Conditional function because
 # we need the current value of AB_CD.
 	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
-ifdef MOZ_CALENDAR
-	$(if $(filter en-US,$(AB_CD)),, @$(MAKE) -C ../../calendar/lightning merge-$*)
-endif
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*  XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C $(DEPTH)/devtools/startup/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../editor/ui/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
 
 
 package-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 package-win32-installer: $(SUBMAKEFILES)
@@ -122,21 +120,16 @@ langpack: langpack-$(AB_CD)
 
 # This is a generic target that will make a langpack, repack ZIP (+tarball)
 # builds, and repack an installer if applicable. It is called from the
 # tinderbox scripts. Alter it with caution.
 
 installers-%: IS_LANGUAGE_REPACK=1
 installers-%:
 	@$(MAKE) clobber-$*
-ifdef MOZ_CALENDAR
-	@$(MAKE) calendar-clobber-$*
-	@$(MAKE) calendar-langpack-$*
-	@$(MAKE) calendar-repackage-zip-$*
-endif
 	@$(MAKE) libs-$*
 	@$(MAKE) package-langpack-$*
 	@$(MAKE) repackage-zip-$*
 ifeq (WINNT,$(OS_ARCH))
 	@$(MAKE) package-win32-installer AB_CD=$* MOZ_PKG_FORMAT=SFX7Z
 endif
 	@echo 'repackaging done'
 
@@ -207,47 +200,8 @@ l10n-check::
 	$(RM) -rf x-test
 	$(NSINSTALL) -D x-test/toolkit
 	echo '#define MOZ_LANG_TITLE Just testing' > x-test/toolkit/defines.inc
 	$(MAKE) installers-x-test L10NBASEDIR='$(PWD)' \
 	    ZIP_IN='$(ZIP_IN)' MOZ_SIMPLE_PACKAGE_NAME=
 	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/unpack.py $(DIST)/l10n-stage/$(MOZ_PKG_DIR)$(_RESPATH)
 	cd $(DIST)/l10n-stage && test $$(cat $(MOZ_PKG_DIR)$(_RESPATH)/update.locale) = x-test
 
-ifdef MOZ_CALENDAR
-LIGHTNING_PATH=$(commtopobjdir)/calendar/lightning
-GDATA_PATH=$(commtopobjdir)/calendar/providers/gdata
-
-define run-calendar-rule
-$(MAKE) -C $(LIGHTNING_PATH) $(subst calendar-,,$@) AB_CD=$(AB_CD)
-$(MAKE) -C $(GDATA_PATH) $(subst calendar-,,$@) AB_CD=$(AB_CD)
-endef
-
-# Add calendar targets for pattern rules. Unfortunately multiple pattern rules
-# on the left hand side do something different with make, therefore we need to
-# write a line for each target.
-calendar-clobber-%:
-	$(run-calendar-rule)
-calendar-langpack-%: AB_CD=$*
-calendar-langpack-%:
-	$(run-calendar-rule)
-calendar-repackage-zip-%: AB_CD=$*
-calendar-repackage-zip-%:
-	$(run-calendar-rule)
-calendar-wget-en-US:
-	$(run-calendar-rule)
-calendar-unpack:
-	$(run-calendar-rule)
-calendar-upload:
-	$(MAKE) -C $(LIGHTNING_PATH) upload AB_CD=$(AB_CD)
-
-# Hook into l10n.mk, providing extra arguments to l10n-repack.py
-ifdef NIGHTLY_BUILD
-MOZ_PKG_EXTRAL10N += extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}=$(DIST)/xpi-stage/lightning-$(AB_CD)
-else
-MOZ_PKG_EXTRAL10N += distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}=$(DIST)/xpi-stage/lightning-$(AB_CD)
-endif
-
-# Hook calendar targets to the mail non-pattern rules
-wget-en-US: calendar-wget-en-US
-unpack: calendar-unpack
-upload: calendar-upload
-endif
--- a/mail/locales/l10n.toml
+++ b/mail/locales/l10n.toml
@@ -96,16 +96,19 @@ locales = [
     l10n = "{l}mail/branding/thunderbird/**"
 
 [[includes]]
     path = "{mozilla}/devtools/client/locales/l10n.toml"
 
 [[includes]]
     path = "{mozilla}/toolkit/locales/l10n.toml"
 
+[[includes]]
+    path = "calendar/locales/l10n.toml"
+
 [[paths]]
     reference = "{mozilla}/devtools/startup/locales/en-US/**"
     l10n = "{l}devtools/startup/**"
 
 # for Gecko 60 and older and cross-channel
 [[paths]]
     reference = "{mozilla}/devtools/shim/locales/en-US/**"
     l10n = "{l}devtools/shim/**"
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -56,11 +56,10 @@ else
 package-tests: stage-mozmill
 endif
 
 stage-mozmill: make-stage-dir
 	$(MAKE) -C $(commtopobjdir)/mail/test/mozmill stage-package
 
 stage-calendar: make-stage-dir
 	$(MAKE) -C $(commtopobjdir)/calendar/lightning stage-package
-	$(MAKE) -C $(commtopobjdir)/calendar/providers/gdata stage-package
 
 .PHONY: stage-mozmill stage-calendar