Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: ios/third_party/material_components_ios/BUILD.gn

Issue 2579003003: Add Material Components iOS as a dependency. (Closed)
Patch Set: Revert hitting github Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/locales.gni")
6
7 config("config") {
8 visibility = [ ":material_components_ios" ]
9 include_dirs = [
10 "src/components/AppBar/src",
11 "src/components/ActivityIndicator/src",
12 "src/components/ButtonBar/src",
13 "src/components/Buttons/src",
14 "src/components/CollectionCells/src",
15 "src/components/CollectionLayoutAttributes/src",
16 "src/components/Collections/src",
17 "src/components/Dialogs/src",
18 "src/components/FlexibleHeader/src",
19 "src/components/FontDiskLoader/src",
20 "src/components/HeaderStackView/src",
21 "src/components/Ink/src",
22 "src/components/NavigationBar/src",
23 "src/components/OverlayWindow/src",
24 "src/components/Palettes/src",
25 "src/components/ProgressView/src",
26 "src/components/RobotoFontLoader/src",
27 "src/components/ShadowElevations/src",
28 "src/components/ShadowLayer/src",
29 "src/components/Snackbar/src",
30 "src/components/SpritedAnimationView/src",
31 "src/components/Typography/src",
32 ]
33
34 cflags_objc = [
35 # Do not consider use of deprecated API as errors when building third-party
36 # libraries.
37 "-Wno-error=deprecated-declarations",
Nico 2017/05/11 16:38:12 This does not lgtm. We want a silent build, so tha
38 ]
39 }
40
41 _icon_names = [
42 "ic_check",
43 "ic_check_circle",
44 "ic_chevron_right",
45 "ic_info",
46 "ic_radio_button_unchecked",
47 "ic_reorder",
48 ]
49
50 source_set("material_components_ios") {
51 sources = [
52 "src/components/ActivityIndicator/src/MDCActivityIndicator.h",
53 "src/components/ActivityIndicator/src/MDCActivityIndicator.m",
54 "src/components/ActivityIndicator/src/MaterialActivityIndicator.h",
55 "src/components/AnimationTiming/src/CAMediaTimingFunction+MDCAnimationTiming .h",
56 "src/components/AnimationTiming/src/CAMediaTimingFunction+MDCAnimationTiming .m",
57 "src/components/AppBar/src/MDCAppBar.h",
58 "src/components/AppBar/src/MDCAppBar.m",
59 "src/components/AppBar/src/MDCAppBarContainerViewController.h",
60 "src/components/AppBar/src/MDCAppBarContainerViewController.m",
61 "src/components/AppBar/src/MaterialAppBar.h",
62 "src/components/ButtonBar/src/MDCButtonBar.h",
63 "src/components/ButtonBar/src/MDCButtonBar.m",
64 "src/components/ButtonBar/src/MaterialButtonBar.h",
65 "src/components/ButtonBar/src/private/MDCAppBarButtonBarBuilder.h",
66 "src/components/ButtonBar/src/private/MDCAppBarButtonBarBuilder.m",
67 "src/components/Buttons/src/MDCButton.h",
68 "src/components/Buttons/src/MDCButton.m",
69 "src/components/Buttons/src/MDCFlatButton.h",
70 "src/components/Buttons/src/MDCFlatButton.m",
71 "src/components/Buttons/src/MDCFloatingButton.h",
72 "src/components/Buttons/src/MDCFloatingButton.m",
73 "src/components/Buttons/src/MDCRaisedButton.h",
74 "src/components/Buttons/src/MDCRaisedButton.m",
75 "src/components/Buttons/src/MaterialButtons.h",
76 "src/components/Buttons/src/private/MDCButton+Subclassing.h",
77 "src/components/CollectionCells/src/MDCCollectionViewCell+Ink.h",
78 "src/components/CollectionCells/src/MDCCollectionViewCell+Ink.m",
79 "src/components/CollectionCells/src/MDCCollectionViewCell.h",
80 "src/components/CollectionCells/src/MDCCollectionViewCell.m",
81 "src/components/CollectionCells/src/MDCCollectionViewTextCell.h",
82 "src/components/CollectionCells/src/MDCCollectionViewTextCell.m",
83 "src/components/CollectionCells/src/MaterialCollectionCells.h",
84 "src/components/CollectionLayoutAttributes/src/MDCCollectionViewLayoutAttrib utes.h",
85 "src/components/CollectionLayoutAttributes/src/MDCCollectionViewLayoutAttrib utes.m",
86 "src/components/CollectionLayoutAttributes/src/MaterialCollectionLayoutAttri butes.h",
87 "src/components/Collections/src/MDCCollectionViewController.h",
88 "src/components/Collections/src/MDCCollectionViewController.m",
89 "src/components/Collections/src/MDCCollectionViewEditing.h",
90 "src/components/Collections/src/MDCCollectionViewEditingDelegate.h",
91 "src/components/Collections/src/MDCCollectionViewFlowLayout.h",
92 "src/components/Collections/src/MDCCollectionViewFlowLayout.m",
93 "src/components/Collections/src/MDCCollectionViewStyling.h",
94 "src/components/Collections/src/MDCCollectionViewStylingDelegate.h",
95 "src/components/Collections/src/MaterialCollections.h",
96 "src/components/Collections/src/private/MDCCollectionGridBackgroundView.h",
97 "src/components/Collections/src/private/MDCCollectionGridBackgroundView.m",
98 "src/components/Collections/src/private/MDCCollectionInfoBarView.h",
99 "src/components/Collections/src/private/MDCCollectionInfoBarView.m",
100 "src/components/Collections/src/private/MDCCollectionStringResources.h",
101 "src/components/Collections/src/private/MDCCollectionStringResources.m",
102 "src/components/Collections/src/private/MDCCollectionViewEditor.h",
103 "src/components/Collections/src/private/MDCCollectionViewEditor.m",
104 "src/components/Collections/src/private/MDCCollectionViewStyler.h",
105 "src/components/Collections/src/private/MDCCollectionViewStyler.m",
106 "src/components/Collections/src/private/MaterialCollectionsStrings.h",
107 "src/components/Collections/src/private/MaterialCollectionsStrings_table.h",
108 "src/components/Dialogs/src/MDCAlertController.h",
109 "src/components/Dialogs/src/MDCAlertController.m",
110 "src/components/Dialogs/src/MDCDialogPresentationController.h",
111 "src/components/Dialogs/src/MDCDialogPresentationController.m",
112 "src/components/Dialogs/src/MDCDialogTransitionController.h",
113 "src/components/Dialogs/src/MDCDialogTransitionController.m",
114 "src/components/Dialogs/src/MaterialDialogs.h",
115 "src/components/Dialogs/src/private/MDCDialogShadowedView.h",
116 "src/components/Dialogs/src/private/MDCDialogShadowedView.m",
117 "src/components/FlexibleHeader/src/MDCFlexibleHeaderContainerViewController. h",
118 "src/components/FlexibleHeader/src/MDCFlexibleHeaderContainerViewController. m",
119 "src/components/FlexibleHeader/src/MDCFlexibleHeaderView.h",
120 "src/components/FlexibleHeader/src/MDCFlexibleHeaderView.m",
121 "src/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.h",
122 "src/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m",
123 "src/components/FlexibleHeader/src/MaterialFlexibleHeader.h",
124 "src/components/FlexibleHeader/src/private/MDCStatusBarShifter.h",
125 "src/components/FlexibleHeader/src/private/MDCStatusBarShifter.m",
126 "src/components/FontDiskLoader/src/MDCFontDiskLoader.h",
127 "src/components/FontDiskLoader/src/MDCFontDiskLoader.m",
128 "src/components/FontDiskLoader/src/MaterialFontDiskLoader.h",
129 "src/components/HeaderStackView/src/MDCHeaderStackView.h",
130 "src/components/HeaderStackView/src/MDCHeaderStackView.m",
131 "src/components/HeaderStackView/src/MaterialHeaderStackView.h",
132 "src/components/Ink/src/MDCInkGestureRecognizer.h",
133 "src/components/Ink/src/MDCInkGestureRecognizer.m",
134 "src/components/Ink/src/MDCInkTouchController.h",
135 "src/components/Ink/src/MDCInkTouchController.m",
136 "src/components/Ink/src/MDCInkView.h",
137 "src/components/Ink/src/MDCInkView.m",
138 "src/components/Ink/src/MaterialInk.h",
139 "src/components/Ink/src/private/MDCInkLayer.h",
140 "src/components/Ink/src/private/MDCInkLayer.m",
141 "src/components/NavigationBar/src/MDCNavigationBar.h",
142 "src/components/NavigationBar/src/MDCNavigationBar.m",
143 "src/components/NavigationBar/src/MaterialNavigationBar.h",
144 "src/components/OverlayWindow/src/MDCOverlayWindow.h",
145 "src/components/OverlayWindow/src/MDCOverlayWindow.m",
146 "src/components/OverlayWindow/src/MaterialOverlayWindow.h",
147 "src/components/Palettes/src/MDCPalettes.h",
148 "src/components/Palettes/src/MDCPalettes.m",
149 "src/components/Palettes/src/MaterialPalettes.h",
150 "src/components/Palettes/src/private/MDCPaletteExpansions.h",
151 "src/components/Palettes/src/private/MDCPaletteExpansions.m",
152 "src/components/Palettes/src/private/MDCPaletteNames.h",
153 "src/components/Palettes/src/private/MDCPaletteNames.m",
154 "src/components/ProgressView/src/MDCProgressView.h",
155 "src/components/ProgressView/src/MDCProgressView.m",
156 "src/components/ProgressView/src/MaterialProgressView.h",
157 "src/components/RobotoFontLoader/src/MDCRobotoFontLoader.h",
158 "src/components/RobotoFontLoader/src/MDCRobotoFontLoader.m",
159 "src/components/RobotoFontLoader/src/MaterialRobotoFontLoader.h",
160 "src/components/RobotoFontLoader/src/private/MDCRoboto+Constants.h",
161 "src/components/RobotoFontLoader/src/private/MDCRoboto+Constants.m",
162 "src/components/ShadowElevations/src/MDCShadowElevations.h",
163 "src/components/ShadowElevations/src/MDCShadowElevations.m",
164 "src/components/ShadowElevations/src/MaterialShadowElevations.h",
165 "src/components/ShadowLayer/src/MDCShadowLayer.h",
166 "src/components/ShadowLayer/src/MDCShadowLayer.m",
167 "src/components/ShadowLayer/src/MaterialShadowLayer.h",
168 "src/components/Snackbar/src/MDCSnackbarManager.h",
169 "src/components/Snackbar/src/MDCSnackbarManager.m",
170 "src/components/Snackbar/src/MDCSnackbarMessage.h",
171 "src/components/Snackbar/src/MDCSnackbarMessage.m",
172 "src/components/Snackbar/src/MaterialSnackbar.h",
173 "src/components/Snackbar/src/private/MDCSnackbarMessageInternal.h",
174 "src/components/Snackbar/src/private/MDCSnackbarMessageView.h",
175 "src/components/Snackbar/src/private/MDCSnackbarMessageView.m",
176 "src/components/Snackbar/src/private/MDCSnackbarOverlayView.h",
177 "src/components/Snackbar/src/private/MDCSnackbarOverlayView.m",
178 "src/components/SpritedAnimationView/src/MDCSpritedAnimationView.h",
179 "src/components/SpritedAnimationView/src/MDCSpritedAnimationView.m",
180 "src/components/SpritedAnimationView/src/MaterialSpritedAnimationView.h",
181 "src/components/Typography/src/MDCTypography.h",
182 "src/components/Typography/src/MDCTypography.m",
183 "src/components/Typography/src/MaterialTypography.h",
184 "src/components/private/Application/src/MaterialApplication.h",
185 "src/components/private/Application/src/UIApplication+AppExtensions.h",
186 "src/components/private/Application/src/UIApplication+AppExtensions.m",
187 "src/components/private/Color/src/MaterialColor.h",
188 "src/components/private/Color/src/UIColor+MDC.h",
189 "src/components/private/Color/src/UIColor+MDC.m",
190 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons+ic_arrow _back.h",
191 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons+ic_arrow _back.m",
192 "src/components/private/Icons/icons/ic_check/src/MaterialIcons+ic_check.h",
193 "src/components/private/Icons/icons/ic_check/src/MaterialIcons+ic_check.m",
194 "src/components/private/Icons/icons/ic_check_circle/src/MaterialIcons+ic_che ck_circle.h",
195 "src/components/private/Icons/icons/ic_check_circle/src/MaterialIcons+ic_che ck_circle.m",
196 "src/components/private/Icons/icons/ic_chevron_right/src/MaterialIcons+ic_ch evron_right.h",
197 "src/components/private/Icons/icons/ic_chevron_right/src/MaterialIcons+ic_ch evron_right.m",
198 "src/components/private/Icons/icons/ic_info/src/MaterialIcons+ic_info.h",
199 "src/components/private/Icons/icons/ic_info/src/MaterialIcons+ic_info.m",
200 "src/components/private/Icons/icons/ic_radio_button_unchecked/src/MaterialIc ons+ic_radio_button_unchecked.h",
201 "src/components/private/Icons/icons/ic_radio_button_unchecked/src/MaterialIc ons+ic_radio_button_unchecked.m",
202 "src/components/private/Icons/icons/ic_reorder/src/MaterialIcons+ic_reorder. h",
203 "src/components/private/Icons/icons/ic_reorder/src/MaterialIcons+ic_reorder. m",
204 "src/components/private/Icons/src/MDCIcons+BundleLoader.h",
205 "src/components/private/Icons/src/MDCIcons.h",
206 "src/components/private/Icons/src/MDCIcons.m",
207 "src/components/private/Icons/src/MaterialIcons.h",
208 "src/components/private/KeyboardWatcher/src/MDCKeyboardWatcher.h",
209 "src/components/private/KeyboardWatcher/src/MDCKeyboardWatcher.m",
210 "src/components/private/Overlay/src/MDCOverlayImplementor.h",
211 "src/components/private/Overlay/src/MDCOverlayObserver.h",
212 "src/components/private/Overlay/src/MDCOverlayObserver.m",
213 "src/components/private/Overlay/src/MDCOverlayTransitioning.h",
214 "src/components/private/Overlay/src/MaterialOverlays.h",
215 "src/components/private/Overlay/src/private/MDCOverlayAnimationObserver.h",
216 "src/components/private/Overlay/src/private/MDCOverlayAnimationObserver.m",
217 "src/components/private/Overlay/src/private/MDCOverlayObserverOverlay.h",
218 "src/components/private/Overlay/src/private/MDCOverlayObserverOverlay.m",
219 "src/components/private/Overlay/src/private/MDCOverlayObserverTransition.h",
220 "src/components/private/Overlay/src/private/MDCOverlayObserverTransition.m",
221 "src/components/private/Overlay/src/private/MDCOverlayUtilities.h",
222 "src/components/private/Overlay/src/private/MDCOverlayUtilities.m",
223 "src/components/private/RTL/src/MDCRTL.h",
224 "src/components/private/RTL/src/MDCRTL.m",
225 "src/components/private/RTL/src/MaterialRTL.h",
226 "src/components/private/RTL/src/UIImage+MaterialRTL.h",
227 "src/components/private/RTL/src/UIImage+MaterialRTL.m",
228 "src/components/private/RTL/src/UIView+MaterialRTL.h",
229 "src/components/private/RTL/src/UIView+MaterialRTL.m",
230 "src/components/private/ThumbTrack/src/MDCNumericValueLabel.h",
231 "src/components/private/ThumbTrack/src/MDCNumericValueLabel.m",
232 "src/components/private/ThumbTrack/src/MDCThumbTrack.h",
233 "src/components/private/ThumbTrack/src/MDCThumbTrack.m",
234 "src/components/private/ThumbTrack/src/MDCThumbView.h",
235 "src/components/private/ThumbTrack/src/MDCThumbView.m",
236 "src/components/private/ThumbTrack/src/MaterialThumbTrack.h",
237 ]
238 include_dirs = [
239 "src/components/ActivityIndicator/src",
240 "src/components/AnimationTiming/src",
241 "src/components/AppBar/src",
242 "src/components/ButtonBar/src",
243 "src/components/NavigationBar/src",
244 "src/components/OverlayWindow/src",
245 "src/components/private/Application/src",
246 "src/components/private/Color/src",
247 "src/components/private/Icons/src",
248 "src/components/private/Icons/icons/ic_arrow_back/src",
249 "src/components/private/Icons/icons/ic_check/src",
250 "src/components/private/Icons/icons/ic_check_circle/src",
251 "src/components/private/Icons/icons/ic_chevron_right/src",
252 "src/components/private/Icons/icons/ic_info/src",
253 "src/components/private/Icons/icons/ic_radio_button_unchecked/src",
254 "src/components/private/Icons/icons/ic_reorder/src",
255 "src/components/private/KeyboardWatcher/src",
256 "src/components/private/Overlay/src",
257 "src/components/private/RTL/src",
258 "src/components/private/ThumbTrack/src",
259 ]
260
261 libs = [
262 "CoreGraphics.framework",
263 "CoreText.framework",
264 "QuartzCore.framework",
265 "UIKit.framework",
266 ]
267
268 deps = [
269 ":material_collections_bundle",
270 ":material_component_ic_arrow_back_bundle",
271
272 # TODO(crbug.com/673904): remove when the migration to MDFRobotoFontLoader
273 # is complete.
274 "//ios/third_party/material_roboto_font_loader_ios",
275 "//ios/third_party/material_text_accessibility_ios",
276 ]
277
278 foreach(icon_name, _icon_names) {
279 deps += [ ":material_component_${icon_name}_bundle" ]
280 }
281
282 public_configs = [ ":config" ]
283
284 configs -= [ "//build/config/compiler:chromium_code" ]
285 configs += [
286 ":config",
287 "//build/config/compiler:enable_arc",
288 "//build/config/compiler:no_chromium_code",
289 ]
290 }
291
292 bundle_data("material_collections_bundle") {
293 visibility = [ ":material_components_ios" ]
294 sources = [
295 "src/components/Collections/src/MaterialCollections.bundle/Resources/en.lpro j/MaterialCollections.strings",
296 ]
297 outputs = [
298 "{{bundle_root_dir}}/MaterialCollections.bundle/Resources/en.lproj/{{source_ file_part}}",
299 ]
300 }
301
302 # TODO(crbug.com/662421): Move back to _icon_names when there is just one
303 # resource.
304 bundle_data("material_component_ic_arrow_back_bundle") {
305 visibility = [ ":material_components_ios" ]
306 sources = [
307 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back.png",
308 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back@2x.png",
309 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back@3x.png",
310 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back_ios.png",
311 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back_ios@2x.png",
312 "src/components/private/Icons/icons/ic_arrow_back/src/MaterialIcons_ic_arrow _back.bundle/ic_arrow_back_ios@3x.png",
313 ]
314 outputs = [
315 "{{bundle_resources_dir}}/MaterialIcons_ic_arrow_back.bundle/" +
316 "{{source_file_part}}",
317 ]
318 }
319
320 # Template to declare a bundle_data target to pack an icon bundle.
321 #
322 # Arguments:
323 #
324 # icon_name:
325 # string, short name of the icon without .bundle or .png extension.
326 #
327 template("material_component_icon_bundle") {
328 assert(defined(invoker.icon_name) && invoker.icon_name != "",
329 "icon_name must be defined for $target_name")
330
331 _icon_name = invoker.icon_name
332 _icon_path = "src/components/private/Icons/icons/$_icon_name/src/" +
333 "MaterialIcons_$_icon_name.bundle/$_icon_name"
334
335 bundle_data(target_name) {
336 forward_variables_from(invoker,
337 "*",
338 [
339 "sources",
340 "outputs",
341 "icon_name",
342 ])
343 sources = [
344 "$_icon_path.png",
345 "$_icon_path@2x.png",
346 "$_icon_path@3x.png",
347 ]
348 outputs = [
349 "{{bundle_resources_dir}}/MaterialIcons_$_icon_name.bundle/" +
350 "{{source_file_part}}",
351 ]
352 }
353 }
354
355 foreach(icon_name, _icon_names) {
356 material_component_icon_bundle("material_component_${icon_name}_bundle") {
357 visibility = [ ":material_components_ios" ]
358 icon_name = "$icon_name"
359 }
360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698