]> granicus.if.org Git - icu/commitdiff
ICU-10842 update dependencies. Also update tool and add emacs mode.
authorSteven R. Loomis <srl@icu-project.org>
Tue, 1 Jul 2014 18:30:14 +0000 (18:30 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Tue, 1 Jul 2014 18:30:14 +0000 (18:30 +0000)
X-SVN-Rev: 35977

.gitattributes
icu4c/source/test/depstest/dependencies.py
icu4c/source/test/depstest/dependencies.txt
icu4c/source/test/depstest/depstest.py
icu4c/source/test/depstest/icu-dependencies-mode.el [new file with mode: 0644]

index a7405598779256c7a5378dbd1f4c5b427d9fb2da..161a33985c87bc2b080f14700ff4bb5db74f2ffc 100644 (file)
@@ -143,6 +143,7 @@ icu4c/source/stubdata/stubdata.vcxproj -text
 icu4c/source/stubdata/stubdata.vcxproj.filters -text
 icu4c/source/test/cintltst/cintltst.vcxproj -text
 icu4c/source/test/cintltst/cintltst.vcxproj.filters -text
+icu4c/source/test/depstest/icu-dependencies-mode.el -text
 icu4c/source/test/intltest/intltest.vcxproj -text
 icu4c/source/test/intltest/intltest.vcxproj.filters -text
 icu4c/source/test/intltest/scientificformathelpertest.cpp -text
index 448f685c5111800fc6f319d447de8f7ed7c13589..fb1fc2e3b1011a73bda34742e2b8602d44ca4554 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2011, International Business Machines
+# Copyright (C) 2011-2014, International Business Machines
 # Corporation and others. All Rights Reserved.
 #
 # file name: dependencies.py
@@ -22,6 +22,7 @@ Attributes:
     The one "system_symbols" item and its groups have sets of "system_symbols"
     with standard-library system symbol names.
   libraries: Set of library names mentioned in the dependencies file.
+  file_to_item: Map from a symbol (ushoe.o) to library or group (shoesize)
 """
 __author__ = "Markus W. Scherer"
 
@@ -35,6 +36,7 @@ import sys
 files = set()
 items = {}
 libraries = set()
+file_to_item = {}
 
 _line_number = 0
 _groups_to_be_defined = set()
@@ -85,6 +87,7 @@ def _ReadFiles(deps_file, item, library_name):
         sys.exit("Error:%d: file %s listed in multiple groups" % (_line_number, file_name))
       files.add(file_name)
       item_files.add(file_name)
+      file_to_item[file_name] = item["name"]
 
 def _IsLibrary(item): return item and item["type"] == "library"
 
@@ -151,7 +154,7 @@ def Load():
         if name in items:
           sys.exit("Error:%d: library definition using duplicate name %s" % (_line_number, name))
         libraries.add(name)
-        item = items[name] = {"type": "library"}
+        item = items[name] = {"type": "library", "name": name}
         line = _ReadFiles(deps_file, item, name)
       elif line.startswith("group: "):
         current_type = "group"
@@ -164,6 +167,7 @@ def Load():
           sys.exit("Error:%d: group definition using duplicate name %s" % (_line_number, name))
         _groups_to_be_defined.remove(name)
         item = items[name]
+        item["name"] = name
         library_name = item.get("library")
         if library_name:
           line = _ReadFiles(deps_file, item, library_name)
@@ -184,7 +188,7 @@ def Load():
         current_type = "system_symbols"
         if current_type in items:
           sys.exit("Error:%d: duplicate entry for system_symbols" % _line_number)
-        item = items[current_type] = {"type": current_type}
+        item = items[current_type] = {"type": current_type, "name": current_type}
         line = _ReadSystemSymbols(deps_file, item)
       else:
         sys.exit("Syntax error:%d: %s" % (_line_number, line))
index 855016f25f4e8f96c78b717d8c30f857e1b620a3..52a4684179b163545e8ea58fff7db54e9e468a7e 100644 (file)
@@ -1,3 +1,4 @@
+# -*- icu-dependencies -*-
 # Copyright (C) 2011-2014, International Business Machines
 # Corporation and others. All Rights Reserved.
 #
@@ -180,6 +181,7 @@ group: breakiterator
     uhash ustack utrie
     ucharstrie bytestrie
     normlzr  # for dictbe.o, should switch to Normalizer2
+    uvector32 # for dictbe.o
 
 group: unormcmp  # unorm_compare()
     unormcmp.o
@@ -337,7 +339,7 @@ group: unistr_cnv
 group: unistr_core
     unistr.o
   deps
-    ustrtrns appendable
+    ustrtrns appendable stringpiece
 
 group: uscript
     uscript.o  # uscript_getCode() accepts a locale ID and loads its script code data
@@ -718,7 +720,7 @@ group: appendable
 group: icuplug
     icuplug.o
   deps
-    platform
+    platform charstr
 
 group: ucol_swp
     ucol_swp.o
@@ -819,7 +821,7 @@ group: collation
   deps
     bytestream normalizer2 resourcebundle service_registration
     ucharstrieiterator uiter ulist uset usetiter uvector32 uvector64
-    uclean_i18n
+    uclean_i18n propname
 
 group: collation_builder
     # The CollationBaseDataBuilder is only called from genuca, and maybe from tests.
@@ -847,6 +849,8 @@ group: formatting
     # decimalformat
     dcfmtsym.o decfmtst.o decimfmt.o decimalformatpattern.o compactdecimalformat.o
     numfmt.o numsys.o unumsys.o unum.o winnmfmt.o
+    # scientificformathelper - would depend on dcfmtsym, so would be circular.
+    scientificformathelper.o
     # rbnf
     nfrs.o nfrule.o nfsubs.o rbnf.o
     # measureformat
@@ -872,8 +876,14 @@ group: formatting
     floating_point  # sqrt() for astro.o
     trigonometry  # for astro.o
     stdlib_qsort  # for ucurr.o (which does not use ICU's uarrsort.o)
+    sharedbreakiterator # for reldatefmt.o
     uclean_i18n
 
+group: sharedbreakiterator
+    sharedbreakiterator.o
+  deps
+    breakiterator
+
 group: digitlist
     digitlst.o decContext.o decNumber.o
   deps
@@ -926,10 +936,16 @@ group: translit
     formatting  # for Transliterator::getDisplayName()
     uclean_i18n
 
+# This is off by default, UCONFIG_NO_FILTERED_BREAK_ITERATION=0
+# so, you will see warnings:
+#Info:  group filteredbreakiterator  does not need to depend on  breakiterator
+#Info:  group filteredbreakiterator  does not need to depend on  ucharstriebuilder
 group: filteredbreakiterator
     filteredbrk.o
   deps
     breakiterator ucharstriebuilder
+    # depends on global new/delete and STL. Not recording these here.
+    # http://bugs.icu-project.org/trac/ticket/10990
 
 group: universal_time_scale
     utmscale.o
index bcc527b8e15a1bdc3e9b399e46cd12693c2a1538..eae09f65245191730123d9f7285f6812790f362b 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2011, International Business Machines
+# Copyright (C) 2011-2014, International Business Machines
 # Corporation and others. All Rights Reserved.
 #
 # file name: depstest.py
@@ -127,8 +127,13 @@ def _Resolve(name, parents):
   for symbol in imports:
     for file_name in files:
       if symbol in _obj_files[file_name]["imports"]:
-        sys.stderr.write("Error:  %s %s  file  %s  imports  %s  but  %s  does not depend on  %s\n" %
-                         (item_type, name, file_name, symbol, name, _symbols_to_files.get(symbol)))
+        neededFile = _symbols_to_files.get(symbol)
+        if neededFile:
+          neededItem = "%s (for %s)" % (dependencies.file_to_item[neededFile], neededFile)
+        else:
+          neededItem = "(system symbol?)"
+        sys.stderr.write("Error: in %s %s: %s imports %s but %s does not depend on %s\n" %
+                         (item_type, name, file_name, symbol, name, neededItem))
     _return_value = 1
   del parents[-1]
   return item
@@ -183,6 +188,8 @@ def main():
     print "Info: ignored symbols:\n%s" % sorted(_ignored_symbols)
   if not _return_value:
     print "OK: Specified and actual dependencies match."
+  else:
+    print "Error: There were errors, please fix them and re-run. Processing may have terminated abnormally."
   return _return_value
 
 if __name__ == "__main__":
diff --git a/icu4c/source/test/depstest/icu-dependencies-mode.el b/icu4c/source/test/depstest/icu-dependencies-mode.el
new file mode 100644 (file)
index 0000000..26e5392
--- /dev/null
@@ -0,0 +1,21 @@
+;; Copyright (c) 2014 IBM Corporation and others, all rights reserved
+;; Thx: http://www.ergoemacs.org/emacs/elisp_syntax_coloring.html
+;; Thx: http://repo.or.cz/w/emacs.git/blob/HEAD:/lisp/progmodes/sh-script.el
+;;
+;; load this with M-x eval-buffer
+;;
+;; TODO: .*
+
+(setq icuDepKeywords
+      '(("group:\\|system_symbols:\\|library:" . font-lock-function-name-face)
+        ("deps" . font-lock-constant-face)
+        ("#.*" . font-lock-comment-face)
+        ("[a-zA-Z0-9_]+\\.o" . font-lock-doc-face)
+    )
+)
+
+(define-derived-mode icu-dependencies-mode fundamental-mode
+  (setq font-lock-defaults '(icuDepKeywords))
+  (setq mode-name "icu dependencies.txt")
+  (setq comment-start "# ")
+)