]> granicus.if.org Git - icu/commitdiff
ICU-20660 Add usePoolBundle option to filters.json.
authorShane Carr <shane@unicode.org>
Mon, 10 Jun 2019 23:07:53 +0000 (16:07 -0700)
committerShane F. Carr <shane@unicode.org>
Tue, 18 Jun 2019 02:54:28 +0000 (19:54 -0700)
docs/userguide/icu_data/buildtool.md
icu4c/source/data/BUILDRULES.py
icu4c/source/python/icutools/databuilder/__main__.py
icu4c/source/python/icutools/databuilder/filtration_schema.json

index 68a970cb0fe99f9f750e809bd5500a2773ac89df..1741575d8b4a0453c36d90c5af0b0ed80743a160 100644 (file)
@@ -673,6 +673,21 @@ implicithan version, put the following setting in your *filters.json* file:
       "collationUCAData": "implicithan"
     }
 
+### Disable Pool Bundle
+
+By default, ICU uses a "pool bundle" to store strings shared between locales.
+This saves space and is recommended for most users. However, when developing
+a system where locale data files may be added "on the fly" and not included in
+the original ICU distribution, those additional data files may not be able to
+use a pool bundle due to name collisions with the existing pool bundle.
+
+To disable the pool bundle in the current ICU build, put the following setting
+in your *filters.json* file:
+
+    {
+      "usePoolBundle": false
+    }
+
 ### File Substitution
 
 Using the configuration file, you can perform whole-file substitutions.  For
index 56eb0e48fea1f15a410b5ba63587e82cfe0cbe7b..c6e584b8734efcce470b001ed28f63aadb1828f1 100644 (file)
@@ -42,48 +42,49 @@ def generate(config, glob, common_vars):
         "locales",
         None,
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "curr",
         "curr",
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "lang",
         "lang",
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "region",
         "region",
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "zone",
         "zone",
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "unit",
         "unit",
         "icu-locale-deprecates.xml",
-        True,
+        config.use_pool_bundle,
         [])
 
     requests += generate_tree(config, glob, common_vars,
         "coll",
         "coll",
         "icu-coll-deprecates.xml",
+        # Never use pool bundle for coll, brkitr, or rbnf
         False,
         # Depends on timezoneTypes.res and keyTypeData.res.
         # TODO: We should not need this dependency to build collation.
@@ -94,6 +95,7 @@ def generate(config, glob, common_vars):
         "brkitr",
         "brkitr",
         "icu-locale-deprecates.xml",
+        # Never use pool bundle for coll, brkitr, or rbnf
         False,
         [DepTarget("brkitr_brk"), DepTarget("dictionaries")])
 
@@ -101,6 +103,7 @@ def generate(config, glob, common_vars):
         "rbnf",
         "rbnf",
         "icu-rbnf-deprecates.xml",
+        # Never use pool bundle for coll, brkitr, or rbnf
         False,
         [])
 
index 95d70a0ac078517a52e5963ac2c943fd22172b5f..7cfec1453bef97c3a7365ca6e7c1f84b4e8a8795 100644 (file)
@@ -151,6 +151,11 @@ class Config(object):
         if "strategy" in self.filters_json_data:
             self.strategy = self.filters_json_data["strategy"]
 
+        # True or False (could be extended later to support enum/list)
+        self.use_pool_bundle = True
+        if "usePoolBundle" in self.filters_json_data:
+            self.use_pool_bundle = self.filters_json_data["usePoolBundle"]
+
     def _parse_filter_file(self, f):
         # Use the Hjson parser if it is available; otherwise, use vanilla JSON.
         try:
index 929cdb5ed6651c16f12481160b6ca1656c50122f..e35d07257c07fecd4bbf64dab34a66cc938e9c95 100644 (file)
@@ -69,6 +69,9 @@
         "collationUCAData": {
             "type": "string",
             "enum": ["unihan", "implicithan"]
+        },
+        "usePoolBundle": {
+            "type": "boolean"
         }
     },
     "additionalProperties": false,