# HG changeset patch
# User Michael Kaply <mozilla@kaply.com>
# Date 1528922179 25200
# Node ID 33551f4516d03c52f67cf624ee8ece12352342df
# Parent  d1aa683d0a16f58f19400a87c3ef2fa6e73ea690
Bug 1468240 - Move searchplugins to mail directory. rs=jorgk DONTBUILD

diff --git a/mail/components/search/jar.mn b/mail/components/search/jar.mn
new file mode 100644
--- /dev/null
+++ b/mail/components/search/jar.mn
@@ -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/.
+
+messenger.jar:
+        searchplugins/                                              (searchplugins/**)
+
+% resource search-plugins %searchplugins/
diff --git a/mail/components/search/moz.build b/mail/components/search/moz.build
--- a/mail/components/search/moz.build
+++ b/mail/components/search/moz.build
@@ -12,8 +12,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
     EXTRA_PP_JS_MODULES += ['WinSearchIntegration.js']
     FINAL_LIBRARY = 'mailcomps'
 
 DIRS += ['public']
 
 EXTRA_PP_JS_MODULES += [
     'SearchIntegration.js',
 ]
+
+JAR_MANIFESTS += ['jar.mn']
diff --git a/mail/locales/en-US/searchplugins/bing.xml b/mail/components/search/searchplugins/bing.xml
rename from mail/locales/en-US/searchplugins/bing.xml
rename to mail/components/search/searchplugins/bing.xml
diff --git a/mail/locales/en-US/searchplugins/google.xml b/mail/components/search/searchplugins/google.xml
rename from mail/locales/en-US/searchplugins/google.xml
rename to mail/components/search/searchplugins/google.xml
diff --git a/mail/locales/search/list.json b/mail/components/search/searchplugins/list.json
rename from mail/locales/search/list.json
rename to mail/components/search/searchplugins/list.json
diff --git a/mail/locales/en-US/searchplugins/twitter.xml b/mail/components/search/searchplugins/twitter.xml
rename from mail/locales/en-US/searchplugins/twitter.xml
rename to mail/components/search/searchplugins/twitter.xml
diff --git a/mail/locales/en-US/searchplugins/wikipedia.xml b/mail/components/search/searchplugins/wikipedia.xml
rename from mail/locales/en-US/searchplugins/wikipedia.xml
rename to mail/components/search/searchplugins/wikipedia.xml
diff --git a/mail/locales/en-US/searchplugins/yahoo.xml b/mail/components/search/searchplugins/yahoo.xml
rename from mail/locales/en-US/searchplugins/yahoo.xml
rename to mail/components/search/searchplugins/yahoo.xml
diff --git a/mail/locales/en-US/searchplugins/amazondotcom.xml b/mail/components/search/searchplugins/amazondotcom.xml
rename from mail/locales/en-US/searchplugins/amazondotcom.xml
rename to mail/components/search/searchplugins/amazondotcom.xml
diff --git a/mail/locales/en-US/searchplugins/ddg.xml b/mail/components/search/searchplugins/ddg.xml
rename from mail/locales/en-US/searchplugins/ddg.xml
rename to mail/components/search/searchplugins/ddg.xml
diff --git a/mail/locales/Makefile.in b/mail/locales/Makefile.in
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -45,59 +45,40 @@ MOZ_PKG_MAC_ICON=$(ABS_DIST)/branding/di
 MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
 endif
 
 MOZ_SFX_PACKAGE=$(commtopsrcdir)/other-licenses/7zstub/thunderbird/7zSD.sfx
 MOZ_INSTALLER_PATH=$(commtopsrcdir)/mail/installer/windows
 
 NON_OMNIJAR_FILES = defaults/messenger/mailViews.dat
 
-SEARCHPLUGINS_FILENAMES := $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD)))
-SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD)
-SEARCHPLUGINS_TARGET := libs searchplugins
-SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(call EN_US_OR_L10N_FILE,searchplugins/$(plugin))),$(warning Missing searchplugin: $(plugin))))
-# Some locale-specific search plugins may have preprocessor directives, but the
-# default en-US ones do not.
-SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
-PP_TARGETS += SEARCHPLUGINS
-
-list-json = $(SEARCHPLUGINS_PATH)/list.json
-GARBAGE += $(list-json)
-
-libs:: searchplugins
-
 # Required for l10n.mk - defines a list of app sub dirs that should
 # be included in langpack xpis.
 DIST_SUBDIRS = $(DIST_SUBDIR)
 
 include $(moztopsrcdir)/config/rules.mk
 
 ifeq ($(commreltopsrcdir),comm)
 COMPARE_LOCALES_DEFINES += -Dmozilla=..
 endif
 
 include $(moztopsrcdir)/toolkit/locales/l10n.mk
 
-$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
-	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
-searchplugins:: $(list-json)
-
 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-$*)
 	$(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/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C ../../chat/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: $(SUBMAKEFILES)
 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
 
 langpack: langpack-$(AB_CD)
diff --git a/mail/locales/filter.py b/mail/locales/filter.py
--- a/mail/locales/filter.py
+++ b/mail/locales/filter.py
@@ -16,12 +16,9 @@ def test(mod, path, entity=None):
   if mod == "extensions/spellcheck":
     return "ignore"
 
   if path == "chrome/messenger-region/region.properties":
     return ("ignore" if (re.match(r"browser\.search\.order\.[1-9]", entity) or
                          re.match(r"mail\.addr_book\.mapit_url\.[1-5]", entity))
             else "error")
 
-  # ignore search plugins
-  if re.match(r"searchplugins\/.+\.xml", path):
-    return "ignore"
   return "error"
diff --git a/mail/locales/jar.mn b/mail/locales/jar.mn
--- a/mail/locales/jar.mn
+++ b/mail/locales/jar.mn
@@ -225,18 +225,16 @@
   locale/@AB_CD@/messenger/downloadsOverlay.dtd                         (%chrome/messenger/downloadsOverlay.dtd)
   locale/@AB_CD@/messenger/chat.dtd                                     (%chrome/messenger/chat.dtd)
   locale/@AB_CD@/messenger/chat.properties                              (%chrome/messenger/chat.properties)
   locale/@AB_CD@/messenger/addbuddy.dtd                                 (%chrome/messenger/addbuddy.dtd)
   locale/@AB_CD@/messenger/joinChat.dtd                                 (%chrome/messenger/joinChat.dtd)
   locale/@AB_CD@/messenger/imAccounts.properties                        (%chrome/messenger/imAccounts.properties)
   locale/@AB_CD@/messenger/imAccountWizard.dtd                          (%chrome/messenger/imAccountWizard.dtd)
   locale/@AB_CD@/messenger/sanitize.dtd									(%chrome/messenger/sanitize.dtd)
-  locale/@AB_CD@/messenger/searchplugins/list.json                      (.deps/generated_@AB_CD@/list.json)
-  locale/@AB_CD@/messenger/searchplugins/                               (.deps/generated_@AB_CD@/*.xml)
 % locale messenger-mapi @AB_CD@ %locale/@AB_CD@/messenger-mapi/
   locale/@AB_CD@/messenger-mapi/mapi.properties                         (%chrome/messenger-mapi/mapi.properties)
 % locale messenger-newsblog @AB_CD@ %locale/@AB_CD@/messenger-newsblog/
   locale/@AB_CD@/messenger-newsblog/newsblog.properties                 (%chrome/messenger-newsblog/newsblog.properties)
   locale/@AB_CD@/messenger-newsblog/feed-subscriptions.dtd              (%chrome/messenger-newsblog/feed-subscriptions.dtd)
   locale/@AB_CD@/messenger-newsblog/am-newsblog.dtd                     (%chrome/messenger-newsblog/am-newsblog.dtd)
 % locale messenger-smime @AB_CD@ %locale/@AB_CD@/messenger-smime/
   locale/@AB_CD@/messenger-smime/msgCompSMIMEOverlay.dtd                (%chrome/messenger-smime/msgCompSMIMEOverlay.dtd)
diff --git a/mail/locales/l10n.toml b/mail/locales/l10n.toml
--- a/mail/locales/l10n.toml
+++ b/mail/locales/l10n.toml
@@ -125,13 +125,8 @@ locales = [
     key = "re:browser\\.search\\.order\\.[1-9].*"
     action = "ignore"
 
 # map service prefs don't have the same number for all locales
 [[filters]]
     path = "{l}mail/chrome/messenger-region/region.properties"
     key = "re:mail\\.addr_book\\.mapit_url\\.[1-5].*"
     action = "ignore"
-
-# search plugins are different per locale, ignore file difference
-[[filters]]
-    path = "{l}mail/searchplugins/*.xml"
-    action = "ignore"
