Skip to content

Commit

Permalink
Bug 1228444 - Rename DIST_FILES to FINAL_TARGET_PP_FILES. r=gps
Browse files Browse the repository at this point in the history
This makes it clearer that really it's the same thing as FINAL_TARGET,
with preprocessing.
We still keep DIST_FILES in backend.mk because it's shorter and doesn't
really matter.
  • Loading branch information
glandium committed Nov 30, 2015
1 parent 3a04b1f commit 3a7b31c
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 42 deletions.
2 changes: 1 addition & 1 deletion b2g/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ JS_PREFERENCE_FILES += [
'b2g.js',
]

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'ua-update.json.in',
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

FINAL_TARGET = 'dist/bin/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}'

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf.in',
]
4 changes: 2 additions & 2 deletions build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
FINAL_TARGET_FILES += [CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]

if CONFIG['MOZ_APP_BASENAME']:
DIST_FILES += ['application.ini']
FINAL_TARGET_PP_FILES += ['application.ini']
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
DIST_FILES += ['update-settings.ini']
FINAL_TARGET_PP_FILES += ['update-settings.ini']
2 changes: 1 addition & 1 deletion dom/indexedDB/test/extensions/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

XPI_NAME = 'indexedDB'

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
]

Expand Down
2 changes: 1 addition & 1 deletion dom/workers/test/extensions/bootstrap/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

XPI_NAME = 'workerbootstrap'

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
]

Expand Down
2 changes: 1 addition & 1 deletion dom/workers/test/extensions/traditional/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ EXTRA_COMPONENTS += [

XPI_NAME = 'worker'

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
]

Expand Down
4 changes: 2 additions & 2 deletions layout/tools/reftest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ USE_EXTENSION_MANIFEST = True

XPI_NAME = 'reftest'

DIST_FILES += ['install.rdf']
FINAL_TARGET_PP_FILES += ['install.rdf']

if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
DIST_FILES += ['bootstrap.js']
FINAL_TARGET_PP_FILES += ['bootstrap.js']
2 changes: 1 addition & 1 deletion mobile/android/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ JS_PREFERENCE_FILES += [
'mobile.js',
]

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'ua-update.json.in',
]
2 changes: 1 addition & 1 deletion mobile/android/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -929,4 +929,4 @@ if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
'gecko-util.jar'
]

DIST_FILES += ['package-name.txt.in']
FINAL_TARGET_PP_FILES += ['package-name.txt.in']
2 changes: 1 addition & 1 deletion modules/libpref/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'greprefs.js',
]
7 changes: 4 additions & 3 deletions python/mozbuild/mozbuild/backend/fastermake.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ChromeManifestEntry,
ContextDerived,
Defines,
DistFiles,
FinalTargetPreprocessedFiles,
FinalTargetFiles,
JARManifest,
JavaScriptModules,
Expand Down Expand Up @@ -150,11 +150,12 @@ def consume_object(self, obj):
mozpath.join(base, mozpath.basename(f))
)

elif isinstance(obj, (FinalTargetFiles, DistFiles)) and \
elif isinstance(obj, (FinalTargetFiles,
FinalTargetPreprocessedFiles)) and \
obj.install_target.startswith('dist/bin'):
for path, strings in obj.files.walk():
for f in strings:
if isinstance(obj, DistFiles):
if isinstance(obj, FinalTargetPreprocessedFiles):
self._add_preprocess(obj, f, path, defines=defines)
else:
self._install_manifests[obj.install_target].add_symlink(
Expand Down
9 changes: 5 additions & 4 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
ContextDerived,
ContextWrapped,
Defines,
DistFiles,
DirectoryTraversal,
Exports,
ExternalLibrary,
FinalTargetFiles,
FinalTargetPreprocessedFiles,
GeneratedFile,
GeneratedSources,
HostDefines,
Expand Down Expand Up @@ -604,8 +604,9 @@ def consume_object(self, obj):
elif isinstance(obj, FinalTargetFiles):
self._process_final_target_files(obj, obj.files, obj.target)

elif isinstance(obj, DistFiles):
self._process_dist_files(obj, obj.files, obj.target, backend_file)
elif isinstance(obj, FinalTargetPreprocessedFiles):
self._process_final_target_pp_files(obj, obj.files, obj.target,
backend_file)

elif isinstance(obj, AndroidResDirs):
# Order matters.
Expand Down Expand Up @@ -1390,7 +1391,7 @@ def _process_final_target_files(self, obj, files, target):
dest = mozpath.join(reltarget, path, mozpath.basename(f))
install_manifest.add_symlink(source, dest)

def _process_dist_files(self, obj, files, target, backend_file):
def _process_final_target_pp_files(self, obj, files, target, backend_file):
# We'd like to install these via manifests as preprocessed files.
# But they currently depend on non-standard flags being added via
# some Makefiles, so for now we just pass them through to the
Expand Down
12 changes: 11 additions & 1 deletion python/mozbuild/mozbuild/frontend/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def aggregate(files):
disabled.
""", None),

'DIST_FILES': (HierarchicalStringList, list,
'FINAL_TARGET_PP_FILES': (HierarchicalStringList, list,
"""Like ``FINAL_TARGET_FILES``, with preprocessing.
""", 'libs'),

Expand Down Expand Up @@ -2118,6 +2118,16 @@ def Program(name):
GENERATED_INCLUDES += [ 'foo' ]
''',

'DIST_FILES': '''
Please use
FINAL_TARGET_PP_FILES += [ 'foo' ]
instead of
DIST_FILES += [ 'foo' ]
''',
}

# Make sure that all template variables have a deprecation hint.
Expand Down
8 changes: 5 additions & 3 deletions python/mozbuild/mozbuild/frontend/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,14 @@ def __init__(self, sandbox, files, target):
self.target = target


class DistFiles(ContextDerived):
"""Sandbox container object for DIST_FILES, which is a HierarchicalStringList.
class FinalTargetPreprocessedFiles(ContextDerived):
"""Sandbox container object for FINAL_TARGET_PP_FILES, which is a
HierarchicalStringList.
We need an object derived from ContextDerived for use in the backend, so
this object fills that role. It just has a reference to the underlying
HierarchicalStringList, which is created when parsing DIST_FILES.
HierarchicalStringList, which is created when parsing
FINAL_TARGET_PP_FILES.
"""
__slots__ = ('files', 'target')

Expand Down
4 changes: 2 additions & 2 deletions python/mozbuild/mozbuild/frontend/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
ConfigFileSubstitution,
ContextWrapped,
Defines,
DistFiles,
DirectoryTraversal,
Exports,
FinalTargetFiles,
FinalTargetPreprocessedFiles,
GeneratedEventWebIDLFile,
GeneratedFile,
GeneratedSources,
Expand Down Expand Up @@ -684,7 +684,7 @@ def emit_from_context(self, context):

for var, cls in (
('FINAL_TARGET_FILES', FinalTargetFiles),
('DIST_FILES', DistFiles),
('FINAL_TARGET_PP_FILES', FinalTargetPreprocessedFiles),
):
all_files = context.get(var)
if not all_files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
'main.js',
]
4 changes: 2 additions & 2 deletions python/mozbuild/mozbuild/test/backend/test_recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ def test_final_target(self):
str.startswith('DIST_SUBDIR')]
self.assertEqual(found, expected_rules)

