Commit a6be9ec6 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Remove namespace_path parameter from FIDL targets

GN now supports string_replace(), which allows to remove namespace_path

TBR=dcheng@chromium.org (trivial change in //base)

Change-Id: Iac8a71b6962cf48bc7a79e2f7fc62a88969f80a1
Reviewed-on: https://chromium-review.googlesource.com/1246834
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594473}
parent e5c68b96
......@@ -2199,7 +2199,6 @@ if (is_ios || is_mac) {
if (is_fuchsia) {
fidl_library("testfidl") {
namespace = "base.fuchsia"
namespace_path = "base/fuchsia"
sources = [
"fuchsia/test.fidl",
......
......@@ -12,13 +12,6 @@ assert(is_fuchsia)
# library_name - (optional) Name of the library. target_name is used if name
# is not specified explicitly.
# namespace - (optional) Namespace for the library.
# namespace_path - (optional) namespace with '.' are replaced with '/', e.g.
# if namespace is "fuchsia.foo", then namespace_path must be
# set to "fuchsia/foo". This parameter must be specified when
# namespace is specified.
# TODO(sergeyu): In theory namespace_path can be generated
# from name, but GN doesn't provide any tools to perform this
# conversion without invoking a python script.
# deps - (optional) List of other fidl_library() targets that this
# FIDL library depends on.
#
......@@ -26,11 +19,7 @@ assert(is_fuchsia)
# files.
template("fidl_library") {
forward_variables_from(invoker,
[
"namespace",
"namespace_path",
])
forward_variables_from(invoker, [ "namespace" ])
_library_basename = target_name
if (defined(invoker.library_name)) {
......@@ -38,10 +27,9 @@ template("fidl_library") {
}
if (defined(namespace)) {
assert(defined(namespace_path),
"FIDL libraries with namespace must specify namespace_path")
_library_name = "${namespace}.${_library_basename}"
_library_path = "${namespace_path}/${_library_basename}"
_namespace_path = string_replace(namespace, ".", "/")
_library_path = "${_namespace_path}/${_library_basename}"
} else {
_library_name = _library_basename
_library_path = _library_basename
......
......@@ -13,8 +13,7 @@ import("//build/config/fuchsia/fidl_library.gni")
# Parameters:
# package_name - Name of the library. target_name is used if name
# is not specified explicitly.
# namespace, namespace_path - FIDL namespace. See fidl_library.gni
# for details.
# namespace - FIDL namespace.
# sources - List of sources relative to sdk/fidl/${name}.
# deps - List of dependencies.
template("fuchsia_sdk_fidl_pkg") {
......@@ -35,10 +34,7 @@ template("fuchsia_sdk_fidl_pkg") {
library_name = _package_name
if (defined(invoker.namespace)) {
assert(defined(invoker.namespace_path),
"SDK packages with namespace must specify namespace_path")
namespace = invoker.namespace
namespace_path = invoker.namespace_path
}
sources = invoker.sources
......
......@@ -44,11 +44,9 @@ def ConvertFidlLibrary(json):
name_tokenized = json['name'].split('.')
json['shortname'] = name_tokenized[-1]
json['namespace'] = '.'.join(name_tokenized[:-1])
json['namespace_path'] = json['namespace'].replace('.', '/')
return """fuchsia_sdk_fidl_pkg("{shortname}") {{
namespace = "{namespace}"
namespace_path = "{namespace_path}"
public_deps = {deps}
sources = {sources}
}}""".format(**json)
......
......@@ -211,7 +211,6 @@ test("webrunner_unittests") {
fidl_library("fidl") {
library_name = "web"
namespace = "chromium"
namespace_path = "chromium"
sources = [
"fidl/context.fidl",
......
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