Commit 4d909e4d authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Remove dashes-to-underscores processing for SDK package names.

Rules are temporarily provided under the processed names, to allow deps
to be migrated gradually.

Bug: fuchsia:42135
Change-Id: I774cd6de87fcc2a01536e09af288cfb3e859399b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937847
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719443}
parent 34ebd35d
......@@ -30,12 +30,7 @@ def ReformatTargetName(dep_name):
""""Substitutes characters in |dep_name| which are not valid in GN target
names (e.g. dots become hyphens)."""
# TODO(fxb/42135): Remove this rewriting and use names already containing
# hyphens as-is.
reformatted_name = dep_name.replace('-','_')
reformatted_name = reformatted_name.replace('.','-')
reformatted_name = dep_name.replace('.','-')
return reformatted_name
def ConvertCommonFields(json):
......@@ -183,8 +178,10 @@ def ConvertSdkManifests():
(part['type'], part['meta']))
converted = convert_function(parsed)
if converted:
buildfile.write(FormatGNTarget(converted) + '\n\n')
if not converted:
continue
buildfile.write(FormatGNTarget(converted) + '\n\n')
# TODO(fxb/42135): Remove this hack once dependencies have been updated.
# Create dummy targets using the old short names, which depend on the
......@@ -206,6 +203,14 @@ def ConvertSdkManifests():
'public_deps': [ ':' + target_name]
}
buildfile.write(FormatGNTarget(fields) + '\n\n')
elif '-' in parsed['name']:
target_name = ReformatTargetName(parsed['name'])
fields = {
'target_name' : target_name.replace('-', '_'),
'type': 'group',
'public_deps': [ ':' + target_name]
}
buildfile.write(FormatGNTarget(fields) + '\n\n')
if __name__ == '__main__':
sys.exit(ConvertSdkManifests())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment