Bug 1608610 - Change build system to integrate calendar. r=darktrojan,Fallen
authorPaul Morris <paul@thunderbird.net>
Fri, 10 Jan 2020 22:30:43 -0500
changeset 38096 91a334ef09a894375e6042bd4236222be2879f5f
parent 38095 0d533b4b3992aa621f064a70959a84e585d6d9d5
child 38097 ba5a124ff8bb389fe0af34713849686d88f628a5
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersdarktrojan, Fallen
bugs1608610
Bug 1608610 - Change build system to integrate calendar. r=darktrojan,Fallen
calendar/base/backend/calBackendLoader.manifest
calendar/base/backend/icaljs/moz.build
calendar/base/modules/moz.build
calendar/base/src/moz.build
calendar/defs.mk
calendar/import-export/moz.build
calendar/lightning/Makefile.in
calendar/lightning/manifest.json
calendar/lightning/modules/moz.build
calendar/lightning/moz.build
calendar/providers/caldav/moz.build
calendar/providers/storage/moz.build
mail/installer/package-manifest.in
mail/testsuite-targets.mk
--- a/calendar/base/backend/calBackendLoader.manifest
+++ b/calendar/base/backend/calBackendLoader.manifest
@@ -1,3 +1,3 @@
 component {0314c271-7168-40fa-802e-83c8c46a557e} calBackendLoader.js
 contract @mozilla.org/calendar/backend-loader;1 {0314c271-7168-40fa-802e-83c8c46a557e}
-category profile-after-change calendar-backend-loader service,@mozilla.org/calendar/backend-loader;1
+category profile-after-change calendar-backend-loader @mozilla.org/calendar/backend-loader;1
--- a/calendar/base/backend/icaljs/moz.build
+++ b/calendar/base/backend/icaljs/moz.build
@@ -1,22 +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/.
 
+# There is no manifest file for the calICALJSComponents component because
+# calendar backend components are loaded dynamically.
 EXTRA_COMPONENTS += [
     'calICALJSComponents.js',
 ]
 
