omniwxs.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # @brief WiX wxs file generator for omniORB
00004 # @date $Date$
00005 # @author Norkai Ando <n-ando@aist.go.jp>
00006 #
00007 # Copyright (C) 2010
00008 #     Noriaki Ando
00009 #     Intelligent Systems Research Institute,
00010 #     National Institute of
00011 #         Advanced Industrial Science and Technology (AIST), Japan
00012 #     All rights reserved.
00013 #
00014 # $Id$
00015 #
00016 
00017 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"
00018 
00019 data = [
00020     ("",                                 omni_files),
00021     ("bin/scripts",                       "*.py"),
00022     ("bin/x86_win32",                     "*.dll *.exe"),
00023     ("idl",                               "*.idl"),
00024     ("idl/COS",                           "*.idl"),
00025     ("include",                           "*.h"),
00026     ("include/COS",                       "*.h *.hh"),
00027     ("include/omniORB4",                  "*.h *.hh"),
00028     ("include/omniORB4/internal",         "*.h *.hh"),
00029     ("include/omnithread",                "*.h"),
00030     ("include/omniVms",                   "*.hxx"),
00031     ("include/python1.5",                 "*.h"),
00032     ("lib/python/omniidl",                "*.py"),
00033     ("lib/python/omniidl_be",             "*.py"),
00034     ("lib/python/omniidl_be/cxx",         "*.py"),
00035     ("lib/python/omniidl_be/cxx/dynskel", "*.py"),
00036     ("lib/python/omniidl_be/cxx/header",  "*.py"),
00037     ("lib/python/omniidl_be/cxx/impl",    "*.py"),
00038     ("lib/python/omniidl_be/cxx/skel",    "*.py"),
00039     ("lib/python1.5",                     "*.py*"),
00040     ("lib/x86_win32",                     "*.lib"),
00041     ("src",                               "GNUmakefile")
00042 ]
00043 
00044 import os
00045 base_dir = os.getenv("OMNI_ROOT")
00046 base_dir = base_dir.replace("\"", "")
00047 
00048 if base_dir == None:
00049     base_dir="C:\\Program Files\\omniORB-4.1.4\\"
00050 else:
00051     base_dir += "\\"
00052 
00053 def path_to_dir_id(path, prefix):
00054     # path = "bin/x86_win32" prefix = "omni"
00055     # output = "omni_bin_x86_win32"
00056     # "." -> "_"
00057     output = prefix + "_" + "_".join(path.split("/"))
00058     return output.replace(".", "_")
00059 
00060 
00061 def path_to_comp_id(path, prefix):
00062     # path = "bin/x86_win32" prefix = "omni"
00063     # output = "OmniBinX86_win32"
00064     # "." -> "_"
00065     output = prefix.capitalize()
00066     for c in path.split("/"):
00067         output += c.capitalize()
00068     return output.replace(".", "_")
00069 
00070 import makewxs
00071 
00072 for (path, files) in data:
00073     # wxs component name
00074     comp_name = path_to_comp_id(path, "omni")
00075     # wxs directory name
00076     dir_name = path_to_dir_id(path, "omni")
00077 
00078     path = path.replace("/", "\\")
00079 
00080     # full path to target directory
00081     full_path = base_dir + "\\\\" + path
00082 
00083     import glob
00084     flist = []
00085     for f in files.split(" "):
00086         flist += glob.glob(full_path + "\\" + f)
00087 
00088     cmd = ["flist",
00089            "-c", comp_name,
00090            "-o", dir_name + ".yaml",
00091            "-p",  base_dir + path]
00092     cmd += flist
00093 
00094     makewxs.main(cmd)
00095 
00096 
00097 cmd = ["wxs",
00098        "-o", "omniORB_inc.wxs",
00099        "-i", "omniORB_inc.wxs.in"]
00100 cmd += glob.glob("*.yaml")
00101 makewxs.main(cmd)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:38