blob: 5c845639b5cead6f5706819f4c9b3bd3e1405313 [file] [log] [blame]
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_fuchsia)
import("//build/config/fuchsia/fidl_library.gni")
import("//build/util/process_version.gni")
# Location where Fuchsia release archives and supporting files are placed.
_release_artifact_root = "$root_out_dir/fuchsia_artifacts"
fidl_library("web_fidl") {
library_name = "web"
namespace = "chromium"
sources = [
"fidl/web/context.fidl",
"fidl/web/context_provider.fidl",
"fidl/web/frame.fidl",
"fidl/web/navigation_controller.fidl",
"fidl/web/navigation_event_observer.fidl",
]
public_deps = [
"//third_party/fuchsia-sdk/sdk:io",
"//third_party/fuchsia-sdk/sdk:sys",
"//third_party/fuchsia-sdk/sdk:ui_views",
]
}
fidl_library("cast_fidl") {
library_name = "cast"
namespace = "chromium"
sources = [
"fidl/cast/application_config.fidl",
"fidl/cast/cast_channel.fidl",
"fidl/cast/queryable_data.fidl",
]
public_deps = [
":web_fidl",
"//third_party/fuchsia-sdk/sdk:web",
]
}
# gn binary location.
if (host_os == "mac") {
_gn_path = "//buildtools/mac/gn"
} else if (host_os == "linux") {
_gn_path = "//buildtools/linux64/gn"
}
# Produces a LICENSE file for webrunner and its transitive dependencies.
_license_path = "$_release_artifact_root/LICENSE"
action("license") {
script = "//tools/licenses.py"
inputs = [
"$_gn_path",
]
outputs = [
_license_path,
]
args = [
"license_file",
rebase_path(_license_path, root_build_dir),
"--gn-target",
"//fuchsia/runners:web_runner_pkg",
"--gn-out-dir",
".",
]
}
# Extracts the numeric Chrome build ID and writes it to a file in the output
# directory.
#
# To check out the repository on the commit where the build ID was generated,
# simply call `git checkout <build-id>`, and Git will check out the commit
# associated with the <build-id> tag.
process_version("build_id") {
template_file = "cipd/build_id.template"
sources = [
"//chrome/VERSION",
]
output = "$_release_artifact_root/build_id.txt"
process_only = true
}
# Puts copies of files at the top level of the CIPD archive's structure.
copy("release_archives") {
sources = [
"$root_gen_dir/fuchsia/engine/chromium/chromium.far",
"$root_gen_dir/fuchsia/http/http/http.far",
"$root_gen_dir/fuchsia/runners/cast_runner/cast_runner.far",
"$root_gen_dir/fuchsia/runners/web_runner/web_runner.far",
]
outputs = [
"$_release_artifact_root/{{source_file_part}}",
]
deps = [
"//fuchsia/engine:web_engine",
"//fuchsia/http:http_pkg",
"//fuchsia/runners:cast_runner_pkg",
"//fuchsia/runners:web_runner_pkg",
]
}
if (is_official_build) {
# Location where debug symbol tarballs are placed.
_symbol_artifact_root = "$root_out_dir/symbol_artifacts"
# Create a manifest of symbol archives for downstream consumption.
_symbol_tarballs = [
"$root_gen_dir/fuchsia/engine/chromium/chromium.symbols.tar.bz2",
"$root_gen_dir/fuchsia/http/http/http.symbols.tar.bz2",
"$root_gen_dir/fuchsia/runners/cast_runner/cast_runner.symbols.tar.bz2",
"$root_gen_dir/fuchsia/runners/web_runner/web_runner.symbols.tar.bz2",
]
_symbol_manifest = "$target_gen_dir/debug_symbols.json"
write_file(_symbol_manifest, _symbol_tarballs, "json")
copy("symbol_tarballs") {
sources = [
_symbol_manifest,
"$_release_artifact_root/build_id.txt",
_license_path,
] + _symbol_tarballs
outputs = [
"$_symbol_artifact_root/{{source_file_part}}",
]
deps = [
":build_id",
":license",
"//fuchsia/engine:symbol_archive",
"//fuchsia/http:symbol_archive",
"//fuchsia/runners:cast_runner_symbol_archive",
"//fuchsia/runners:web_runner_symbol_archive",
]
}
# Specifies the build steps that must be performed before the creation of
# a CIPD archive.
group("archive_sources") {
deps = [
":build_id",
":license",
":release_archives",
":symbol_tarballs",
]
}
} # is_official_build
# Used by the top-level "gn_all" target to discover Fuchsia build targets.
group("gn_all") {
testonly = true
deps = [
"base:cr_fuchsia_base_unittests",
"engine:web_engine",
"engine:web_engine_browsertests",
"engine:web_engine_unittests",
"http:http_service_tests",
"runners:cast_runner",
"runners:cast_runner_browsertests",
"runners:cast_runner_integration_tests",
"runners:web_runner",
]
}