Bug 1426547: Fix branding to use moz.build; r=Fallen
authorTom Prince <mozilla@hocat.ca>
Mon, 18 Dec 2017 14:49:41 -0700
changeset 22946 3744f4ef8956d4368a213b31d7b75c169eab406f
parent 22945 2639c3ea8ba0f3642ea0dadb2504f934b964ef12
child 22947 fb4b9040b9f3a94ce171089cf123bf01cfa90e40
push id13892
push usermozilla@hocat.ca
push dateSun, 31 Dec 2017 20:32:46 +0000
treeherdercomm-central@3744f4ef8956 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1426547
Bug 1426547: Fix branding to use moz.build; r=Fallen MozReview-Commit-ID: ERKx8z2MXv1
mail/app/Makefile.in
mail/branding/branding-common.mozbuild
mail/branding/nightly/Makefile.in
mail/branding/nightly/default128.png
mail/branding/nightly/default16.png
mail/branding/nightly/default22.png
mail/branding/nightly/default24.png
mail/branding/nightly/default256.png
mail/branding/nightly/default32.png
mail/branding/nightly/default48.png
mail/branding/nightly/default64.png
mail/branding/nightly/jar.mn
mail/branding/nightly/mailicon128.png
mail/branding/nightly/mailicon16.png
mail/branding/nightly/mailicon22.png
mail/branding/nightly/mailicon24.png
mail/branding/nightly/mailicon256.png
mail/branding/nightly/mailicon32.png
mail/branding/nightly/mailicon48.png
mail/branding/nightly/mailicon64.png
mail/branding/nightly/messengerWindow.ico
mail/branding/nightly/moz.build
mail/branding/nightly/thunderbird.ico
mail/installer/Makefile.in
other-licenses/branding/thunderbird/Makefile.in
other-licenses/branding/thunderbird/default128.png
other-licenses/branding/thunderbird/default16.png
other-licenses/branding/thunderbird/default22.png
other-licenses/branding/thunderbird/default24.png
other-licenses/branding/thunderbird/default256.png
other-licenses/branding/thunderbird/default32.png
other-licenses/branding/thunderbird/default48.png
other-licenses/branding/thunderbird/default64.png
other-licenses/branding/thunderbird/mailicon128.png
other-licenses/branding/thunderbird/mailicon16.png
other-licenses/branding/thunderbird/mailicon22.png
other-licenses/branding/thunderbird/mailicon24.png
other-licenses/branding/thunderbird/mailicon256.png
other-licenses/branding/thunderbird/mailicon32.png
other-licenses/branding/thunderbird/mailicon48.png
other-licenses/branding/thunderbird/mailicon64.png
other-licenses/branding/thunderbird/messengerWindow.ico
other-licenses/branding/thunderbird/moz.build
other-licenses/branding/thunderbird/thunderbird.ico
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 AB_CD = $(MOZ_UI_LOCALE)
 
 GRE_MILESTONE = $(shell $(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build Milestone)
 MOZ_BUILDID = $(shell $(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
 
 DEFINES += \
-  -DTHUNDERBIRD_ICO='"$(DIST)/branding/thunderbird.ico"' \
+  -DTHUNDERBIRD_ICO='"$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/messengerWindow.ico"' \
    $(NULL)
 
 # Build a binary bootstrapping with XRE_main
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
@@ -92,25 +92,20 @@ BRANDED_ICONS = \
 
 
 DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))
 BRANDED_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(BRANDED_ICONS) $(BRANDED_ICONS_SMALL))
 
 libs:: $(addprefix icons/$(MOZ_WIDGET_TOOLKIT)/,$(DESKTOP_ICON_FILES))
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default
 
-libs:: $(addprefix $(DIST)/branding/,$(BRANDED_ICON_FILES))
+libs:: $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/messengerWindow.ico
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default
 endif
 
-ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
-libs::
-	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default* $(DIST)/bin/chrome/icons/default
-endif
-
 libs:: $(srcdir)/profile/prefs.js
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
 
 # channel-prefs.js is handled separate from other prefs due to bug 756325
 libs:: $(srcdir)/profile/channel-prefs.js
 	$(NSINSTALL) -D $(DIST)/bin/defaults/pref
 	$(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
 
@@ -147,17 +142,17 @@ tools repackage:: $(PROGRAM)
 	sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Info.plist.in > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist'
 	sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)/InfoPlist.strings'
 	rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources'
 	rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
 	$(RM) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)'
 	rsync -aL $(PROGRAM) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
 	rsync -a --copy-unsafe-links $(DIST)/package/thunderbird.mdimporter '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
-	cp -RL $(DIST)/branding/thunderbird.icns '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/thunderbird.icns'
+	cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/thunderbird.icns '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/thunderbird.icns'
 	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
 ifdef MOZ_UPDATER
 	mv -f '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
 	ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
 endif
 	printf APPLMOZM > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo'
 endif
 
