Bug 1304136 - have AccEventGen.py re-use xpidllex.py / xpidlyacc.py; r?chmanchester draft
authorMike Shal <mshal@mozilla.com>
Mon, 19 Sep 2016 13:42:44 -0400
changeset 415619 36bd3ad0b11d6852232e2607135eca54bbea0d50
parent 415618 7d52bf50e228ed1d52906aaec864bb48a6ec752e
child 415620 302e533db27e037d19de4f73a8d466f5229d8053
push id29918
push userbmo:mshal@mozilla.com
push dateTue, 20 Sep 2016 19:24:34 +0000
reviewerschmanchester
bugs1304136
milestone52.0a1
Bug 1304136 - have AccEventGen.py re-use xpidllex.py / xpidlyacc.py; r?chmanchester MozReview-Commit-ID: 76M0KYAZCmW
accessible/xpcom/AccEventGen.py
accessible/xpcom/moz.build
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -8,17 +8,19 @@ import sys
 import os
 
 import buildconfig
 import mozpack.path as mozpath
 
 # The xpidl parser is not incorporated in the in-tree virtualenv.
 xpidl_dir = mozpath.join(buildconfig.topsrcdir, 'xpcom', 'idl-parser',
                          'xpidl')
-sys.path.append(xpidl_dir)
+xpidl_cachedir = mozpath.join(buildconfig.topobjdir, 'xpcom', 'idl-parser',
+                              'xpidl')
+sys.path.extend([xpidl_dir, xpidl_cachedir])
 import xpidl
 
 # Instantiate the parser.
 p = xpidl.IDLParser()
 
 def findIDL(includePath, interfaceFileName):
     for d in includePath:
         path = mozpath.join(d, interfaceFileName)
@@ -212,15 +214,15 @@ def write_cpp(eventname, iface, fd):
 def get_conf(conf_file):
     conf = Configuration(conf_file)
     inc_dir = [
         mozpath.join(buildconfig.topsrcdir, 'accessible', 'interfaces'),
         mozpath.join(buildconfig.topsrcdir, 'xpcom', 'base'),
     ]
     return conf, inc_dir
 
-def gen_header_file(fd, conf_file):
+def gen_header_file(fd, conf_file, xpidllex, xpidlyacc):
     conf, inc_dir = get_conf(conf_file)
     return print_header_file(fd, conf, inc_dir)
 
-def gen_cpp_file(fd, conf_file):
+def gen_cpp_file(fd, conf_file, xpidllex, xpidlyacc):
     conf, inc_dir = get_conf(conf_file)
     return print_cpp_file(fd, conf, inc_dir)
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -54,20 +54,20 @@ else:
 
 GENERATED_FILES += [
     'xpcAccEvents.cpp',
     'xpcAccEvents.h',
 ]
 
 xpc_acc_events_h = GENERATED_FILES['xpcAccEvents.h']
 xpc_acc_events_h.script = 'AccEventGen.py:gen_header_file'
-xpc_acc_events_h.inputs += ['AccEvents.conf']
+xpc_acc_events_h.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
 
 xpc_acc_events_cpp = GENERATED_FILES['xpcAccEvents.cpp']
 xpc_acc_events_cpp.script = 'AccEventGen.py:gen_cpp_file'
-xpc_acc_events_cpp.inputs += ['AccEvents.conf']
+xpc_acc_events_cpp.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-error=shadow']