From 940d91af38f9492b98fbed3e994b44ca5456e137 Mon Sep 17 00:00:00 2001 From: Ricky Stewart Date: Mon, 7 Oct 2019 15:31:05 +0000 Subject: [PATCH] Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=nalexander This patch doesn't remove all references to GENERATED_FILES, but does remove most of them, leaving only those which can't be trivially translated to the new template. Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e4a25230c3992b9c5519ceb351fb37f6b2bf605e Differential Revision: https://phabricator.services.mozilla.com/D48230 --HG-- extra : moz-landing-system : lando --- accessible/ipc/win/typelib/moz.build | 4 +- accessible/xpcom/moz.build | 12 ++- .../app/winlauncher/freestanding/moz.build | 18 ++-- build/clang-plugin/moz.build | 12 +-- build/moz.build | 27 +++--- build/test_templates.mozbuild | 14 +-- build/unix/elfhack/inject/moz.build | 8 +- config/external/ffi/moz.build | 53 +++++------ config/external/icu/data/moz.build | 8 +- config/moz.build | 14 +-- devtools/shared/webconsole/moz.build | 6 +- dom/base/moz.build | 9 +- dom/bindings/moz.build | 14 +-- dom/encoding/moz.build | 11 +-- gfx/layers/moz.build | 15 +-- gfx/webrender_bindings/moz.build | 18 ++-- intl/locale/moz.build | 5 +- js/src/frontend/moz.build | 6 +- js/src/gc/moz.build | 9 +- js/src/moz.build | 42 ++++----- js/src/shell/moz.build | 16 ++-- layout/generic/moz.build | 13 ++- layout/style/moz.build | 93 +++++++------------ mobile/android/base/moz.build | 1 - netwerk/dns/moz.build | 8 +- security/apps/moz.build | 6 +- security/manager/ssl/moz.build | 9 +- toolkit/components/featuregates/moz.build | 11 +-- toolkit/components/telemetry/moz.build | 84 +++++++---------- toolkit/crashreporter/moz.build | 15 +-- toolkit/library/build/moz.build | 9 +- toolkit/library/moz.build | 15 ++- toolkit/locales/moz.build | 6 +- widget/android/moz.build | 11 +-- xpcom/base/moz.build | 26 ++---- xpcom/build/moz.build | 12 +-- xpcom/components/moz.build | 12 +-- xpcom/ds/moz.build | 12 +-- xpcom/idl-parser/xpidl/moz.build | 7 +- xpcom/reflect/xptcall/md/win32/moz.build | 6 +- 40 files changed, 255 insertions(+), 422 deletions(-) diff --git a/accessible/ipc/win/typelib/moz.build b/accessible/ipc/win/typelib/moz.build index 3bc45a136dbd..da73ad78f7c8 100644 --- a/accessible/ipc/win/typelib/moz.build +++ b/accessible/ipc/win/typelib/moz.build @@ -8,6 +8,4 @@ FINAL_TARGET_FILES += [ '!Accessible.tlb', ] -GENERATED_FILES += [ - 'Accessible.tlb', -] +GeneratedFile('Accessible.tlb') diff --git a/accessible/xpcom/moz.build b/accessible/xpcom/moz.build index 02f90c0593af..ac9043419ad6 100644 --- a/accessible/xpcom/moz.build +++ b/accessible/xpcom/moz.build @@ -56,11 +56,15 @@ else: '/accessible/other', ] -GENERATED_FILES += [('xpcAccEvents.h', 'xpcAccEvents.cpp')] -xpc_acc = GENERATED_FILES[('xpcAccEvents.h', 'xpcAccEvents.cpp')] -xpc_acc.script = 'AccEventGen.py:gen_files' -xpc_acc.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py'] +GeneratedFile( + 'xpcAccEvents.h', 'xpcAccEvents.cpp', + script='AccEventGen.py', entry_point='gen_files', + inputs=[ + 'AccEvents.conf', + '!/xpcom/idl-parser/xpidl/xpidllex.py', + '!/xpcom/idl-parser/xpidl/xpidlyacc.py', + ]) FINAL_LIBRARY = 'xul' diff --git a/browser/app/winlauncher/freestanding/moz.build b/browser/app/winlauncher/freestanding/moz.build index 7182ccc16066..0daf54889a01 100644 --- a/browser/app/winlauncher/freestanding/moz.build +++ b/browser/app/winlauncher/freestanding/moz.build @@ -42,18 +42,12 @@ OS_LIBS += [ ] if CONFIG['COMPILE_ENVIRONMENT']: - ntdll_freestanding_lib = '%sntdll_freestanding.%s' % (CONFIG['LIB_PREFIX'], - CONFIG['LIB_SUFFIX']) - - GENERATED_FILES += [ - ntdll_freestanding_lib, - ] - - ntdll_freestanding_gen = GENERATED_FILES[ntdll_freestanding_lib] - ntdll_freestanding_gen.script = 'gen_ntdll_freestanding_lib.py' - ntdll_freestanding_gen.inputs = ['ntdll_freestanding.def'] - ntdll_freestanding_gen.flags = [CONFIG['LLVM_DLLTOOL']] + \ - CONFIG['LLVM_DLLTOOL_FLAGS'] + GeneratedFile( + '%sntdll_freestanding.%s' % (CONFIG['LIB_PREFIX'], + CONFIG['LIB_SUFFIX']), + script='gen_ntdll_freestanding_lib.py', + inputs=['ntdll_freestanding.def'], + flags=[CONFIG['LLVM_DLLTOOL']] + CONFIG['LLVM_DLLTOOL_FLAGS']) DisableStlWrapping() diff --git a/build/clang-plugin/moz.build b/build/clang-plugin/moz.build index 4475fdc6498c..71ed2b6a80b0 100644 --- a/build/clang-plugin/moz.build +++ b/build/clang-plugin/moz.build @@ -57,13 +57,11 @@ if CONFIG['ENABLE_MOZSEARCH_PLUGIN']: 'mozsearch-plugin/StringOperations.cpp', ] -GENERATED_FILES += ['ThirdPartyPaths.cpp'] -third_party_paths = GENERATED_FILES['ThirdPartyPaths.cpp'] -third_party_paths.script = "ThirdPartyPaths.py:generate" -third_party_paths.inputs = [ - '/tools/rewriting/ThirdPartyPaths.txt', - '/tools/rewriting/Generated.txt', -] +GeneratedFile('ThirdPartyPaths.cpp', script="ThirdPartyPaths.py", + entry_point="generate", inputs=[ + '/tools/rewriting/ThirdPartyPaths.txt', + '/tools/rewriting/Generated.txt', + ]) HOST_COMPILE_FLAGS['STL'] = [] HOST_COMPILE_FLAGS['VISIBILITY'] = [] diff --git a/build/moz.build b/build/moz.build index 20885ef88f4e..b3580e9ad1ba 100644 --- a/build/moz.build +++ b/build/moz.build @@ -78,27 +78,24 @@ if CONFIG['MOZ_APP_BASENAME']: if CONFIG[var]: appini_defines[var] = True - GENERATED_FILES += ['application.ini'] - - appini = GENERATED_FILES['application.ini'] - appini.script = '../python/mozbuild/mozbuild/action/preprocessor.py:generate' - appini.inputs = ['application.ini.in'] - appini.flags = ['-D%s=%s' % (k, '1' if v is True else v) - for k, v in appini_defines.iteritems()] + GeneratedFile( + 'application.ini', + script='../python/mozbuild/mozbuild/action/preprocessor.py', + entry_point='generate', + inputs=['application.ini.in'], + flags=['-D%s=%s' % (k, '1' if v is True else v) + for k, v in appini_defines.iteritems()]) + FINAL_TARGET_FILES += ['!application.ini'] if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']: FINAL_TARGET_PP_FILES += ['update-settings.ini'] - GENERATED_FILES += ['application.ini.h'] - appini = GENERATED_FILES['application.ini.h'] - appini.script = 'appini_header.py' - appini.inputs = ['!application.ini'] + GeneratedFile('application.ini.h', script='appini_header.py', + inputs=['!application.ini']) if CONFIG['ENABLE_TESTS']: - GENERATED_FILES += ['automation.py'] - auto = GENERATED_FILES['automation.py'] - auto.script = 'gen_automation.py' - auto.inputs = ['automation.py.in'] + GeneratedFile('automation.py', script='gen_automation.py', + inputs=['automation.py.in']) TEST_HARNESS_FILES.reftest += [ '!automation.py', diff --git a/build/test_templates.mozbuild b/build/test_templates.mozbuild index 31b3b37c1df5..0f2c5d9cfa64 100644 --- a/build/test_templates.mozbuild +++ b/build/test_templates.mozbuild @@ -8,11 +8,8 @@ def GeneratedTestCertificate(name): if not CONFIG['COMPILE_ENVIRONMENT']: return - - GENERATED_FILES += [name] - props = GENERATED_FILES[name] - props.script = '/security/manager/ssl/tests/unit/pycert.py' - props.inputs = ['%s.certspec' % name] + GeneratedFile(name, script='/security/manager/ssl/tests/unit/pycert.py', + inputs=['%s.certspec' % name]) # Turn RELATIVEDIR into list entry: like # 'security/manager/ssl/tests/unit/bad_certs' -> # TEST_HARNESS_FILES.xpcshell.security.manager.ssl.tests.unit.bad_certs. @@ -25,11 +22,8 @@ def GeneratedTestCertificate(name): def GeneratedTestKey(name): if not CONFIG['COMPILE_ENVIRONMENT']: return - - GENERATED_FILES += [name] - props = GENERATED_FILES[name] - props.script = '/security/manager/ssl/tests/unit/pykey.py' - props.inputs = ['%s.keyspec' % name] + GeneratedFile(name, script='/security/manager/ssl/tests/unit/pykey.py', + inputs=['%s.keyspec' % name]) # Turn RELATIVEDIR into list entry: like # 'security/manager/ssl/tests/unit/bad_certs' -> # TEST_HARNESS_FILES.xpcshell.security.manager.ssl.tests.unit.bad_certs. diff --git a/build/unix/elfhack/inject/moz.build b/build/unix/elfhack/inject/moz.build index 40da87352dfd..516104c06aaa 100644 --- a/build/unix/elfhack/inject/moz.build +++ b/build/unix/elfhack/inject/moz.build @@ -13,12 +13,8 @@ DIST_INSTALL = False cpu = CONFIG['CPU_ARCH'] gen_src = '%s.c' % cpu -GENERATED_FILES += [ - gen_src, -] - -GENERATED_FILES[gen_src].script = 'copy_source.py:copy' -GENERATED_FILES[gen_src].inputs = ['../inject.c'] +GeneratedFile(gen_src, script='copy_source.py', entry_point='copy', + inputs = ['../inject.c']) SOURCES += [ '!%s' % gen_src, diff --git a/config/external/ffi/moz.build b/config/external/ffi/moz.build index 0c98a8639e74..f9151877072f 100644 --- a/config/external/ffi/moz.build +++ b/config/external/ffi/moz.build @@ -15,12 +15,9 @@ else: CONFIGURE_DEFINE_FILES += [ '../../../js/src/ctypes/libffi/fficonfig.h', ] - GENERATED_FILES += [ - '../../../js/src/ctypes/libffi/include/ffi.h', - ] - ffi_h = GENERATED_FILES['../../../js/src/ctypes/libffi/include/ffi.h'] - ffi_h.script = 'subst_header.py' - ffi_h.inputs = ['../../../js/src/ctypes/libffi/include/ffi.h.in'] + GeneratedFile('../../../js/src/ctypes/libffi/include/ffi.h', + script='subst_header.py', + inputs=['../../../js/src/ctypes/libffi/include/ffi.h.in']) LOCAL_INCLUDES += [ '!/js/src/ctypes/libffi', @@ -80,15 +77,15 @@ else: elif CONFIG['FFI_TARGET'] == 'ARM64_WIN64': ffi_srcs = ['ffi.c'] - GENERATED_FILES += ['win64_aarch.asm'] - asm = GENERATED_FILES['win64_aarch.asm'] - asm.inputs = [ - '/js/src/ctypes/libffi/src/aarch64/win64.asm', - '!../../../js/src/ctypes/libffi/fficonfig.h', - '!../../../js/src/ctypes/libffi/include/ffi.h', - ] - asm.script = 'preprocess_libffi_asm.py' - asm.flags = ['$(DEFINES)', '$(LOCAL_INCLUDES)'] + GeneratedFile( + 'win64_aarch.asm', + inputs=[ + '/js/src/ctypes/libffi/src/aarch64/win64.asm', + '!../../../js/src/ctypes/libffi/fficonfig.h', + '!../../../js/src/ctypes/libffi/include/ffi.h', + ], + script='preprocess_libffi_asm.py', + flags=['$(DEFINES)', '$(LOCAL_INCLUDES)']) SOURCES += ['!win64_aarch.asm'] elif CONFIG['FFI_TARGET'] == 'X86': ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S') @@ -102,15 +99,12 @@ else: ffi_srcs += ['win32.S'] else: # libffi asm needs to be preprocessed for MSVC - GENERATED_FILES += ['win32.asm'] - asm = GENERATED_FILES['win32.asm'] - asm.inputs = [ + GeneratedFile('win32.asm', inputs=[ '/js/src/ctypes/libffi/src/x86/win32.S', '!../../../js/src/ctypes/libffi/fficonfig.h', '!../../../js/src/ctypes/libffi/include/ffi.h', - ] - asm.script = 'preprocess_libffi_asm.py' - asm.flags = ['$(DEFINES)', '$(LOCAL_INCLUDES)'] + ], script='preprocess_libffi_asm.py', + flags=['$(DEFINES)', '$(LOCAL_INCLUDES)']) SOURCES += ['!win32.asm'] ASFLAGS += ['-safeseh'] elif CONFIG['FFI_TARGET'] == 'X86_WIN64': @@ -119,15 +113,14 @@ else: ffi_srcs += ['win64.S'] else: # libffi asm needs to be preprocessed for MSVC - GENERATED_FILES += ['win64.asm'] - asm = GENERATED_FILES['win64.asm'] - asm.inputs = [ - '/js/src/ctypes/libffi/src/x86/win64.S', - '!../../../js/src/ctypes/libffi/fficonfig.h', - '!../../../js/src/ctypes/libffi/include/ffi.h', - ] - asm.script = 'preprocess_libffi_asm.py' - asm.flags = ['$(DEFINES)', '$(LOCAL_INCLUDES)'] + GeneratedFile( + 'win64.asm', + inputs=[ + '/js/src/ctypes/libffi/src/x86/win64.S', + '!../../../js/src/ctypes/libffi/fficonfig.h', + '!../../../js/src/ctypes/libffi/include/ffi.h', + ], script='preprocess_libffi_asm.py', + flags=['$(DEFINES)', '$(LOCAL_INCLUDES)']) SOURCES += ['!win64.asm'] elif CONFIG['FFI_TARGET'] == 'X86_DARWIN': DEFINES['FFI_MMAP_EXEC_WRIT'] = True diff --git a/config/external/icu/data/moz.build b/config/external/icu/data/moz.build index 37d961d6d364..0a90e7b4fc68 100644 --- a/config/external/icu/data/moz.build +++ b/config/external/icu/data/moz.build @@ -23,13 +23,9 @@ asflags = [ LOCAL_INCLUDES += ['.'] if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64': - icudata = 'icudata.asm' - GENERATED_FILES += [icudata] + GeneratedFile('icudata.asm', script='genicudata.py', + inputs=[CONFIG['ICU_DATA_FILE']], flags=[data_symbol]) SOURCES += ['!%s' % icudata] - icudata = GENERATED_FILES[icudata] - icudata.script = 'genicudata.py' - icudata.inputs = [CONFIG['ICU_DATA_FILE']] - icudata.flags = [data_symbol] elif CONFIG['HAVE_YASM']: USE_YASM = True SOURCES += ['icudata.s'] diff --git a/config/moz.build b/config/moz.build index 44aac05c4f37..13e616234dcf 100644 --- a/config/moz.build +++ b/config/moz.build @@ -68,13 +68,13 @@ if CONFIG['WRAP_STL_INCLUDES']: # which won't need this wrapper, such as L10N. Just don't try to generate the # wrapper in that case. if CONFIG['OS_ARCH'] == 'WINNT': - GENERATED_FILES += ['../dist/stl_wrappers/windows.h'] - windows_h = GENERATED_FILES['../dist/stl_wrappers/windows.h'] - windows_h.script = 'make-windows-h-wrapper.py:generate' - windows_h.inputs = ['windows-h-constant.decls.h', - 'windows-h-unicode.decls.h', - 'windows-h-wrapper.template.h'] - windows_h.flags = [stl_compiler] + GeneratedFile('../dist/stl_wrappers/windows.h', + script='make-windows-h-wrapper.py', + entry_point='generate', + inputs = ['windows-h-constant.decls.h', + 'windows-h-unicode.decls.h', + 'windows-h-wrapper.template.h'], + flags=[stl_compiler]) if CONFIG['WRAP_SYSTEM_INCLUDES']: include('system-headers.mozbuild') diff --git a/devtools/shared/webconsole/moz.build b/devtools/shared/webconsole/moz.build index feed0d23fbde..fb267e305dc3 100644 --- a/devtools/shared/webconsole/moz.build +++ b/devtools/shared/webconsole/moz.build @@ -19,10 +19,8 @@ for dir in RELATIVEDIR.split('/'): base = base[dir] base += ["!reserved-js-words.js"] -GENERATED_FILES += ['reserved-js-words.js'] -ReservedWordsGenerated = GENERATED_FILES['reserved-js-words.js'] -ReservedWordsGenerated.script = 'GenerateReservedWordsJS.py' -ReservedWordsGenerated.inputs = ['/js/src/frontend/ReservedWords.h'] +GeneratedFile('reserved-js-words.js', script='GenerateReservedWordsJS.py', + inputs = ['/js/src/frontend/ReservedWords.h']) DevToolsModules( 'js-property-provider.js', diff --git a/dom/base/moz.build b/dom/base/moz.build index a84ea84ce5a8..7ff6bd86f94c 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -541,13 +541,8 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: if CONFIG['MOZ_X11']: CXXFLAGS += CONFIG['TK_CFLAGS'] -GENERATED_FILES += [ - 'UseCounterList.h', -] - -counterlist = GENERATED_FILES['UseCounterList.h'] -counterlist.script = 'gen-usecounters.py:use_counter_list' -counterlist.inputs = ['UseCounters.conf'] +GeneratedFile('UseCounterList.h', script='gen-usecounters.py', + entry_point='use_counter_list', inputs=['UseCounters.conf']) if CONFIG['CC_TYPE'] in ('clang', 'gcc'): CXXFLAGS += ['-Wno-error=shadow'] diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build index 54735a062f06..581182c03c69 100644 --- a/dom/bindings/moz.build +++ b/dom/bindings/moz.build @@ -175,10 +175,10 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'): ] if CONFIG['COMPILE_ENVIRONMENT']: - GENERATED_FILES += ['CSS2Properties.webidl'] - css_props = GENERATED_FILES['CSS2Properties.webidl'] - css_props.script = 'GenerateCSS2PropertiesWebIDL.py:generate' - css_props.inputs = [ - '/dom/webidl/CSS2Properties.webidl.in', - '!/layout/style/ServoCSSPropList.py', - ] + GeneratedFile('CSS2Properties.webidl', + script='GenerateCSS2PropertiesWebIDL.py', + entry_point='generate', + inputs=[ + '/dom/webidl/CSS2Properties.webidl.in', + '!/layout/style/ServoCSSPropList.py', + ]) diff --git a/dom/encoding/moz.build b/dom/encoding/moz.build index 63be7903e736..40779816b562 100644 --- a/dom/encoding/moz.build +++ b/dom/encoding/moz.build @@ -34,17 +34,12 @@ prefixes = ( for prefix in prefixes: input_file = prefix + '.properties' header = prefix + '.properties.h' - GENERATED_FILES += [header] - props = GENERATED_FILES[header] - props.script = props2arrays - props.inputs = [input_file] + GeneratedFile(header, script=props2arrays, inputs=[input_file]) input_file = 'nonparticipatingdomains.properties' header = input_file + '.h' -GENERATED_FILES += [header] -props = GENERATED_FILES[header] -props.script = '../../intl/locale/props2arrays.py' -props.inputs = [input_file] +GeneratedFile(header, script='../../intl/locale/props2arrays.py', + inputs=[input_file]) MOCHITEST_MANIFESTS += [ 'test/mochitest.ini', diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 33f0c4c75ed7..de7c79f92946 100755 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -580,17 +580,10 @@ IPDL_SOURCES += [ include('/ipc/chromium/chromium-config.mozbuild') if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': - GENERATED_FILES = [ - 'CompositorD3D11Shaders.h', - 'MLGShaders.h', - ] - - d3d11_shaders = GENERATED_FILES['CompositorD3D11Shaders.h'] - d3d11_shaders.script = 'd3d11/genshaders.py' - d3d11_shaders.inputs = ['d3d11/shaders.manifest'] - mlg_shaders = GENERATED_FILES['MLGShaders.h'] - mlg_shaders.script = 'd3d11/genshaders.py' - mlg_shaders.inputs = ['d3d11/mlgshaders/shaders.manifest'] + GeneratedFile('CompositorD3D11Shaders.h', script='d3d11/genshaders.py', + inputs=['d3d11/shaders.manifest']) + GeneratedFile('MLGShaders.h', script='d3d11/genshaders.py', + inputs=['d3d11/mlgshaders/shaders.manifest']) LOCAL_INCLUDES += [ '/docshell/base', # for nsDocShell.h diff --git a/gfx/webrender_bindings/moz.build b/gfx/webrender_bindings/moz.build index 64d22b7eaa8f..c275555e3f52 100644 --- a/gfx/webrender_bindings/moz.build +++ b/gfx/webrender_bindings/moz.build @@ -85,21 +85,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'): CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] if CONFIG['COMPILE_ENVIRONMENT']: - GENERATED_FILES += [ - 'webrender_ffi_generated.h', - ] - EXPORTS.mozilla.webrender += [ '!webrender_ffi_generated.h', ] - ffi_generated = GENERATED_FILES['webrender_ffi_generated.h'] - ffi_generated.script = '/layout/style/RunCbindgen.py:generate' - ffi_generated.inputs = [ - '/gfx/webrender_bindings', - '/gfx/wr/webrender', - '/gfx/wr/webrender_api', - ] + GeneratedFile('webrender_ffi_generated.h', + script='/layout/style/RunCbindgen.py', entry_point='generate', + inputs=[ + '/gfx/webrender_bindings', + '/gfx/wr/webrender', + '/gfx/wr/webrender_api', + ]) include('/ipc/chromium/chromium-config.mozbuild') diff --git a/intl/locale/moz.build b/intl/locale/moz.build index a0c883e6380d..ba96374afbd0 100644 --- a/intl/locale/moz.build +++ b/intl/locale/moz.build @@ -76,10 +76,7 @@ prefixes = ( for prefix in prefixes: input_file = prefix + '.properties' header = prefix + '.properties.h' - GENERATED_FILES += [header] - props = GENERATED_FILES[header] - props.script = 'props2arrays.py' - props.inputs = [input_file] + GeneratedFile(header, script='props2arrays.py', inputs=[input_file]) if CONFIG['ENABLE_TESTS']: DIRS += ['tests/gtest'] diff --git a/js/src/frontend/moz.build b/js/src/frontend/moz.build index e43142e8bebd..e5e8f47f0f06 100644 --- a/js/src/frontend/moz.build +++ b/js/src/frontend/moz.build @@ -17,10 +17,8 @@ include('../js-cxxflags.mozbuild') # Generate frontend/ReservedWordsGenerated.h from frontend/ReservedWords.h -GENERATED_FILES += ['ReservedWordsGenerated.h'] -ReservedWordsGenerated = GENERATED_FILES['ReservedWordsGenerated.h'] -ReservedWordsGenerated.script = 'GenerateReservedWords.py' -ReservedWordsGenerated.inputs += ['ReservedWords.h'] +GeneratedFile('ReservedWordsGenerated.h', script='GenerateReservedWords.py', + inputs=['ReservedWords.h']) UNIFIED_SOURCES += [ diff --git a/js/src/gc/moz.build b/js/src/gc/moz.build index 91f448d2d8d7..d75afcbf47dd 100644 --- a/js/src/gc/moz.build +++ b/js/src/gc/moz.build @@ -17,11 +17,10 @@ include('../js-cxxflags.mozbuild') # Generate GC statistics phase data. -GENERATED_FILES += ['StatsPhasesGenerated.h', 'StatsPhasesGenerated.inc'] -StatsPhasesGeneratedHeader = GENERATED_FILES['StatsPhasesGenerated.h'] -StatsPhasesGeneratedHeader.script = 'GenerateStatsPhases.py:generateHeader' -StatsPhasesGeneratedCpp = GENERATED_FILES['StatsPhasesGenerated.inc'] -StatsPhasesGeneratedCpp.script = 'GenerateStatsPhases.py:generateCpp' +GeneratedFile('StatsPhasesGenerated.h', + script='GenerateStatsPhases.py', entry_point='generateHeader') +GeneratedFile('StatsPhasesGenerated.inc', + script='GenerateStatsPhases.py', entry_point='generateCpp') UNIFIED_SOURCES += [ 'Allocator.cpp', diff --git a/js/src/moz.build b/js/src/moz.build index 851455f72015..06b86fd10726 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -105,8 +105,7 @@ CONFIGURE_DEFINE_FILES += [ ] if CONFIG['HAVE_DTRACE']: - GENERATED_FILES += ['javascript-trace.h'] - + GeneratedFile('javascript-trace.h') EXPORTS += ['!javascript-trace.h'] # Changes to internal header files, used externally, massively slow down @@ -442,11 +441,7 @@ DIRS += [ FINAL_LIBRARY = 'js' -# Prepare self-hosted JS code for embedding -GENERATED_FILES += [('selfhosted.out.h', 'selfhosted.js')] -selfhosted = GENERATED_FILES[('selfhosted.out.h', 'selfhosted.js')] -selfhosted.script = 'builtin/embedjs.py:generate_selfhosted' -selfhosted.inputs = [ +selfhosted_inputs = [ 'js.msg', 'builtin/TypedObjectConstants.h', 'builtin/SelfHostingDefines.h', @@ -477,22 +472,25 @@ selfhosted.inputs = [ 'builtin/TypedObject.js', 'builtin/WeakMap.js', 'builtin/WeakSet.js' -] +] + ([ + 'builtin/intl/Collator.js', + 'builtin/intl/CommonFunctions.js', + 'builtin/intl/CurrencyDataGenerated.js', + 'builtin/intl/DateTimeFormat.js', + 'builtin/intl/IntlObject.js', + 'builtin/intl/LangTagMappingsGenerated.js', + 'builtin/intl/Locale.js', + 'builtin/intl/NumberFormat.js', + 'builtin/intl/PluralRules.js', + 'builtin/intl/RelativeTimeFormat.js', + 'builtin/intl/UnicodeExtensionsGenerated.js', +] if CONFIG['ENABLE_INTL_API'] else []) -if CONFIG['ENABLE_INTL_API']: - selfhosted.inputs += [ - 'builtin/intl/Collator.js', - 'builtin/intl/CommonFunctions.js', - 'builtin/intl/CurrencyDataGenerated.js', - 'builtin/intl/DateTimeFormat.js', - 'builtin/intl/IntlObject.js', - 'builtin/intl/LangTagMappingsGenerated.js', - 'builtin/intl/Locale.js', - 'builtin/intl/NumberFormat.js', - 'builtin/intl/PluralRules.js', - 'builtin/intl/RelativeTimeFormat.js', - 'builtin/intl/UnicodeExtensionsGenerated.js', - ] +# Prepare self-hosted JS code for embedding +GeneratedFile('selfhosted.out.h', 'selfhosted.js', + script='builtin/embedjs.py', + entry_point='generate_selfhosted', + inputs=selfhosted_inputs) if CONFIG['JS_HAS_CTYPES']: if CONFIG['MOZ_SYSTEM_FFI']: diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build index 06f55d0de119..be6cea093c8b 100644 --- a/js/src/shell/moz.build +++ b/js/src/shell/moz.build @@ -38,14 +38,14 @@ LOCAL_INCLUDES += [ OS_LIBS += CONFIG['EDITLINE_LIBS'] # Prepare module loader JS code for embedding -GENERATED_FILES += [('shellmoduleloader.out.h', 'shellmoduleloader.js')] -shellmoduleloader = GENERATED_FILES[('shellmoduleloader.out.h', 'shellmoduleloader.js')] -shellmoduleloader.script = '../builtin/embedjs.py:generate_shellmoduleloader' -shellmoduleloader.inputs = [ - '../js.msg', - 'ModuleLoader.js', -] - +GeneratedFile('shellmoduleloader.out.h', 'shellmoduleloader.js', + script='../builtin/embedjs.py', + entry_point='generate_shellmoduleloader', + inputs=[ + '../js.msg', + 'ModuleLoader.js', + ]) + # Place a GDB Python auto-load file next to the shell executable, both in # the build directory and in the dist/bin directory. DEFINES['topsrcdir'] = '%s/js/src' % TOPSRCDIR diff --git a/layout/generic/moz.build b/layout/generic/moz.build index 51588fa451b3..a473feb89695 100644 --- a/layout/generic/moz.build +++ b/layout/generic/moz.build @@ -225,13 +225,12 @@ SOURCES += [ 'nsPluginFrame.cpp', ] -GENERATED_FILES += [ - 'FrameIdList.h', - 'FrameTypeList.h', -] - -GENERATED_FILES['FrameIdList.h'].script = 'GenerateFrameLists.py:generate_frame_id_list_h' -GENERATED_FILES['FrameTypeList.h'].script = 'GenerateFrameLists.py:generate_frame_type_list_h' +GeneratedFile('FrameIdList.h', + script='GenerateFrameLists.py', + entry_point='generate_frame_id_list_h') +GeneratedFile('FrameTypeList.h', + script='GenerateFrameLists.py', + entry_point='generate_frame_type_list_h') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/layout/style/moz.build b/layout/style/moz.build index eb4b8fd57b3c..9c84580fda5b 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -259,76 +259,47 @@ CONTENT_ACCESSIBLE_FILES += [ 'TopLevelVideoDocument.css', ] -GENERATED_FILES += [ - 'nsCSSPropertyID.h', - 'ServoCSSPropList.h', - 'ServoCSSPropList.py', -] -prop_id = GENERATED_FILES['nsCSSPropertyID.h'] -prop_id.script = 'GenerateCSSPropertyID.py:generate' -prop_id.inputs = [ - 'nsCSSPropertyID.h.in', - '!ServoCSSPropList.py', -] - -servo_props = GENERATED_FILES['ServoCSSPropList.h'] -servo_props.script = 'GenerateServoCSSPropList.py:generate_header' -servo_props.inputs = [ - '!ServoCSSPropList.py', -] - -servo_props = GENERATED_FILES['ServoCSSPropList.py'] -servo_props.script = 'GenerateServoCSSPropList.py:generate_data' -servo_props.inputs = [ - 'ServoCSSPropList.mako.py', -] +GeneratedFile('nsCSSPropertyID.h', script='GenerateCSSPropertyID.py', + entry_point='generate', + inputs=['nsCSSPropertyID.h.in', '!ServoCSSPropList.py']) +GeneratedFile('ServoCSSPropList.h', + script='GenerateServoCSSPropList.py', + entry_point='generate_header', + inputs=['!ServoCSSPropList.py']) +GeneratedFile('ServoCSSPropList.py', + script='GenerateServoCSSPropList.py', entry_point='generate_data', + inputs=['ServoCSSPropList.mako.py']) if CONFIG['COMPILE_ENVIRONMENT']: - GENERATED_FILES += [ - 'CompositorAnimatableProperties.h', - 'CountedUnknownProperties.h', - 'nsComputedDOMStyleGenerated.inc', - 'nsCSSPropsGenerated.inc', - 'ServoStyleConsts.h', - ] - EXPORTS.mozilla += [ '!CompositorAnimatableProperties.h', '!CountedUnknownProperties.h', '!ServoStyleConsts.h', ] - compositor = GENERATED_FILES['CompositorAnimatableProperties.h'] - compositor.script = 'GenerateCompositorAnimatableProperties.py:generate' - compositor.inputs = [ - '!ServoCSSPropList.py', - ] - - counted_unknown = GENERATED_FILES['CountedUnknownProperties.h'] - counted_unknown.script = 'GenerateCountedUnknownProperties.py:generate' - counted_unknown.inputs = [ - '/servo/components/style/properties/counted_unknown_properties.py', - ] - - computed = GENERATED_FILES['nsComputedDOMStyleGenerated.inc'] - computed.script = 'GenerateComputedDOMStyleGenerated.py:generate' - computed.inputs = [ - '!ServoCSSPropList.py', - ] - - css_props = GENERATED_FILES['nsCSSPropsGenerated.inc'] - css_props.script = 'GenerateCSSPropsGenerated.py:generate' - css_props.inputs = [ - '!ServoCSSPropList.py', - ] - - consts = GENERATED_FILES['ServoStyleConsts.h'] - consts.script = 'RunCbindgen.py:generate' - consts.inputs = [ - '/servo/ports/geckolib', - '/servo/components/style', - ] + GeneratedFile('CompositorAnimatableProperties.h', + script='GenerateCompositorAnimatableProperties.py', + entry_point='generate', + inputs=['!ServoCSSPropList.py']) + GeneratedFile( + 'CountedUnknownProperties.h', + script='GenerateCountedUnknownProperties.py', + entry_point='generate', + inputs=[ + '/servo/components/style/properties/counted_unknown_properties.py', + ]) + GeneratedFile('nsComputedDOMStyleGenerated.inc', + script='GenerateComputedDOMStyleGenerated.py', + entry_point='generate', + inputs=['!ServoCSSPropList.py']) + GeneratedFile('nsCSSPropsGenerated.inc', + script='GenerateCSSPropsGenerated.py', + entry_point='generate', + inputs=['!ServoCSSPropList.py']) + GeneratedFile('ServoStyleConsts.h', script='RunCbindgen.py', + entry_point='generate', + inputs = ['/servo/ports/geckolib', '/servo/components/style']) CONFIGURE_SUBST_FILES += [ 'bindgen.toml', diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index a087d149f7d8..7eda59ea532f 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -11,7 +11,6 @@ with Files('locales/**'): BUG_COMPONENT = ('Firefox for Android', 'General') DEFINES['ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME'] - # The recursive make backend treats the first output specially: it's passed as # an open FileAvoidWrite to the invoked script. That doesn't work well with # the Gradle task that generates all of the outputs, so we add a dummy first diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build index 9a2b1247cb57..d11d9214bcd1 100644 --- a/netwerk/dns/moz.build +++ b/netwerk/dns/moz.build @@ -74,12 +74,8 @@ include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' -GENERATED_FILES = [ - 'etld_data.inc', -] -etld_data = GENERATED_FILES['etld_data.inc'] -etld_data.script = 'prepare_tlds.py' -etld_data.inputs = ['effective_tld_names.dat'] +GeneratedFile('etld_data.inc', script='prepare_tlds.py', + inputs=['effective_tld_names.dat']) # need to include etld_data.inc LOCAL_INCLUDES += [ diff --git a/security/apps/moz.build b/security/apps/moz.build index 8946c7546a7a..8b4788b03acc 100644 --- a/security/apps/moz.build +++ b/security/apps/moz.build @@ -46,7 +46,5 @@ headers_arrays_certs = [ ] for header, array_name, cert in headers_arrays_certs: - GENERATED_FILES += [header] - h = GENERATED_FILES[header] - h.script = 'gen_cert_header.py:' + array_name - h.inputs = [cert] + GeneratedFile(header, script='gen_cert_header.py', + entry_point=array_name, inputs=[cert]) diff --git a/security/manager/ssl/moz.build b/security/manager/ssl/moz.build index b163107c7c39..0c3394ed39f1 100644 --- a/security/manager/ssl/moz.build +++ b/security/manager/ssl/moz.build @@ -219,12 +219,9 @@ LOCAL_INCLUDES += [ '!/dist/public/nss', ] -GENERATED_FILES = [ - 'nsSTSPreloadList.h', -] -dafsa_data = GENERATED_FILES['nsSTSPreloadList.h'] -dafsa_data.script = '../../../xpcom/ds/tools/make_dafsa.py' -dafsa_data.inputs = ['nsSTSPreloadList.inc'] +GeneratedFile('nsSTSPreloadList.h', + script='../../../xpcom/ds/tools/make_dafsa.py', + inputs=['nsSTSPreloadList.inc']) if CONFIG['NSS_DISABLE_DBM']: DEFINES['NSS_DISABLE_DBM'] = '1' diff --git a/toolkit/components/featuregates/moz.build b/toolkit/components/featuregates/moz.build index d5d8999a99e8..aedbbfa57279 100644 --- a/toolkit/components/featuregates/moz.build +++ b/toolkit/components/featuregates/moz.build @@ -14,12 +14,5 @@ PYTHON_UNITTEST_MANIFESTS += ['test/python/python.ini'] JAR_MANIFESTS += ['jar.mn'] -GENERATED_FILES = [ - 'feature_definitions.json', -] - -feature_files = ['Features.toml'] - -feature_defs = GENERATED_FILES['feature_definitions.json'] -feature_defs.script = 'gen_feature_definitions.py' -feature_defs.inputs = feature_files +GeneratedFile('feature_definitions.json', script='gen_feature_definitions.py', + inputs=['Features.toml']) diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build index bee574687119..449c52e58994 100644 --- a/toolkit/components/telemetry/moz.build +++ b/toolkit/components/telemetry/moz.build @@ -138,20 +138,6 @@ PYTHON_UNITTEST_MANIFESTS += [ 'tests/python/python.ini', ] -GENERATED_FILES = [ - 'EventArtifactDefinitions.json', - 'ScalarArtifactDefinitions.json', - 'TelemetryEventData.h', - 'TelemetryEventEnums.h', - 'TelemetryHistogramData.inc', - 'TelemetryHistogramEnums.h', - 'TelemetryHistogramNameMap.h', - 'TelemetryProcessData.h', - 'TelemetryProcessEnums.h', - 'TelemetryScalarData.h', - 'TelemetryScalarEnums.h', -] - # Generate histogram files. histogram_files = [ 'Histograms.json', @@ -163,17 +149,15 @@ histogram_files = [ if CONFIG['MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES']: histogram_files.extend(CONFIG['MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES']) -data = GENERATED_FILES['TelemetryHistogramData.inc'] -data.script = 'build_scripts/gen_histogram_data.py' -data.inputs = histogram_files - -enums = GENERATED_FILES['TelemetryHistogramEnums.h'] -enums.script = 'build_scripts/gen_histogram_enum.py' -enums.inputs = histogram_files - -data = GENERATED_FILES['TelemetryHistogramNameMap.h'] -data.script = 'build_scripts/gen_histogram_phf.py' -data.inputs = histogram_files +GeneratedFile('TelemetryHistogramData.inc', + script='build_scripts/gen_histogram_data.py', + inputs=histogram_files) +GeneratedFile('TelemetryHistogramEnums.h', + script='build_scripts/gen_histogram_enum.py', + inputs=histogram_files) +GeneratedFile('TelemetryHistogramNameMap.h', + script='build_scripts/gen_histogram_phf.py', + inputs=histogram_files) # Generate scalar files. scalar_files = [ @@ -182,19 +166,20 @@ scalar_files = [ if CONFIG['MOZ_TELEMETRY_EXTRA_SCALAR_FILES']: scalar_files.extend(CONFIG['MOZ_TELEMETRY_EXTRA_SCALAR_FILES']) -scalar_data = GENERATED_FILES['TelemetryScalarData.h'] -scalar_data.script = 'build_scripts/gen_scalar_data.py' -scalar_data.inputs = scalar_files - -scalar_enums = GENERATED_FILES['TelemetryScalarEnums.h'] -scalar_enums.script = 'build_scripts/gen_scalar_enum.py' -scalar_enums.inputs = scalar_files +GeneratedFile('TelemetryScalarData.h', + script='build_scripts/gen_scalar_data.py', + inputs=scalar_files) +GeneratedFile('TelemetryScalarEnums.h', + script='build_scripts/gen_scalar_enum.py', + inputs=scalar_files) # Generate the JSON scalar definitions. They will only be # used in artifact or "build faster" builds. -scalar_json_data = GENERATED_FILES['ScalarArtifactDefinitions.json'] -scalar_json_data.script = 'build_scripts/gen_scalar_data.py:generate_JSON_definitions' -scalar_json_data.inputs = scalar_files +GeneratedFile( + 'ScalarArtifactDefinitions.json', + script='build_scripts/gen_scalar_data.py', + entry_point='generate_JSON_definitions', + inputs=scalar_files) # Move the scalars JSON file to the directory where the Firefox binary is. FINAL_TARGET_FILES += ['!ScalarArtifactDefinitions.json'] @@ -206,19 +191,17 @@ event_files = [ if CONFIG['MOZ_TELEMETRY_EXTRA_EVENT_FILES']: event_files.extend(CONFIG['MOZ_TELEMETRY_EXTRA_EVENT_FILES']) -event_data = GENERATED_FILES['TelemetryEventData.h'] -event_data.script = 'build_scripts/gen_event_data.py' -event_data.inputs = event_files +GeneratedFile('TelemetryEventData.h', script='build_scripts/gen_event_data.py', + inputs=event_files) -event_enums = GENERATED_FILES['TelemetryEventEnums.h'] -event_enums.script = 'build_scripts/gen_event_enum.py' -event_enums.inputs = event_files +GeneratedFile('TelemetryEventEnums.h', script='build_scripts/gen_event_enum.py', + inputs=event_files) # Generate the JSON event definitions. They will only be # used in artifact or "build faster" builds. -event_json_data = GENERATED_FILES['EventArtifactDefinitions.json'] -event_json_data.script = 'build_scripts/gen_event_data.py:generate_JSON_definitions' -event_json_data.inputs = event_files +GeneratedFile('EventArtifactDefinitions.json', + script='build_scripts/gen_event_data.py', + entryt_point='generate_JSON_definitions', inputs=event_files) # Move the events JSON file to the directory where the Firefox binary is. FINAL_TARGET_FILES += ['!EventArtifactDefinitions.json'] @@ -228,13 +211,14 @@ processes_files = [ 'Processes.yaml', ] -processes_enum = GENERATED_FILES['TelemetryProcessEnums.h'] -processes_enum.script = 'build_scripts/gen_process_enum.py' -processes_enum.inputs = processes_files +GeneratedFile('TelemetryProcessEnums.h', + script='build_scripts/gen_process_enum.py', + inputs=processes_files) -processes_data = GENERATED_FILES['TelemetryProcessData.h'] -processes_data.script = 'build_scripts/gen_process_data.py' -processes_data.inputs = processes_files + +GeneratedFile('TelemetryProcessData.h', + script='build_scripts/gen_process_data.py', + inputs=processes_files) # Add support for GeckoView: please note that building GeckoView # implies having an Android build. The packaging step decides diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build index 3ab1b53a885c..4e0cea4d2f58 100644 --- a/toolkit/crashreporter/moz.build +++ b/toolkit/crashreporter/moz.build @@ -9,10 +9,6 @@ SPHINX_TREES['crashreporter'] = 'docs' with Files('docs/**'): SCHEDULES.exclusive = ['docs'] -GENERATED_FILES += [ - 'CrashAnnotations.h', -] - EXPORTS += [ '!CrashAnnotations.h', 'nsExceptionHandler.h', @@ -136,12 +132,11 @@ else: ] # Generate CrashAnnotations.h -crash_annotations = GENERATED_FILES['CrashAnnotations.h'] -crash_annotations.script = 'generate_crash_reporter_sources.py:emit_header' -crash_annotations.inputs = [ - 'CrashAnnotations.h.in', - 'CrashAnnotations.yaml', -] +GeneratedFile('CrashAnnotations.h', script='generate_crash_reporter_sources.py', + entry_point='emit_header', inputs=[ + 'CrashAnnotations.h.in', + 'CrashAnnotations.yaml', + ]) with Files('**'): BUG_COMPONENT = ('Toolkit', 'Crash Reporting') diff --git a/toolkit/library/build/moz.build b/toolkit/library/build/moz.build index c4831c2ef4db..fb5d0b32a6f2 100644 --- a/toolkit/library/build/moz.build +++ b/toolkit/library/build/moz.build @@ -23,10 +23,7 @@ if CONFIG['COMPILE_ENVIRONMENT']: SHARED_LIBRARY_NAME, CONFIG['DLL_SUFFIX'] ) - GENERATED_FILES += [('dependentlibs.list', 'dependentlibs.list.gtest')] - dep_libs_list = GENERATED_FILES[('dependentlibs.list', 'dependentlibs.list.gtest')] - dep_libs_list.script = 'dependentlibs.py:gen_list' - dep_libs_list.inputs = [ - '!%s' % full_libname, - ] + GeneratedFile('dependentlibs.list', 'dependentlibs.list.gtest', + script='dependentlibs.py', entry_point='gen_list', + inputs=['!%s' % full_libname]) FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest'] diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 807d2aaf13ff..97011fee86ab 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -82,12 +82,9 @@ def Libxul(name, output_category=None): LDFLAGS += CONFIG['RUSTC_NATVIS_LDFLAGS'] if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android': - GENERATED_FILES += ['symverscript'] - GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py' - GENERATED_FILES['symverscript'].inputs = ['../symverscript.in'] - GENERATED_FILES['symverscript'].flags = [ - 'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION'] - ] + GeneratedFile('symverscript', script='/build/gen_symverscript.py', + inputs=['../symverscript.in'], + flags=['xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']]) SYMBOLS_FILE = '!symverscript' # Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is @@ -363,11 +360,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': # objects files that constitute libxul, so that if any of the files linked into # libxul is rebuilt, we refresh the buildid and link it into libxul. SOURCES += ['!buildid.cpp'] -GENERATED_FILES += ['buildid.cpp'] -GENERATED_FILES['buildid.cpp'].script = 'gen_buildid.py' if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): libxul_list = 'XUL' else: libxul_list = '%sxul_%s' % ( CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'].lstrip('.').replace('.','_')) -GENERATED_FILES['buildid.cpp'].inputs = ['!build/%s.list' % libxul_list] +GeneratedFile('buildid.cpp', script = 'gen_buildid.py', + inputs=['!build/%s.list' % libxul_list]) + diff --git a/toolkit/locales/moz.build b/toolkit/locales/moz.build index f3e2a596a078..12b9f4f86547 100644 --- a/toolkit/locales/moz.build +++ b/toolkit/locales/moz.build @@ -15,11 +15,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': JAR_MANIFESTS += ['jar.mn'] -GENERATED_FILES = [ - 'multilocale.txt', -] -multilocale = GENERATED_FILES['multilocale.txt'] -multilocale.script = 'gen_multilocale.py' +GeneratedFile('multilocale.txt', script='gen_multilocale.py') FINAL_TARGET_FILES.res += [ '!multilocale.txt', ] diff --git a/widget/android/moz.build b/widget/android/moz.build index 55d663797e4a..f63b93190e8e 100644 --- a/widget/android/moz.build +++ b/widget/android/moz.build @@ -77,13 +77,10 @@ include('/ipc/chromium/chromium-config.mozbuild') # an open FileAvoidWrite to the invoked script. That doesn't work well with # the Gradle task that generates all of the outputs, so we add a dummy first # output. -t = ('generated_jni_wrappers', - 'GeneratedJNINatives.h', - 'GeneratedJNIWrappers.h', - 'GeneratedJNIWrappers.cpp') - -GENERATED_FILES += [t] -GENERATED_FILES[t].script = '/mobile/android/gradle.py:generate_generated_jni_wrappers' +GeneratedFile( + 'generated_jni_wrappers', 'GeneratedJNINatives.h', 'GeneratedJNIWrappers.h', + 'GeneratedJNIWrappers.cpp', script='/mobile/android/gradle.py', + entry_point='generate_generated_jni_wrappers') FINAL_LIBRARY = 'xul' diff --git a/xpcom/base/moz.build b/xpcom/base/moz.build index b9bec64cad2b..a4f3f9aea2e5 100644 --- a/xpcom/base/moz.build +++ b/xpcom/base/moz.build @@ -200,15 +200,11 @@ if CONFIG['OS_TARGET'] == 'WINNT': 'MemoryInfo.cpp', ] -GENERATED_FILES += [ - "error_list.rs", - "ErrorList.h", - "ErrorNamesInternal.h", -] - -GENERATED_FILES["ErrorList.h"].script = "ErrorList.py:error_list_h" -GENERATED_FILES["ErrorNamesInternal.h"].script = "ErrorList.py:error_names_internal_h" -GENERATED_FILES["error_list.rs"].script = "ErrorList.py:error_list_rs" +GeneratedFile("ErrorList.h", script="ErrorList.py", entry_point="error_list_h") +GeneratedFile("ErrorNamesInternal.h", script="ErrorList.py", + entry_point="error_names_internal_h") +GeneratedFile("error_list.rs", script="ErrorList.py", + entry_point="error_list_rs") if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': SOURCES += [ @@ -220,19 +216,13 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': ] if CONFIG['COMPILE_ENVIRONMENT']: - GENERATED_FILES += [ - 'gk_rust_utils_ffi_generated.h', - ] - EXPORTS.mozilla += [ '!gk_rust_utils_ffi_generated.h', ] - ffi_generated = GENERATED_FILES['gk_rust_utils_ffi_generated.h'] - ffi_generated.script = '/layout/style/RunCbindgen.py:generate' - ffi_generated.inputs = [ - '/xpcom/rust/gkrust_utils', - ] + GeneratedFile('gk_rust_utils_ffi_generated.h', + script='/layout/style/RunCbindgen.py', + entry_point='generate', inputs=['/xpcom/rust/gkrust_utils']) include('/ipc/chromium/chromium-config.mozbuild') diff --git a/xpcom/build/moz.build b/xpcom/build/moz.build index b8489e492976..069fcbe0d111 100755 --- a/xpcom/build/moz.build +++ b/xpcom/build/moz.build @@ -73,15 +73,9 @@ if CONFIG['OS_ARCH'] != 'WINNT': 'NSPRInterposer.cpp', ] -GENERATED_FILES += [ - 'Services.cpp', - 'Services.h', - 'services.rs', -] - -GENERATED_FILES['Services.cpp'].script = 'Services.py:services_cpp' -GENERATED_FILES['Services.h'].script = 'Services.py:services_h' -GENERATED_FILES['services.rs'].script = 'Services.py:services_rs' +GeneratedFile('Services.cpp', script='Services.py', entry_point='services_cpp') +GeneratedFile('Services.h', script='Services.py', entry_point='services_h') +GeneratedFile('services.rs', script='Services.py', entry_point='services_rs') include('/ipc/chromium/chromium-config.mozbuild') diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build index 8243b714383a..9505e78e738c 100644 --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build @@ -38,14 +38,10 @@ if CONFIG['COMPILE_ENVIRONMENT']: '!Components.h', ] - generated = ('Components.h', 'StaticComponentData.h', - 'StaticComponents.cpp') - - GENERATED_FILES += [generated] - - gen = GENERATED_FILES[generated] - gen.script = 'gen_static_components.py' - gen.inputs += ['!manifest-lists.json', 'StaticComponents.cpp.in'] + GeneratedFile( + 'Components.h', 'StaticComponentData.h', 'StaticComponents.cpp', + script='gen_static_components.py', + inputs=['!manifest-lists.json', 'StaticComponents.cpp.in']) UNIFIED_SOURCES += [ 'GenericFactory.cpp', diff --git a/xpcom/ds/moz.build b/xpcom/ds/moz.build index b09a29985d4a..5408d7fca2c3 100644 --- a/xpcom/ds/moz.build +++ b/xpcom/ds/moz.build @@ -134,12 +134,12 @@ LOCAL_INCLUDES += [ '../io', ] -GENERATED_FILES += ['nsGkAtomList.h'] -GENERATED_FILES['nsGkAtomList.h'].script = 'StaticAtoms.py:generate_nsgkatomlist_h' -GENERATED_FILES['nsGkAtomList.h'].inputs = ['Atom.py', 'HTMLAtoms.py'] +GeneratedFile('nsGkAtomList.h', script='StaticAtoms.py', + entry_point='generate_nsgkatomlist_h', + inputs=['Atom.py', 'HTMLAtoms.py']) -GENERATED_FILES += ['nsGkAtomConsts.h'] -GENERATED_FILES['nsGkAtomConsts.h'].script = 'StaticAtoms.py:generate_nsgkatomconsts_h' -GENERATED_FILES['nsGkAtomConsts.h'].inputs = ['Atom.py', 'HTMLAtoms.py'] +GeneratedFile('nsGkAtomConsts.h', script='StaticAtoms.py', + entry_point='generate_nsgkatomconsts_h', + inputs=['Atom.py', 'HTMLAtoms.py']) FINAL_LIBRARY = 'xul' diff --git a/xpcom/idl-parser/xpidl/moz.build b/xpcom/idl-parser/xpidl/moz.build index e134b453187d..a642fe4d712a 100644 --- a/xpcom/idl-parser/xpidl/moz.build +++ b/xpcom/idl-parser/xpidl/moz.build @@ -8,8 +8,5 @@ PYTHON_UNITTEST_MANIFESTS += [ 'python.ini', ] -GENERATED_FILES += [ - ('xpidl.stub', 'xpidllex.py', 'xpidlyacc.py'), -] - -GENERATED_FILES[('xpidl.stub', 'xpidllex.py', 'xpidlyacc.py')].script = 'header.py:main' +GeneratedFile('xpidl.stub', 'xpidllex.py', 'xpidlyacc.py', script='header.py', + entry_point='main') diff --git a/xpcom/reflect/xptcall/md/win32/moz.build b/xpcom/reflect/xptcall/md/win32/moz.build index 71456bc68708..783d1845b133 100644 --- a/xpcom/reflect/xptcall/md/win32/moz.build +++ b/xpcom/reflect/xptcall/md/win32/moz.build @@ -49,10 +49,8 @@ elif CONFIG['CPU_ARCH'] == 'aarch64': # we generate different names for the objdir files for src in asm_files: obj = src.replace('_asm_aarch64', '') - GENERATED_FILES += [obj] - asm = GENERATED_FILES[obj] - asm.script = 'preprocess.py:preprocess' - asm.inputs = [src] + GeneratedFile(obj, script='preprocess.py', entry_point='preprocess', + inputs=[src]) SOURCES += ['!%s' % obj] FINAL_LIBRARY = 'xul'