new file mode 100644
--- /dev/null
+++ b/mail/branding/branding-common.mozbuild
@@ -0,0 +1,28 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# 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/.
+
+@template
+def ThunderbirdBranding():
+    JS_PREFERENCE_FILES += [
+        'thunderbird-branding.js',
+    ]
+
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+        FINAL_TARGET_FILES += [
+            'thunderbird.VisualElementsManifest.xml',
+        ]
+        FINAL_TARGET_FILES.VisualElements += [
+            'VisualElements_150.png',
+            'VisualElements_70.png',
+        ]
+    elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+        FINAL_TARGET_FILES.chrome.icons.default += [
+            'default128.png',
+            'default16.png',
+            'default32.png',
+            'default48.png',
+            'default64.png',
+        ]
deleted file mode 100644
--- a/mail/branding/nightly/Makefile.in
+++ /dev/null
@@ -1,38 +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/.
-
-# Branding Makefile for nightlies/unofficial branding
-
-include $(moztopsrcdir)/config/rules.mk
-
-export::
-	$(NSINSTALL) -D $(DIST)/branding
-ifeq ($(OS_ARCH),WINNT)
-	cp $(srcdir)/thunderbird.ico   $(DIST)/branding/thunderbird.ico
-	cp $(srcdir)/branding.nsi      $(DIST)/branding/branding.nsi
-	cp $(srcdir)/wizHeader.bmp     $(DIST)/branding/wizHeader.bmp
-	cp $(srcdir)/wizHeaderRTL.bmp  $(DIST)/branding/wizHeaderRTL.bmp
-	cp $(srcdir)/wizWatermark.bmp  $(DIST)/branding/wizWatermark.bmp
-endif
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-	cp $(srcdir)/background.png    $(DIST)/branding/background.png
-	cp $(srcdir)/dsstore           $(DIST)/branding/dsstore
-	cp $(srcdir)/disk.icns         $(DIST)/branding/disk.icns
-	cp $(srcdir)/thunderbird.icns  $(DIST)/branding/thunderbird.icns
-endif
-ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
-	cp $(srcdir)/mailicon16.png  $(DIST)/branding/default16.png
-	cp $(srcdir)/mailicon22.png  $(DIST)/branding/default22.png
-	cp $(srcdir)/mailicon24.png  $(DIST)/branding/default24.png
-	cp $(srcdir)/mailicon32.png  $(DIST)/branding/default32.png
-	cp $(srcdir)/mailicon48.png  $(DIST)/branding/default48.png
-	cp $(srcdir)/mailicon64.png  $(DIST)/branding/default64.png
-	cp $(srcdir)/mailicon128.png $(DIST)/branding/default128.png
-	cp $(srcdir)/mailicon256.png $(DIST)/branding/default256.png
-endif
-
-# Now sort out the branding specific icons
-ifeq ($(OS_ARCH),WINNT)
-	cp $(srcdir)/windows/messengerWindow.ico  $(DIST)/branding/messengerWindow.ico
-endif
rename from mail/branding/nightly/mailicon128.png
rename to mail/branding/nightly/default128.png
rename from mail/branding/nightly/mailicon16.png
rename to mail/branding/nightly/default16.png
rename from mail/branding/nightly/mailicon22.png
rename to mail/branding/nightly/default22.png
rename from mail/branding/nightly/mailicon24.png
rename to mail/branding/nightly/default24.png
rename from mail/branding/nightly/mailicon256.png
rename to mail/branding/nightly/default256.png
rename from mail/branding/nightly/mailicon32.png
rename to mail/branding/nightly/default32.png
rename from mail/branding/nightly/mailicon48.png
rename to mail/branding/nightly/default48.png
rename from mail/branding/nightly/mailicon64.png
rename to mail/branding/nightly/default64.png
--- a/mail/branding/nightly/jar.mn
+++ b/mail/branding/nightly/jar.mn
@@ -4,12 +4,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 messenger.jar:
 % content branding %content/branding/
   content/branding/about-background.png             (content/about-background.png)
   content/branding/about-logo.png                   (content/about-logo.png)
   content/branding/about-wordmark.png               (content/about-wordmark.png)
   content/branding/about.png                        (content/about.png)
-  content/branding/icon48.png                       (mailicon48.png)
-  content/branding/icon64.png                       (mailicon64.png)
+  content/branding/icon48.png                       (default48.png)
+  content/branding/icon64.png                       (default48.png)
   content/branding/aboutDialog.css                  (content/aboutDialog.css)
-  ../classic/skin/classic/messenger/icons/new-mail-alert.png  (mailicon48.png)
+  ../classic/skin/classic/messenger/icons/new-mail-alert.png  (default48.png)
rename from mail/branding/nightly/thunderbird.ico
rename to mail/branding/nightly/messengerWindow.ico
--- a/mail/branding/nightly/moz.build
+++ b/mail/branding/nightly/moz.build
@@ -1,21 +1,12 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # 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']
 
