blob: 357b2b807d1a6d44f201eadb031e148cf64ccdf9 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
import("//src/fonts/build/fonts.gni")
group("fonts") {
public_deps = [
":pkg",
# XXX: external dependencies on //src/fonts are intending just to get the
# package, but that layout does not follow the convention of directory
# targets including all their tests and buildable artifacts. For now these
# need to be disabled, and all external consumers only intending to import
# fonts support should be moved to using //src/fonts:pkg instead.
# ":open-fonts",
# ":tests",
]
}
group("tests") {
testonly = true
public_deps = [
":font_provider_unit_tests",
"char_set:tests",
"font_info:tests",
"manifest:tests",
"offset_string:tests",
"tests",
"tools:tests",
]
}
# Group of all the dependencies needed for downstream tests that rely on fonts,
# such as Chromium tests.
# Tests that use this dependency should also put
# { "fuchsia.fonts.Provider": "fuchsia-pkg://fuchsia.com/fonts#meta/fonts_for_downstream_tests.cmx" }
# in their component manifests' "facets" > "fuchsia.test" > "injected-services".
group("downstream_test_deps") {
testonly = true
public_deps = [
":downstream-test-fonts-collection",
":fonts",
]
}
rustc_binary("font_provider") {
name = "font_provider"
with_unit_tests = true
edition = "2018"
deps = [
"char_set",
"font_info",
"freetype_ffi",
"manifest",
"//garnet/lib/rust/fidl_fuchsia_fonts_ext",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.fonts:fuchsia.fonts-rustc",
"//sdk/fidl/fuchsia.fonts.experimental:fuchsia.fonts.experimental-rustc",
"//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:heck",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:unicase",
]
test_deps = [
"//src/lib/intl/unicode_utils/char_collection",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:pretty_assertions",
]
non_rust_deps = [ "//third_party/freetype2" ]
sources = [
"src/font_service/asset/asset.rs",
"src/font_service/asset/cache.rs",
"src/font_service/asset/collection.rs",
"src/font_service/asset/loader.rs",
"src/font_service/asset/mod.rs",
"src/font_service/builder.rs",
"src/font_service/family.rs",
"src/font_service/inspect.rs",
"src/font_service/mod.rs",
"src/font_service/typeface/collection.rs",
"src/font_service/typeface/matcher.rs",
"src/font_service/typeface/mod.rs",
"src/font_service/typeface/test_util.rs",
"src/font_service/typeface/typeface.rs",
"src/main.rs",
]
}
package("pkg") {
package_name = "fonts"
deps = [ ":font_provider" ]
binaries = [
{
name = "font_provider"
},
]
meta = [
# TODO: Remove fonts.cmx once external clients aren't using it.
{
path = rebase_path("meta/fonts.cmx")
dest = "fonts.cmx"
},
{
path = rebase_path("meta/fonts.cml")
dest = "fonts.cm"
},
{
path = rebase_path("meta/fonts_for_downstream_tests.cmx")
dest = "fonts_for_downstream_tests.cmx"
},
]
}
test_package("font_provider_unit_tests") {
deps = [ ":font_provider_test" ]
v2_tests = [
{
name = "font_provider_bin_test"
environments = basic_envs
},
]
}
# Re-export:
# Group of all open-source font packages. This should be added to
# `universe_package_labels`.
group("open-fonts") {
deps = [ "collections:open-fonts" ]
}
# Re-export:
# Font collection for semi-hermetic downstream tests (e.g. Chromium) that need
# to use a fixed set of fonts.
group("downstream-test-fonts-collection") {
testonly = true
deps = [ "collections:downstream-test-fonts-collection" ]
}
# Re-export:
# Font collection for open-source products. This should be added to
# `base_package_labels` or `cache_package_labels`.
group("open-fonts-collection") {
testonly = true
deps = [ "collections:open-fonts-collection" ]
}
# Re-export:
# Empty font collection for products that spawn a font server but don't want any
# actual fonts. This should be added to `base_package_labels` or
# `cache_package_labels`.
group("empty-font-collection") {
deps = [ "collections:empty-font-collection" ]
}