def test_dist_files(self):
"""Test that DIST_FILES is written to backend.mk correctly."""
def test_final_target_pp_files(self):
"""Test that FINAL_TARGET_PP_FILES is written to backend.mk correctly."""
env = self._consume('dist-files', RecursiveMakeBackend)

backend_path = mozpath.join(env.topobjdir, 'backend.mk')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
'main.js',
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
'main.js',
]
14 changes: 7 additions & 7 deletions python/mozbuild/mozbuild/test/frontend/test_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
ChromeManifestEntry,
ConfigFileSubstitution,
Defines,
DistFiles,
DirectoryTraversal,
Exports,
FinalTargetPreprocessedFiles,
GeneratedFile,
GeneratedSources,
HostDefines,
Expand Down Expand Up @@ -887,13 +887,13 @@ def test_unified_sources_non_unified(self):
[mozpath.join(reader.config.topsrcdir, f) for f in files])
self.assertFalse(sources.have_unified_mapping)

def test_dist_files(self):
"""Test that DIST_FILES works properly."""
def test_final_target_pp_files(self):
"""Test that FINAL_TARGET_PP_FILES works properly."""
reader = self.reader('dist-files')
objs = self.read_topsrcdir(reader)

self.assertEqual(len(objs), 1)
self.assertIsInstance(objs[0], DistFiles)
self.assertIsInstance(objs[0], FinalTargetPreprocessedFiles)

# Ideally we'd test hierarchies, but that would just be testing
# the HierarchicalStringList class, which we test separately.
Expand All @@ -905,10 +905,10 @@ def test_dist_files(self):
for f in files:
self.assertTrue(f in expected)

def test_missing_dist_files(self):
"""Test that DIST_FILES with missing files throws errors."""
def test_missing_final_target_pp_files(self):
"""Test that FINAL_TARGET_PP_FILES with missing files throws errors."""
with self.assertRaisesRegexp(SandboxValidationError, 'File listed in '
'DIST_FILES does not exist'):
'FINAL_TARGET_PP_FILES does not exist'):
reader = self.reader('dist-files-missing')
self.read_topsrcdir(reader)

Expand Down
2 changes: 1 addition & 1 deletion testing/mochitest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ JAR_MANIFESTS += ['jar.mn']

USE_EXTENSION_MANIFEST = True

DIST_FILES += ['install.rdf']
FINAL_TARGET_PP_FILES += ['install.rdf']

MOCHITEST_MANIFESTS += [
'dynamic/mochitest.ini',
Expand Down
2 changes: 1 addition & 1 deletion testing/specialpowers/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ JAR_MANIFESTS += ['jar.mn']
USE_EXTENSION_MANIFEST = True
NO_JS_MANIFEST = True

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
]

Expand Down
2 changes: 1 addition & 1 deletion tools/quitter/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ JAR_MANIFESTS += ['jar.mn']
USE_EXTENSION_MANIFEST = True
NO_JS_MANIFEST = True

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'install.rdf',
]

Expand Down
2 changes: 1 addition & 1 deletion webapprt/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ JS_PREFERENCE_FILES += [
'prefs.js',
]

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'webapprt.ini',
]
2 changes: 1 addition & 1 deletion xulrunner/examples/simple/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ JS_PREFERENCE_FILES += [
'simple-prefs.js',
]

DIST_FILES += [
FINAL_TARGET_PP_FILES += [
'application.ini',
]

Expand Down

0 comments on commit 3a7b31c

Please sign in to comment.