-JS_PREFERENCE_FILES += [
-    'thunderbird-branding.js',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-  FINAL_TARGET_FILES += [
-      'thunderbird.VisualElementsManifest.xml',
-  ]
-  FINAL_TARGET_FILES.VisualElements += [
-      'VisualElements_150.png',
-      'VisualElements_70.png',
-  ]
+include('../branding-common.mozbuild')
+ThunderbirdBranding()
--- a/mail/installer/Makefile.in
+++ b/mail/installer/Makefile.in
@@ -116,19 +116,19 @@ ifdef MAKENSISU
 DEFINES += -DHAVE_MAKENSISU=1
 endif
 
 ifdef MOZ_PREF_EXTENSIONS
 DEFINES += -DMOZ_PREF_EXTENSIONS=1
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-MOZ_PKG_MAC_DSSTORE=branding/dsstore
-MOZ_PKG_MAC_BACKGROUND=branding/background.png
-MOZ_PKG_MAC_ICON=branding/disk.icns
+MOZ_PKG_MAC_DSSTORE=$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/dsstore
+MOZ_PKG_MAC_BACKGROUND=$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/background.png
+MOZ_PKG_MAC_ICON=$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
 endif
 
 NON_OMNIJAR_FILES = defaults/messenger/mailViews.dat
 
 include $(moztopsrcdir)/toolkit/mozapps/installer/signing.mk
 include $(moztopsrcdir)/toolkit/mozapps/installer/packager.mk
 
deleted file mode 100644
--- a/other-licenses/branding/thunderbird/Makefile.in
+++ /dev/null
@@ -1,37 +0,0 @@
-# Branding Makefile
-#  - jars chrome artwork
-#  - copies artwork to appropriate places in objdir for bundling into app
-#    resources
-
-include $(topsrcdir)/config/rules.mk
-
-export::
-	$(NSINSTALL) -D $(DIST)/branding
-# Export items into the branding directory first
-ifeq ($(OS_ARCH),WINNT)
-	cp $(srcdir)/thunderbird.ico   $(DIST)/branding/thunderbird.ico
-	cp $(srcdir)/branding.nsi      $(DIST)/branding/branding.nsi
-	cp $(srcdir)/wizHeader.bmp     $(DIST)/branding/wizHeader.bmp
-	cp $(srcdir)/wizHeaderRTL.bmp  $(DIST)/branding/wizHeaderRTL.bmp
-	cp $(srcdir)/wizWatermark.bmp  $(DIST)/branding/wizWatermark.bmp
-endif
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-	cp $(srcdir)/background.png    $(DIST)/branding/background.png
-	cp $(srcdir)/dsstore           $(DIST)/branding/dsstore
-	cp $(srcdir)/disk.icns         $(DIST)/branding/disk.icns
-	cp $(srcdir)/thunderbird.icns  $(DIST)/branding/thunderbird.icns
-endif
-ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
-	cp $(srcdir)/mailicon16.png  $(DIST)/branding/default16.png
-	cp $(srcdir)/mailicon22.png  $(DIST)/branding/default22.png
-	cp $(srcdir)/mailicon24.png  $(DIST)/branding/default24.png
-	cp $(srcdir)/mailicon32.png  $(DIST)/branding/default32.png
-	cp $(srcdir)/mailicon48.png  $(DIST)/branding/default48.png
-	cp $(srcdir)/mailicon64.png  $(DIST)/branding/default64.png
-	cp $(srcdir)/mailicon128.png $(DIST)/branding/default128.png
-	cp $(srcdir)/mailicon256.png $(DIST)/branding/default256.png
-endif
-# Now sort out the branding specific icons
-ifeq ($(OS_ARCH),WINNT)
-	cp $(srcdir)/thunderbird.ico  $(DIST)/branding/messengerWindow.ico
-endif
rename from other-licenses/branding/thunderbird/mailicon128.png
rename to other-licenses/branding/thunderbird/default128.png
rename from other-licenses/branding/thunderbird/mailicon16.png
rename to other-licenses/branding/thunderbird/default16.png
rename from other-licenses/branding/thunderbird/mailicon22.png
rename to other-licenses/branding/thunderbird/default22.png
rename from other-licenses/branding/thunderbird/mailicon24.png
rename to other-licenses/branding/thunderbird/default24.png
rename from other-licenses/branding/thunderbird/mailicon256.png
rename to other-licenses/branding/thunderbird/default256.png
rename from other-licenses/branding/thunderbird/mailicon32.png
rename to other-licenses/branding/thunderbird/default32.png
rename from other-licenses/branding/thunderbird/mailicon48.png
rename to other-licenses/branding/thunderbird/default48.png
rename from other-licenses/branding/thunderbird/mailicon64.png
rename to other-licenses/branding/thunderbird/default64.png
rename from other-licenses/branding/thunderbird/thunderbird.ico
rename to other-licenses/branding/thunderbird/messengerWindow.ico
--- a/other-licenses/branding/thunderbird/moz.build
+++ b/other-licenses/branding/thunderbird/moz.build
@@ -2,20 +2,10 @@
 # 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']
 
-JS_PREFERENCE_FILES += [
-    'thunderbird-branding.js',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-  FINAL_TARGET_FILES += [
-      'thunderbird.VisualElementsManifest.xml',
-  ]
-  FINAL_TARGET_FILES.VisualElements += [
-      'VisualElements_150.png',
-      'VisualElements_70.png',
-  ]
+include('../../../mail/branding/branding-common.mozbuild')
+ThunderbirdBranding()