Commit 2636fa71 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Format material_components_ios/BUILD.gn to be updated automatically.

Put the three lists that need to be updated (headers, sources and
include_dirs) in toplevel variables.

Change-Id: I6f6e0f9b7f8104f7fadc0493b9d316f018f098ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066838
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743496}
parent 5934e208
......@@ -486,33 +486,7 @@ _mdc_public_headers = [
"src/components/schemes/Typography/src/Scheming/MaterialTypographyScheme+Scheming.h",
]
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (!ios_third_party_material_components_built_as_framework) {
config("mdc_components_ios_public_headers_config") {
include_dirs = [ "$root_gen_dir/frameworks/material_components_ios" ]
}
copy("mdc_components_ios_public_headers") {
sources = _mdc_public_headers
outputs = [ "$root_gen_dir/frameworks/material_components_ios/MaterialComponents/{{source_file_part}}" ]
public_configs = [ ":mdc_components_ios_public_headers_config" ]
}
} else {
config("public_configs") {
visibility = [ ":*" ]
# This is a hack to allow to include the header using the full path but
# still have them function as if they were included using framework style.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
include_dirs = [ "$root_out_dir/MaterialComponents.framework/Headers" ]
}
}
config("config") {
visibility = [ ":*" ]
include_dirs = [
_mdc_include_dirs = [
# List generated by the following commands:
# $ cd src/ios/third_party/material_components_ios
# $ find src -path 'src/components/*/src/*.h' -a \! -path '*Test*'|\
......@@ -667,40 +641,9 @@ config("config") {
"src/components/schemes/Typography/src",
"src/components/schemes/Typography/src/BasicFontScheme",
"src/components/schemes/Typography/src/Scheming",
]
}
config("disable_deprecated_errors") {
cflags = [
"-Wno-deprecated",
"-Wno-deprecated-declarations",
]
}
# This variable is used to build MDC as either an ios_framework_bundle or a
# source_set if ios_third_party_material_components_built_as_framework is set
# to true/false.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (ios_third_party_material_components_built_as_framework) {
_mdc_target_type = "ios_framework_bundle"
} else {
_mdc_target_type = "source_set"
}
# This target is there to allow code to include framework headers with the
# full path while both framework and source_set compilation mode both need
# to be supported.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (ios_third_party_material_components_built_as_framework) {
source_set("material_components_ios_public_headers") {
public = _mdc_public_headers
}
}
]
target(_mdc_target_type, "material_components_ios") {
sources = [
_mdc_sources = [
# List generated by the following commands:
# $ cd src/ios/third_party/material_components_ios
# $ find src -path 'src/components/*/src/*.[hm]' -a \! -path '*Test*'|\
......@@ -1447,7 +1390,68 @@ target(_mdc_target_type, "material_components_ios") {
"src/components/schemes/Typography/src/MaterialTypographyScheme.h",
"src/components/schemes/Typography/src/Scheming/MDCTypographyScheming.h",
"src/components/schemes/Typography/src/Scheming/MaterialTypographyScheme+Scheming.h",
]
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (!ios_third_party_material_components_built_as_framework) {
config("mdc_components_ios_public_headers_config") {
include_dirs = [ "$root_gen_dir/frameworks/material_components_ios" ]
}
copy("mdc_components_ios_public_headers") {
sources = _mdc_public_headers
outputs = [ "$root_gen_dir/frameworks/material_components_ios/MaterialComponents/{{source_file_part}}" ]
public_configs = [ ":mdc_components_ios_public_headers_config" ]
}
} else {
config("public_configs") {
visibility = [ ":*" ]
# This is a hack to allow to include the header using the full path but
# still have them function as if they were included using framework style.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
include_dirs = [ "$root_out_dir/MaterialComponents.framework/Headers" ]
}
}
config("config") {
visibility = [ ":*" ]
include_dirs = _mdc_include_dirs
}
config("disable_deprecated_errors") {
cflags = [
"-Wno-deprecated",
"-Wno-deprecated-declarations",
]
}
# This variable is used to build MDC as either an ios_framework_bundle or a
# source_set if ios_third_party_material_components_built_as_framework is set
# to true/false.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (ios_third_party_material_components_built_as_framework) {
_mdc_target_type = "ios_framework_bundle"
} else {
_mdc_target_type = "source_set"
}
# This target is there to allow code to include framework headers with the
# full path while both framework and source_set compilation mode both need
# to be supported.
# TODO(crbug.com/1017165): remove once MaterialComponents is always built
# as a framework
if (ios_third_party_material_components_built_as_framework) {
source_set("material_components_ios_public_headers") {
public = _mdc_public_headers
}
}
target(_mdc_target_type, "material_components_ios") {
sources = _mdc_sources
if (ios_third_party_material_components_built_as_framework) {
info_plist = "Info.plist"
......
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