blob: 46a7fc1f0125cacf21073ad15184e65ed9d0c5d0 [file] [log] [blame]
# Copyright 2016 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.
import("//build/config/locales.gni")
config("config") {
visibility = [ ":material_components_ios" ]
include_dirs = [
"src/components/AppBar/src",
"src/components/ActivityIndicator/src",
"src/components/ButtonBar/src",
"src/components/Buttons/src",
"src/components/CollectionCells/src",
"src/components/CollectionLayoutAttributes/src",
"src/components/Collections/src",
"src/components/Dialogs/src",
"src/components/FlexibleHeader/src",
"src/components/HeaderStackView/src",
"src/components/Ink/src",
"src/components/NavigationBar/src",
"src/components/OverlayWindow/src",
"src/components/Palettes/src",
"src/components/ProgressView/src",
"src/components/ShadowElevations/src",
"src/components/ShadowLayer/src",
"src/components/Snackbar/src",
"src/components/Typography/src",
]
cflags_objc = [
# Do not consider use of deprecated API as errors when building third-party
# libraries.
"-Wno-error=deprecated-declarations",
]
}
_icon_names = [
"ic_check",
"ic_check_circle",
"ic_chevron_right",
"ic_info",
"ic_radio_button_unchecked",
"ic_reorder",
]
source_set("material_components_ios") {
sources = [
"src/components/ActivityIndicator/src/MDCActivityIndicator.h",
"src/components/ActivityIndicator/src/MDCActivityIndicator.m",
"src/components/ActivityIndicator/src/MaterialActivityIndicator.h",
"src/components/AnimationTiming/src/CAMediaTimingFunction+MDCAnimationTiming.h",
"src/components/AnimationTiming/src/CAMediaTimingFunction+MDCAnimationTiming.m",
"src/components/AppBar/src/MDCAppBar.h",
"src/components/AppBar/src/MDCAppBar.m",
"src/components/AppBar/src/MDCAppBarContainerViewController.h",
"src/components/AppBar/src/MDCAppBarContainerViewController.m",
"src/components/AppBar/src/MaterialAppBar.h",
"src/components/ButtonBar/src/MDCButtonBar.h",
"src/components/ButtonBar/src/MDCButtonBar.m",
"src/components/ButtonBar/src/MaterialButtonBar.h",
"src/components/ButtonBar/src/private/MDCAppBarButtonBarBuilder.h",
"src/components/ButtonBar/src/private/MDCAppBarButtonBarBuilder.m",
"src/components/Buttons/src/MDCButton.h",
"src/components/Buttons/src/MDCButton.m",
"src/components/Buttons/src/MDCFlatButton.h",
"src/components/Buttons/src/MDCFlatButton.m",
"src/components/Buttons/src/MDCFloatingButton.h",
"src/components/Buttons/src/MDCFloatingButton.m",
"src/components/Buttons/src/MDCRaisedButton.h",
"src/components/Buttons/src/MDCRaisedButton.m",
"src/components/Buttons/src/MaterialButtons.h",
"src/components/Buttons/src/private/MDCButton+Subclassing.h",
"src/components/CollectionCells/src/MDCCollectionViewCell.h",
"src/components/CollectionCells/src/MDCCollectionViewCell.m",
"src/components/CollectionCells/src/MDCCollectionViewTextCell.h",
"src/components/CollectionCells/src/MDCCollectionViewTextCell.m",
"src/components/CollectionCells/src/MaterialCollectionCells.h",
"src/components/CollectionLayoutAttributes/src/MDCCollectionViewLayoutAttributes.h",
"src/components/CollectionLayoutAttributes/src/MDCCollectionViewLayoutAttributes.m",
"src/components/CollectionLayoutAttributes/src/MaterialCollectionLayoutAttributes.h",
"src/components/Collections/src/MDCCollectionViewController.h",
"src/components/Collections/src/MDCCollectionViewController.m",
"src/components/Collections/src/MDCCollectionViewEditing.h",
"src/components/Collections/src/MDCCollectionViewEditingDelegate.h",
"src/components/Collections/src/MDCCollectionViewFlowLayout.h",
"src/components/Collections/src/MDCCollectionViewFlowLayout.m",
"src/components/Collections/src/MDCCollectionViewStyling.h",
"src/components/Collections/src/MDCCollectionViewStylingDelegate.h",
"src/components/Collections/src/MaterialCollections.h",
"src/components/Collections/src/private/MDCCollectionGridBackgroundView.h",
"src/components/Collections/src/private/MDCCollectionGridBackgroundView.m",
"src/components/Collections/src/private/MDCCollectionInfoBarView.h",
"src/components/Collections/src/private/MDCCollectionInfoBarView.m",
"src/components/Collections/src/private/MDCCollectionStringResources.h",
"src/components/Collections/src/private/MDCCollectionStringResources.m",
"src/components/Collections/src/private/MDCCollectionViewEditor.h",
"src/components/Collections/src/private/MDCCollectionViewEditor.m",
"src/components/Collections/src/private/MDCCollectionViewStyler.h",
"src/components/Collections/src/private/MDCCollectionViewStyler.m",
"src/components/Collections/src/private/MaterialCollectionsStrings.h",
"src/components/Collections/src/private/MaterialCollectionsStrings_table.h",
"src/components/Dialogs/src/MDCAlertController.h",
"src/components/Dialogs/src/MDCAlertController.m",
"src/components/Dialogs/src/MDCDialogPresentationController.h",
"src/components/Dialogs/src/MDCDialogPresentationController.m",
"src/components/Dialogs/src/MDCDialogTransitionController.h",
"src/components/Dialogs/src/MDCDialogTransitionController.m",
"src/components/Dialogs/src/MaterialDialogs.h",
"src/components/Dialogs/src/private/MDCDialogShadowedView.h",
"src/components/Dialogs/src/private/MDCDialogShadowedView.m",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderContainerViewController.h",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderContainerViewController.m",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderView.h",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderView.m",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.h",
"src/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m",
"src/components/FlexibleHeader/src/MaterialFlexibleHeader.h",
"src/components/FlexibleHeader/src/private/MDCStatusBarShifter.h",
"src/components/FlexibleHeader/src/private/MDCStatusBarShifter.m",
"src/components/HeaderStackView/src/MDCHeaderStackView.h",
"src/components/HeaderStackView/src/MDCHeaderStackView.m",
"src/components/HeaderStackView/src/MaterialHeaderStackView.h",
"src/components/Ink/src/MDCInkGestureRecognizer.h",
"src/components/Ink/src/MDCInkGestureRecognizer.m",
"src/components/Ink/src/MDCInkTouchController.h",
"src/components/Ink/src/MDCInkTouchController.m",
"src/components/Ink/src/MDCInkView.h",
"src/components/Ink/src/MDCInkView.m",
"src/components/Ink/src/MaterialInk.h",
"src/components/Ink/src/private/MDCInkLayer.h",
"src/components/Ink/src/private/MDCInkLayer.m",
"src/components/NavigationBar/src/MDCNavigationBar.h",
"src/components/NavigationBar/src/MDCNavigationBar.m",
"src/components/NavigationBar/src/MaterialNavigationBar.h",
"src/components/OverlayWindow/src/MDCOverlayWindow.h",
"src/components/OverlayWindow/src/MDCOverlayWindow.m",
"src/components/OverlayWindow/src/MaterialOverlayWindow.h",
"src/components/Palettes/src/MDCPalettes.h",
"src/components/Palettes/src/MDCPalettes.m",
"src/components/Palettes/src/MaterialPalettes.h",
"src/components/Palettes/src/private/MDCPaletteExpansions.h",
"src/components/Palettes/src/private/MDCPaletteExpansions.m",
"src/components/Palettes/src/private/MDCPaletteNames.h",
"src/components/Palettes/src/private/MDCPaletteNames.m",
"src/components/ProgressView/src/MDCProgressView.h",
"src/components/ProgressView/src/MDCProgressView.m",
"src/components/ProgressView/src/MaterialProgressView.h",
"src/components/ShadowElevations/src/MDCShadowElevations.h",
"src/components/ShadowElevations/src/MDCShadowElevations.m",
"src/components/ShadowElevations/src/MaterialShadowElevations.h",
"src/components/ShadowLayer/src/MDCShadowLayer.h",
"src/components/ShadowLayer/src/MDCShadowLayer.m",
"src/components/ShadowLayer/src/MaterialShadowLayer.h",
"src/components/Snackbar/src/MDCSnackbarManager.h",
"src/components/Snackbar/src/MDCSnackbarManager.m",
"src/components/Snackbar/src/MDCSnackbarMessage.h",
"src/components/Snackbar/src/MDCSnackbarMessage.m",
"src/components/Snackbar/src/MDCSnackbarMessageView.h",
"src/components/Snackbar/src/MDCSnackbarMessageView.m",
"src/components/Snackbar/src/MaterialSnackbar.h",
"src/components/Snackbar/src/private/MDCSnackbarMessageInternal.h",
"src/components/Snackbar/src/private/MDCSnackbarMessageViewInternal.h",
"src/components/Snackbar/src/private/MDCSnackbarOverlayView.h",
"src/components/Snackbar/src/private/MDCSnackbarOverlayView.m",
"src/components/Typography/src/MDCTypography.h",
"src/components/Typography/src/MDCTypography.m",
"src/components/Typography/src/MaterialTypography.h",
"src/components/private/Application/src/MaterialApplication.h",
"src/components/private/Application/src/UIApplication+AppExtensions.h",
"src/components/private/Application/src/UIApplication+AppExtensions.m",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons+ic_arrow_back.h",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons+ic_arrow_back.m",
"src/components/private/Icons/icons/ic_check/src/MaterialIcons+ic_check.h",
"src/components/private/Icons/icons/ic_check/src/MaterialIcons+ic_check.m",
"src/components/private/Icons/icons/ic_check_circle/src/MaterialIcons+ic_check_circle.h",
"src/components/private/Icons/icons/ic_check_circle/src/MaterialIcons+ic_check_circle.m",
"src/components/private/Icons/icons/ic_chevron_right/src/MaterialIcons+ic_chevron_right.h",
"src/components/private/Icons/icons/ic_chevron_right/src/MaterialIcons+ic_chevron_right.m",
"src/components/private/Icons/icons/ic_info/src/MaterialIcons+ic_info.h",
"src/components/private/Icons/icons/ic_info/src/MaterialIcons+ic_info.m",
"src/components/private/Icons/icons/ic_radio_button_unchecked/src/MaterialIcons+ic_radio_button_unchecked.h",
"src/components/private/Icons/icons/ic_radio_button_unchecked/src/MaterialIcons+ic_radio_button_unchecked.m",
"src/components/private/Icons/icons/ic_reorder/src/MaterialIcons+ic_reorder.h",
"src/components/private/Icons/icons/ic_reorder/src/MaterialIcons+ic_reorder.m",
"src/components/private/Icons/src/MDCIcons+BundleLoader.h",
"src/components/private/Icons/src/MDCIcons.h",
"src/components/private/Icons/src/MDCIcons.m",
"src/components/private/Icons/src/MaterialIcons.h",
"src/components/private/KeyboardWatcher/src/MDCKeyboardWatcher.h",
"src/components/private/KeyboardWatcher/src/MDCKeyboardWatcher.m",
"src/components/private/Math/src/MDCMath.h",
"src/components/private/Math/src/MaterialMath.h",
"src/components/private/Overlay/src/MDCOverlayImplementor.h",
"src/components/private/Overlay/src/MDCOverlayObserver.h",
"src/components/private/Overlay/src/MDCOverlayObserver.m",
"src/components/private/Overlay/src/MDCOverlayTransitioning.h",
"src/components/private/Overlay/src/MaterialOverlays.h",
"src/components/private/Overlay/src/private/MDCOverlayAnimationObserver.h",
"src/components/private/Overlay/src/private/MDCOverlayAnimationObserver.m",
"src/components/private/Overlay/src/private/MDCOverlayObserverOverlay.h",
"src/components/private/Overlay/src/private/MDCOverlayObserverOverlay.m",
"src/components/private/Overlay/src/private/MDCOverlayObserverTransition.h",
"src/components/private/Overlay/src/private/MDCOverlayObserverTransition.m",
"src/components/private/Overlay/src/private/MDCOverlayUtilities.h",
"src/components/private/Overlay/src/private/MDCOverlayUtilities.m",
"src/components/private/RTL/src/MDCRTL.h",
"src/components/private/RTL/src/MDCRTL.m",
"src/components/private/RTL/src/MaterialRTL.h",
"src/components/private/RTL/src/UIImage+MaterialRTL.h",
"src/components/private/RTL/src/UIImage+MaterialRTL.m",
"src/components/private/RTL/src/UIView+MaterialRTL.h",
"src/components/private/RTL/src/UIView+MaterialRTL.m",
"src/components/private/ThumbTrack/src/MDCNumericValueLabel.h",
"src/components/private/ThumbTrack/src/MDCNumericValueLabel.m",
"src/components/private/ThumbTrack/src/MDCThumbTrack.h",
"src/components/private/ThumbTrack/src/MDCThumbTrack.m",
"src/components/private/ThumbTrack/src/MDCThumbView.h",
"src/components/private/ThumbTrack/src/MDCThumbView.m",
"src/components/private/ThumbTrack/src/MaterialThumbTrack.h",
]
include_dirs = [
"src/components/ActivityIndicator/src",
"src/components/AnimationTiming/src",
"src/components/AppBar/src",
"src/components/ButtonBar/src",
"src/components/NavigationBar/src",
"src/components/OverlayWindow/src",
"src/components/private/Math/src",
"src/components/private/Application/src",
"src/components/private/Color/src",
"src/components/private/Icons/src",
"src/components/private/Icons/icons/ic_arrow_back/src",
"src/components/private/Icons/icons/ic_check/src",
"src/components/private/Icons/icons/ic_check_circle/src",
"src/components/private/Icons/icons/ic_chevron_right/src",
"src/components/private/Icons/icons/ic_info/src",
"src/components/private/Icons/icons/ic_radio_button_unchecked/src",
"src/components/private/Icons/icons/ic_reorder/src",
"src/components/private/KeyboardWatcher/src",
"src/components/private/Overlay/src",
"src/components/private/RTL/src",
"src/components/private/ThumbTrack/src",
]
libs = [
"CoreGraphics.framework",
"CoreText.framework",
"QuartzCore.framework",
"UIKit.framework",
]
deps = [
":material_collection_cells_bundle",
":material_collections_bundle",
":material_component_ic_arrow_back_bundle",
"//ios/third_party/material_text_accessibility_ios",
]
foreach(icon_name, _icon_names) {
deps += [ ":material_component_${icon_name}_bundle" ]
}
public_configs = [ ":config" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
":config",
"//build/config/compiler:enable_arc",
"//build/config/compiler:no_chromium_code",
]
}
_locales = [ "en" ]
foreach(locale, _locales) {
bundle_data("material_collections_bundle_$locale") {
visibility = [ ":material_collections_bundle" ]
sources = [
"src/components/Collections/src/MaterialCollections.bundle/Resources/$locale.lproj/MaterialCollections.strings",
]
outputs = [
"{{bundle_root_dir}}/MaterialCollections.bundle/Resources/$locale.lproj/{{source_file_part}}",
]
}
bundle_data("material_collection_cells_bundle_$locale") {
visibility = [ ":material_collection_cells_bundle" ]
sources = [
"src/components/CollectionCells/src/MaterialCollectionCells.bundle/Resources/$locale.lproj/MaterialCollectionCells.strings",
]
outputs = [
"{{bundle_resources_dir}}/MaterialCollectionCells.bundle/Resources/$locale.lproj/{{source_file_part}}",
]
}
}
group("material_collections_bundle") {
visibility = [ ":material_components_ios" ]
deps = []
foreach(locale, _locales) {
deps += [ ":material_collections_bundle_$locale" ]
}
}
group("material_collection_cells_bundle") {
visibility = [ ":material_components_ios" ]
deps = []
foreach(locale, _locales) {
deps += [ ":material_collection_cells_bundle_$locale" ]
}
}
# TODO(crbug.com/662421): Move back to _icon_names when there is just one
# resource.
bundle_data("material_component_ic_arrow_back_bundle") {
visibility = [ ":material_components_ios" ]
sources = [
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back.png",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back@2x.png",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back@3x.png",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back_ios.png",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back_ios@2x.png",
"src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow_back.bundle/ic_arrow_back_ios@3x.png",
]
outputs = [
"{{bundle_resources_dir}}/MaterialIcons_ic_arrow_back.bundle/" +
"{{source_file_part}}",
]
}
# Template to declare a bundle_data target to pack an icon bundle.
#
# Arguments:
#
# icon_name:
# string, short name of the icon without .bundle or .png extension.
#
template("material_component_icon_bundle") {
assert(defined(invoker.icon_name) && invoker.icon_name != "",
"icon_name must be defined for $target_name")
_icon_name = invoker.icon_name
_icon_path = "src/components/private/Icons/icons/$_icon_name/src/" +
"MaterialIcons_$_icon_name.bundle/$_icon_name"
bundle_data(target_name) {
forward_variables_from(invoker,
"*",
[
"sources",
"outputs",
"icon_name",
])
sources = [
"$_icon_path.png",
"$_icon_path@2x.png",
"$_icon_path@3x.png",
]
outputs = [
"{{bundle_resources_dir}}/MaterialIcons_$_icon_name.bundle/" +
"{{source_file_part}}",
]
}
}
foreach(icon_name, _icon_names) {
material_component_icon_bundle("material_component_${icon_name}_bundle") {
visibility = [ ":material_components_ios" ]
icon_name = "$icon_name"
}
}