-FINAL_TARGET_FILES['calendar-js'] += [
+# These files go in components so they can be packaged correctly.
+FINAL_TARGET_FILES.components += [
     'calDateTime.js',
     'calDuration.js',
     'calICSService-worker.js',
     'calICSService.js',
     'calPeriod.js',
     'calRecurrenceRule.js'
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'ICAL.js Integration')
-
-NO_COMPONENTS_MANIFEST = True
--- a/calendar/base/modules/moz.build
+++ b/calendar/base/modules/moz.build
@@ -1,14 +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/.
 
-EXTRA_JS_MODULES.utils += [
+EXTRA_JS_MODULES.calendar.utils += [
     'utils/calACLUtils.jsm',
     'utils/calAlarmUtils.jsm',
     'utils/calAsyncUtils.jsm',
     'utils/calAuthUtils.jsm',
     'utils/calCategoryUtils.jsm',
     'utils/calDataUtils.jsm',
     'utils/calDateTimeUtils.jsm',
     'utils/calEmailUtils.jsm',
@@ -19,15 +19,15 @@ EXTRA_JS_MODULES.utils += [
     'utils/calPrintUtils.jsm',
     'utils/calProviderUtils.jsm',
     'utils/calUnifinderUtils.jsm',
     'utils/calViewUtils.jsm',
     'utils/calWindowUtils.jsm',
     'utils/calXMLUtils.jsm',
 ]
 
-EXTRA_JS_MODULES += [
+EXTRA_JS_MODULES.calendar += [
     'calExtract.jsm',
     'calHashedArray.jsm',
     'calRecurrenceUtils.jsm',
     'calUtils.jsm',
     'Ical.jsm',
 ]
--- a/calendar/base/src/moz.build
+++ b/calendar/base/src/moz.build
@@ -15,17 +15,18 @@ EXTRA_COMPONENTS += [
     'calItemModule.js',
     'calItemModule.manifest',
     'calSleepMonitor.js',
     'calSleepMonitor.manifest',
     'calTimezoneService.js',
     'calTimezoneService.manifest',
 ]
 
-FINAL_TARGET_FILES['calendar-js'] += [
+# These files go in components so they can be packaged correctly.
+FINAL_TARGET_FILES.components += [
     'calAlarm.js',
     'calAlarmMonitor.js',
     'calAlarmService.js',
     'calAttachment.js',
     'calAttendee.js',
     'calCachedCalendar.js',
     'calCalendarManager.js',
     'calCalendarSearchService.js',
deleted file mode 100644
--- a/calendar/defs.mk
+++ /dev/null
@@ -1,8 +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/.
-
-# The variables defined here will be set for all files within the mail/
-# subdirectory.
-
-XPI_ROOT_APPID=$(MOZ_APP_ID)
--- a/calendar/import-export/moz.build
+++ b/calendar/import-export/moz.build
@@ -5,17 +5,18 @@
 
 EXTRA_COMPONENTS += [
     'calImportExportModule.js',
     'calImportExportModule.manifest',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
-FINAL_TARGET_FILES['calendar-js'] += [
+# These files go in components so they can be packaged correctly.
+FINAL_TARGET_FILES.components += [
     'calHtmlExport.js',
     'calIcsImportExport.js',
     'calListFormatter.js',
     'calMonthGridPrinter.js',
     'calOutlookCSVImportExport.js',
     'calWeekPrinter.js',
 ]
 
deleted file mode 100644
--- a/calendar/lightning/Makefile.in
+++ /dev/null
@@ -1,33 +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/.
-
-XPI_PKGNAME = lightning
-
-ifdef NIGHTLY_BUILD
-final_parent = $(ABS_DIST)/bin/extensions
-else
-final_parent = $(ABS_DIST)/bin/distribution/extensions
-endif
-
-ifdef MOZ_ARTIFACT_BUILDS
-final_dest = $(final_parent)/{e2fda1a4-762b-4020-b5ad-a41df1933103}
-
-tools::
-	$(RM) -r $(final_dest)
-ifeq ($(OS_ARCH),WINNT)
-	$(NSINSTALL) -D $(final_dest)
-	$(call copy_dir,$(FINAL_TARGET),$(final_dest))
-else
-	$(NSINSTALL) -D $(final_parent)
-	ln -s $(ABS_DIST)/xpi-stage/lightning $(final_dest)
-endif
-endif # MOZ_ARTIFACT_BUILDS
-
-# This is the target that should be called externally
-stage-package:
-ifdef MOZ_ARTIFACT_BUILDS
-	$(PYTHON) -u $(MOZILLA_DIR)/build/upload.py $(DIST)/xpi-stage/$(XPI_PKGNAME).xpi
-else
-	$(PYTHON) -u $(MOZILLA_DIR)/build/upload.py $(final_parent)/$(XPI_PKGNAME).xpi
-endif
deleted file mode 100644
--- a/calendar/lightning/manifest.json
+++ /dev/null
@@ -1,24 +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/.
-#
-#filter substitution
-{
-  "manifest_version": 2,
-  "name": "Lightning",
-  "description": "Integrated Calendaring & Scheduling for your Email client",
-  "version": "@THUNDERBIRD_VERSION_DISPLAY@",
-  "author": "Mozilla Calendar Project",
-  "homepage_url": "https://www.mozilla.org/projects/calendar/",
-  "legacy": true,
-  "applications": {
-    "gecko": {
-      "id": "{e2fda1a4-762b-4020-b5ad-a41df1933103}",
-      "strict_min_version": "@MOZ_APP_VERSION@",
-      "strict_max_version": "@MOZ_APP_MAXVERSION@"
-    }
-  },
-  "icons": {
-    "32": "chrome/calendar/skin/common/icons/icon32.svg"
-  }
-}
--- a/calendar/lightning/modules/moz.build
+++ b/calendar/lightning/modules/moz.build
@@ -1,8 +1,8 @@
 # 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/.
 
-EXTRA_JS_MODULES += [
+EXTRA_JS_MODULES.calendar += [
     'ltnInvitationUtils.jsm',
 ]
--- a/calendar/lightning/moz.build
+++ b/calendar/lightning/moz.build
@@ -11,52 +11,30 @@ DIRS += [
     '../itip',
     'components',
     '../locales',
     'modules',
 ]
 
 TEST_DIRS += ['../test']
 
-version_parts = CONFIG['MOZ_APP_VERSION'].split('.')
-major_version = version_parts[0]
-DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
-DEFINES['MOZ_APP_MAXVERSION'] = major_version + '.*'
-
-if CONFIG['MOZ_ARTIFACT_BUILDS']:
-    XPI_NAME = 'lightning'
-    export('XPI_NAME')
-else:
-    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 += [
-    'manifest.json',
-]
-
 JAR_MANIFESTS += ['jar.mn']
 
-USE_EXTENSION_MANIFEST = True
-export('USE_EXTENSION_MANIFEST')
-
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DEFINES['THEME'] = 'windows'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DEFINES['THEME'] = 'osx'
 else:
     DEFINES['THEME'] = 'linux'
 
 JS_PREFERENCE_PP_FILES += [
     'content/lightning.js',
 ]
 
-FINAL_TARGET_FILES.timezones += [
+FINAL_TARGET_FILES.res += [
     '../timezones/zones.json',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Lightning Only')
 
 with Files('content/suite-*'):
     BUG_COMPONENT = ('Calendar', 'Lightning: SeaMonkey Integration')
--- a/calendar/providers/caldav/moz.build
+++ b/calendar/providers/caldav/moz.build
@@ -5,14 +5,15 @@
 
 DIRS += ['public']
 
 EXTRA_COMPONENTS += [
     'calDavCalendar.js',
     'calDavCalendar.manifest',
 ]
 
-FINAL_TARGET_FILES['calendar-js'] += [
+# These files go in components so they can be packaged correctly.
+FINAL_TARGET_FILES.components += [
     'calDavRequestHandlers.js',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Provider: CalDAV')
--- a/calendar/providers/storage/moz.build
+++ b/calendar/providers/storage/moz.build
@@ -3,15 +3,15 @@
 # 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/.
 
 EXTRA_COMPONENTS += [
     'calStorageCalendar.js',
     'calStorageCalendar.manifest',
 ]
 
-EXTRA_JS_MODULES += [
+EXTRA_JS_MODULES.calendar += [
     'calStorageHelpers.jsm',
     'calStorageUpgrade.jsm',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Provider: Local Storage')
--- a/mail/installer/package-manifest.in
+++ b/mail/installer/package-manifest.in
@@ -302,22 +302,97 @@
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 
 #ifdef MOZ_CALENDAR
 [calendar]
-#ifdef NIGHTLY_BUILD
-@RESPATH@/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/
-#else
-@RESPATH@/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/
+@RESPATH@/chrome/calendar@JAREXT@
+@RESPATH@/chrome/calendar.manifest
+@RESPATH@/chrome/lightning@JAREXT@
+@RESPATH@/chrome/lightning.manifest
+
+@RESPATH@/res/zones.json
+@RESPATH@/@PREF_DIR@/lightning.js
+
+# Files added to components directory via `EXTRA_COMPONENTS`.
+@RESPATH@/components/calBackendLoader.js
+@RESPATH@/components/calBackendLoader.manifest
+@RESPATH@/components/calDefaultACLManager.js
+@RESPATH@/components/calDefaultACLManager.manifest
+@RESPATH@/components/calItemModule.js
+@RESPATH@/components/calItemModule.manifest
+@RESPATH@/components/calSleepMonitor.js
+@RESPATH@/components/calSleepMonitor.manifest
+@RESPATH@/components/calTimezoneService.js
+@RESPATH@/components/calTimezoneService.manifest
+@RESPATH@/components/calImportExportModule.js
+@RESPATH@/components/calImportExportModule.manifest
+@RESPATH@/components/calItipEmailTransport.js
+@RESPATH@/components/calItipEmailTransport.manifest
+@RESPATH@/components/calItipProtocolHandler.js
+@RESPATH@/components/calItipProtocolHandler.manifest
+@RESPATH@/components/lightningTextCalendarConverter.js
+@RESPATH@/components/lightningTextCalendarConverter.manifest
+@RESPATH@/components/calDavCalendar.js
+@RESPATH@/components/calDavCalendar.manifest
+@RESPATH@/components/calCompositeCalendar.js
+@RESPATH@/components/calCompositeCalendar.manifest
+@RESPATH@/components/calICSCalendar.js
+@RESPATH@/components/calICSCalendar.manifest
+@RESPATH@/components/calMemoryCalendar.js
+@RESPATH@/components/calMemoryCalendar.manifest
+@RESPATH@/components/calStorageCalendar.js
+@RESPATH@/components/calStorageCalendar.manifest
+@RESPATH@/components/calICALJSComponents.js
+
+# Files added to components directory via `FINAL_TARGET_FILES.components`.
+@RESPATH@/components/calAlarm.js
+@RESPATH@/components/calAlarmMonitor.js
+@RESPATH@/components/calAlarmService.js
+@RESPATH@/components/calAttachment.js
+@RESPATH@/components/calAttendee.js
+@RESPATH@/components/calCachedCalendar.js
+@RESPATH@/components/calCalendarManager.js
+@RESPATH@/components/calCalendarSearchService.js
+@RESPATH@/components/calDateTimeFormatter.js
+@RESPATH@/components/calDateTime.js
+@RESPATH@/components/calDavRequestHandlers.js
+@RESPATH@/components/calDeletedItems.js
+@RESPATH@/components/calDuration.js
+@RESPATH@/components/calEvent.js
+@RESPATH@/components/calFilter.js
+@RESPATH@/components/calFreeBusyService.js
+@RESPATH@/components/calHtmlExport.js
+@RESPATH@/components/calIcsImportExport.js
+@RESPATH@/components/calIcsParser.js
+@RESPATH@/components/calIcsSerializer.js
+@RESPATH@/components/calICSService.js
+@RESPATH@/components/calICSService-worker.js
+@RESPATH@/components/calItemBase.js
+@RESPATH@/components/calItipItem.js
+@RESPATH@/components/calListFormatter.js
+@RESPATH@/components/calMonthGridPrinter.js
+@RESPATH@/components/calOutlookCSVImportExport.js
+@RESPATH@/components/calPeriod.js
+@RESPATH@/components/calProtocolHandler.js
+@RESPATH@/components/calRecurrenceDate.js
+@RESPATH@/components/calRecurrenceInfo.js
+@RESPATH@/components/calRecurrenceRule.js
+@RESPATH@/components/calRelation.js
+@RESPATH@/components/calStartupService.js
+@RESPATH@/components/calTimezone.js
+@RESPATH@/components/calTodo.js
+@RESPATH@/components/calTransactionManager.js
+@RESPATH@/components/calWeekInfoService.js
+@RESPATH@/components/calWeekPrinter.js
 #endif
-#endif
+
 @RESPATH@/features/wetransfer@extensions.thunderbird.net/
 
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
 @RESPATH@/components/cryptoComponents.manifest
 @RESPATH@/components/Push.manifest
 
 @RESPATH@/components/l10n-registry.manifest
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -13,14 +13,8 @@ ABS_BINARY = $(abspath $(DIST))/$(APP_NA
 else
 # Non-mac options
 BINARY = $(DIST)/bin/thunderbird$(BIN_SUFFIX)
 ABS_BINARY = $(abspath $(BINARY))
 endif
 
 check-no-solo = $(foreach solo,SOLO_TEST SOLO_FILE,$(if $($(solo)),$(error $(subst SOLOVAR,$(solo),$(1)))))
 find-solo-test = $(if $(and $(SOLO_TEST),$(SOLO_FILE)),$(error Both SOLO_TEST and SOLO_FILE are specified. You may only specify one.),$(if $(SOLO_TEST),$(SOLO_TEST),$(if $(SOLO_FILE),$(SOLO_FILE),$(error SOLO_TEST or SOLO_FILE needs to be specified.))))
-
-# If Lightning is enabled, also stage the lightning extension
-ifdef MOZ_CALENDAR
-package-tests:
-	$(MAKE) -C $(commtopobjdir)/calendar/lightning stage-package
-endif