Bug 1437942 - Part 3b: Make mobile/android resource://search-plugins reference srcdir. r?mkaply,Build draft
authorNick Alexander <nalexander@mozilla.com>
Fri, 25 May 2018 16:39:33 -0700
changeset 800147 9031afc664a79439b355c8c0cc68a5156a400c9f
parent 800146 877f59e16bf43900a406ff530ba2fd813ffebd24
push id111285
push usernalexander@mozilla.com
push dateFri, 25 May 2018 23:53:41 +0000
reviewersmkaply, Build
bugs1437942
milestone62.0a1
Bug 1437942 - Part 3b: Make mobile/android resource://search-plugins reference srcdir. r?mkaply,Build So nice to purge some of the worst Make code in the entire tree. It's unfortunate to expand the duplicate whitelist, but {ddg,duckduckgo}.xml is a business requirement. We expect to clean bolcom*.xml in follow-up. MozReview-Commit-ID: Iv7hWnqMdC7
mobile/android/chrome/jar.mn
mobile/android/components/moz.build
mobile/android/components/search/jar.mn
mobile/android/components/search/moz.build
mobile/android/installer/allowed-dupes.mn
mobile/locales/Makefile.in
--- a/mobile/android/chrome/jar.mn
+++ b/mobile/android/chrome/jar.mn
@@ -82,10 +82,8 @@ chrome.jar:
 % override chrome://global/locale/global.dtd chrome://browser/locale/overrides/global.dtd
 % override chrome://global/locale/AccessFu.properties chrome://browser/locale/overrides/AccessFu.properties
 % override chrome://global/locale/dom/dom.properties chrome://browser/locale/overrides/dom/dom.properties
 % override chrome://global/locale/plugins.properties chrome://browser/locale/overrides/plugins.properties
 
 # mobile/locales/jar.mn resources and overrides
 % override chrome://global/locale/netError.dtd    chrome://browser/locale/netError.dtd
 % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
