omniwxs.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # @brief WiX wxs file generator for omniORB
4 # @date $Date$
5 # @author Norkai Ando <n-ando@aist.go.jp>
6 #
7 # Copyright (C) 2010
8 # Noriaki Ando
9 # Intelligent Systems Research Institute,
10 # National Institute of
11 # Advanced Industrial Science and Technology (AIST), Japan
12 # All rights reserved.
13 #
14 # $Id$
15 #
16 
17 omni_files = "COPYING CREDITS THIS_IS_OMNIORB_4_1_4 COPYING.LIB update.log COPYING.PYTHON sample.reg README.FIRST.txt README.win32.txt ReleaseNotes.txt"
18 
19 data = [
20  ("", omni_files),
21  ("bin/scripts", "*.py"),
22  ("bin/x86_win32", "*.dll *.exe"),
23  ("idl", "*.idl"),
24  ("idl/COS", "*.idl"),
25  ("include", "*.h"),
26  ("include/COS", "*.h *.hh"),
27  ("include/omniORB4", "*.h *.hh"),
28  ("include/omniORB4/internal", "*.h *.hh"),
29  ("include/omnithread", "*.h"),
30  ("include/omniVms", "*.hxx"),
31  ("include/python1.5", "*.h"),
32  ("lib/python/omniidl", "*.py"),
33  ("lib/python/omniidl_be", "*.py"),
34  ("lib/python/omniidl_be/cxx", "*.py"),
35  ("lib/python/omniidl_be/cxx/dynskel", "*.py"),
36  ("lib/python/omniidl_be/cxx/header", "*.py"),
37  ("lib/python/omniidl_be/cxx/impl", "*.py"),
38  ("lib/python/omniidl_be/cxx/skel", "*.py"),
39  ("lib/python1.5", "*.py*"),
40  ("lib/x86_win32", "*.lib"),
41  ("src", "GNUmakefile")
42 ]
43 
44 import os
45 base_dir = os.getenv("OMNI_ROOT")
46 base_dir = base_dir.replace("\"", "")
47 
48 if base_dir == None:
49  base_dir="C:\\Program Files\\omniORB-4.1.4\\"
50 else:
51  base_dir += "\\"
52 
53 def path_to_dir_id(path, prefix):
54  # path = "bin/x86_win32" prefix = "omni"
55  # output = "omni_bin_x86_win32"
56  # "." -> "_"
57  output = prefix + "_" + "_".join(path.split("/"))
58  return output.replace(".", "_")
59 
60 
61 def path_to_comp_id(path, prefix):
62  # path = "bin/x86_win32" prefix = "omni"
63  # output = "OmniBinX86_win32"
64  # "." -> "_"
65  output = prefix.capitalize()
66  for c in path.split("/"):
67  output += c.capitalize()
68  return output.replace(".", "_")
69 
70 import makewxs
71 
72 for (path, files) in data:
73  # wxs component name
74  comp_name = path_to_comp_id(path, "omni")
75  # wxs directory name
76  dir_name = path_to_dir_id(path, "omni")
77 
78  path = path.replace("/", "\\")
79 
80  # full path to target directory
81  full_path = base_dir + "\\\\" + path
82 
83  import glob
84  flist = []
85  for f in files.split(" "):
86  flist += glob.glob(full_path + "\\" + f)
87 
88  cmd = ["flist",
89  "-c", comp_name,
90  "-o", dir_name + ".yaml",
91  "-p", base_dir + path]
92  cmd += flist
93 
94  makewxs.main(cmd)
95 
96 
97 cmd = ["wxs",
98  "-o", "omniORB_inc.wxs",
99  "-i", "omniORB_inc.wxs.in"]
100 cmd += glob.glob("*.yaml")
101 makewxs.main(cmd)
def path_to_dir_id(path, prefix)
Definition: omniwxs.py:53
def path_to_comp_id(path, prefix)
Definition: omniwxs.py:61


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:53