-% resource search-plugins chrome://browser/locale/searchplugins/
-
--- a/mobile/android/components/moz.build
+++ b/mobile/android/components/moz.build
@@ -46,9 +46,10 @@ EXTRA_COMPONENTS += [
 EXTRA_PP_COMPONENTS += [
     'MobileComponents.manifest',
 ]
 
 DIRS += [
     'extensions',
     'build',
     'geckoview',
+    'search',
 ]
new file mode 100644
--- /dev/null
+++ b/mobile/android/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/.
+
+chrome.jar:
+        searchplugins/                                              (searchplugins/**)
+
+% resource search-plugins %searchplugins/
new file mode 100644
--- /dev/null
+++ b/mobile/android/components/search/moz.build
@@ -0,0 +1,10 @@
+# -*- 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/.
+
+JAR_MANIFESTS += ['jar.mn']
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Awesomescreen')
--- a/mobile/android/installer/allowed-dupes.mn
+++ b/mobile/android/installer/allowed-dupes.mn
@@ -43,8 +43,12 @@ res/table-remove-column-active.gif
 res/table-remove-column-hover.gif
 res/table-remove-column.gif
 res/table-remove-row-active.gif
 res/table-remove-row-hover.gif
 res/table-remove-row.gif
 res/multilocale.txt
 modules/commonjs/index.js
 update.locale
+chrome/chrome/searchplugins/bolcom-fy-NL.xml
+chrome/chrome/searchplugins/bolcom-nl.xml
+chrome/chrome/searchplugins/ddg.xml
+chrome/chrome/searchplugins/duckduckgo.xml
--- a/mobile/locales/Makefile.in
+++ b/mobile/locales/Makefile.in
@@ -1,142 +1,30 @@
 # -*- makefile -*-
 # 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/.
 
-#####################################################################################
-# Dependency build overhead:
-#   o always create/update/hard link targets boomkarks.json & searchplugins
-#   o latest symlink will be correct for the current locale / local build.
-#   o logic is essentially FORCE for language packs w/o all the build overhead
-#   o phase 2: replace hard links with a user function able to derive path
-#     based on current locale.
-#####################################################################################
-
 include $(topsrcdir)/config/config.mk
 
 USE_AUTOTARGETS_MK=1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
-# Separate items of contention
-tgt-gendir = .deps/generated_$(AB_CD)
-
-GENERATED_DIRS += .deps
-
 $(call errorIfEmpty,MOZ_BRANDING_DIRECTORY)
 SUBMAKEFILES += \
         $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
         $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
         $(NULL)
 
-###########################################################################
-# Default target, preserve existing functionality for:
-#    gmake -C $obj/mobile/locales
-###########################################################################
-search-jar-default: search-jar
-
-
-###########################################################################
-## Searchlist plugin config
-plugin-file-array = \
-  $(srcdir)/search/list.json \
-  $(NULL)
-
-###########################################################################
-plugin_file    = $(firstword $(plugin-file-array))
-plugin-file-ts = $(tgt-gendir)/$(subst $(topsrcdir)/,$(NULL),$(plugin_file)).ts
-
-GARBAGE += $(plugin-file-ts)
-# ---------------------------------------------------------------------------
-# plugin-file-ts track searchlist file used ($path/list.json)
-# and time when the file was last modified.
-###########################################################################
-plugin-file-ts-preqs = \
-  $(call mkdir_deps,$(dir $(plugin-file-ts))) \
-  $(plugin_file) \
-  $(NULL)
-
-###########################################################################
-# Detect locale changes.  Force stale deps when searchlist file
-# or content has changed.
-$(plugin-file-ts): $(plugin-file-ts-preqs)
-	@touch $@
-
-
-###########################################################################
-search-jar-common = tmp-search.jar.mn
-search-jar        = $(tgt-gendir)/$(search-jar-common)
-search-jar-ts     = $(search-jar).ts
-
-GARBAGE += $(search-jar) $(search-jar-ts) $(search-jar-common)
-# ---------------------------------------------------------------------------
-# search-jar contains a list of providers for the search plugin
-###########################################################################
-SEARCH_PLUGINS := $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD)))
-$(call errorIfEmpty,SEARCH_PLUGINS)
-
-search-jar-preqs = \
-  $(plugin-file-ts) \
-  $(if $(IS_LANGUAGE_REPACK),FORCE) \
-  $(NULL)
-
-.PHONY: search-jar
-search-jar: $(search-jar)
-$(search-jar): $(search-jar-preqs)
-	@echo '\nGenerating: search-jar'
-	printf '$(AB_CD).jar:' > $@
-	ln -fn $@ .
-	printf '$(foreach plugin,$(SEARCH_PLUGINS),$(subst __PLUGIN_SUBST__,$(plugin), \n locale/$(AB_CD)/browser/searchplugins/__PLUGIN_SUBST__.xml (__PLUGIN_SUBST__.xml)))' >>  $@
-	printf '\n locale/$(AB_CD)/browser/searchplugins/list.json (list.json)' >> $@
-	@echo   >> $@
-
-###################
-search-dir-deps = \
-  $(plugin-file) \
-  $(dir-chrome) \
-  $(NULL)
-
-search-preqs =\
-  $(call mkdir_deps,$(dir $(search-jar-ts))) \
-  $(call mkdir_deps,$(FINAL_TARGET)/chrome) \
-  $(search-jar) \
-  $(search-dir-deps) \
-  $(if $(IS_LANGUAGE_REPACK),FORCE) \
-  $(GLOBAL_DEPS) \
-  $(NULL)
-
-.PHONY: searchplugins
-searchplugins: $(search-preqs)
-	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(tgt-gendir)/list.json)
-	$(call py_action,jar_maker,\
-          $(QUIET) -d $(FINAL_TARGET) \
-          -s $(topsrcdir)/$(relativesrcdir)/searchplugins \
-          -s $(tgt-gendir) \
-          $(MAKE_JARS_FLAGS) $(search-jar))
-	$(TOUCH) $@
-
 include $(topsrcdir)/config/rules.mk
 
-
-#############
-libs-preqs =\
-  $(call mkdir-deps,$(DIST)/install) \
-  $(NULL)
-
 libs-%: AB_CD=$*
-libs-%: $(libs-preqs)
-	$(display-deps)
+libs-%:
+	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
-	@$(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-$*
 
 # Tailored target to just add the chrome processing for multi-locale builds
 chrome-%: AB_CD=$*
 chrome-%:
-	$(display-deps)
-	@$(MAKE) -B searchplugins AB_CD=$*
 	@$(MAKE) chrome AB_CD=$*
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
-
-
-export:: searchplugins