Skip to content

Commit

Permalink
Add Lottie to ios/third_party.
Browse files Browse the repository at this point in the history
Pull the latest Lottie objc branch via DEPS to ios/third_party.
Use the GN file in a similar structure as material_component_ios.
Add `ios_chrome_links_with_lottie_framework`, will be switched to true
after ios_internal is updated with the flag.
Use Lottie.h in code for demo purpose - this part will be removed when
landing the CL.

Change-Id: I0ed9ea9d7dec88fbbf74299f9eaf91ff6f9f1f68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4024225
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Huiting Yu <huitingyu@google.com>
Cr-Commit-Position: refs/heads/main@{#1074665}
  • Loading branch information
Huiting Yu authored and Chromium LUCI CQ committed Nov 22, 2022
1 parent ed03828 commit e5258e9
Show file tree
Hide file tree
Showing 9 changed files with 476 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ vs-chromium-project.txt
/ios/third_party/earl_grey2/src
/ios/third_party/edo/src
/ios/third_party/gtx/src
/ios/third_party/lottie/src
/ios/third_party/material_components_ios/src
/ios/third_party/material_font_disk_loader_ios/src
/ios/third_party/material_internationalization_ios/src
Expand Down
5 changes: 5 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,11 @@ deps = {
'condition': 'checkout_ios',
},

'src/ios/third_party/lottie/src': {
'url': Var('chromium_git') + '/external/github.com/airbnb/lottie-ios.git' + '@' + '4a4367659c0b8576d4a106669ff2ba129026085f',
'condition': 'checkout_ios',
},

'src/ios/third_party/material_components_ios/src': {
'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '515ba2f70ecdeb0f596697f4d8266892a516bb2e',
'condition': 'checkout_ios',
Expand Down
16 changes: 15 additions & 1 deletion ios/chrome/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -602,17 +602,31 @@ source_set("main") {
deps += [ "//ios/chrome/app/startup:sandbox_dump" ]
}

assert_no_deps = []

if (ios_chrome_links_with_material_components_framework) {
deps += [
"//ios/third_party/material_components_ios:material_components_ios+bundle",
"//ios/third_party/material_components_ios:material_components_ios+link",
]
} else {
assert_no_deps = [
assert_no_deps += [
"//ios/third_party/material_components_ios:material_components_ios+bundle",
"//ios/third_party/material_components_ios:material_components_ios+link",
]
}

if (ios_chrome_links_with_lottie_framework) {
deps += [
"//ios/third_party/lottie:lottie+bundle",
"//ios/third_party/lottie:lottie+link",
]
} else {
assert_no_deps += [
"//ios/third_party/lottie:lottie+bundle",
"//ios/third_party/lottie:lottie+link",
]
}
}

source_set("multitasking_test_app_delegate") {
Expand Down
5 changes: 5 additions & 0 deletions ios/chrome/features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ declare_args() {
# MaterialComponents is not build as a framework.
ios_chrome_links_with_material_components_framework = true

# Controls whether Chrome links with Lottie.framework or gets the
# implementation from its downstream provider. Ignored if Lottie is
# not build as a framework.
ios_chrome_links_with_lottie_framework = false

# Enable MetricKit in Chrome to collect runtime data.
ios_enable_metrickit = false

Expand Down
214 changes: 214 additions & 0 deletions ios/third_party/lottie/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
import("//build/config/ios/ios_sdk.gni")
import("//build/config/ios/rules.gni")

_lottie_public_headers = [
# $ cd src/ios/third_party/lottie
# $ find src -path 'src/lottie-ios/Classes/PublicHeaders/*.h' -a \! -path '*Test*'|\sed -e
# 's:\(.*\): "\1",:'|sort -u

"src/lottie-ios/Classes/PublicHeaders/LOTAnimatedControl.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimatedSwitch.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationCache.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationTransitionController.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationView.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationView_Compat.h",
"src/lottie-ios/Classes/PublicHeaders/LOTBlockCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTCacheProvider.h",
"src/lottie-ios/Classes/PublicHeaders/LOTComposition.h",
"src/lottie-ios/Classes/PublicHeaders/LOTInterpolatorCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTKeypath.h",
"src/lottie-ios/Classes/PublicHeaders/LOTValueCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTValueDelegate.h",
"src/lottie-ios/Classes/PublicHeaders/Lottie.h",
]

_lottie_include_dirs = [
# List generated by the following commands:
# $ cd src/ios/third_party/lottie
# $ find src -path 'src/lottie-ios/Classes/**/*.h' -a \! -path '*Test*'|\
# sed -e 's:\(.*\)/[^/]*: "\1",:'|sort -u

"src/lottie-ios/Classes/AnimatableLayers",
"src/lottie-ios/Classes/AnimatableProperties",
"src/lottie-ios/Classes/Extensions",
"src/lottie-ios/Classes/MacCompatibility",
"src/lottie-ios/Classes/Models",
"src/lottie-ios/Classes/Private",
"src/lottie-ios/Classes/PublicHeaders",
"src/lottie-ios/Classes/RenderSystem",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes",
"src/lottie-ios/Classes/RenderSystem/ManipulatorNodes",
"src/lottie-ios/Classes/RenderSystem/RenderNodes",
]

_lottie_sources = [
# List generated by the following commands:
# $ cd src/ios/third_party/material_components_ios
# $ find src -path 'src/lottie-ios/Classes/**/*.[hm]' -a \! -path '*Test*'|\
# sed -e 's:\(.*\): "\1",:'|sort -u

"src/lottie-ios/Classes/AnimatableLayers/LOTCompositionContainer.h",
"src/lottie-ios/Classes/AnimatableLayers/LOTCompositionContainer.m",
"src/lottie-ios/Classes/AnimatableLayers/LOTLayerContainer.h",
"src/lottie-ios/Classes/AnimatableLayers/LOTLayerContainer.m",
"src/lottie-ios/Classes/AnimatableLayers/LOTMaskContainer.h",
"src/lottie-ios/Classes/AnimatableLayers/LOTMaskContainer.m",
"src/lottie-ios/Classes/AnimatableProperties/LOTBezierData.h",
"src/lottie-ios/Classes/AnimatableProperties/LOTBezierData.m",
"src/lottie-ios/Classes/AnimatableProperties/LOTKeyframe.h",
"src/lottie-ios/Classes/AnimatableProperties/LOTKeyframe.m",
"src/lottie-ios/Classes/Extensions/CGGeometry+LOTAdditions.h",
"src/lottie-ios/Classes/Extensions/CGGeometry+LOTAdditions.m",
"src/lottie-ios/Classes/Extensions/LOTBezierPath.h",
"src/lottie-ios/Classes/Extensions/LOTBezierPath.m",
"src/lottie-ios/Classes/Extensions/LOTHelpers.h",
"src/lottie-ios/Classes/Extensions/LOTRadialGradientLayer.h",
"src/lottie-ios/Classes/Extensions/LOTRadialGradientLayer.m",
"src/lottie-ios/Classes/Extensions/UIColor+Expanded.h",
"src/lottie-ios/Classes/Extensions/UIColor+Expanded.m",
"src/lottie-ios/Classes/MacCompatibility/CALayer+Compat.h",
"src/lottie-ios/Classes/MacCompatibility/CALayer+Compat.m",
"src/lottie-ios/Classes/MacCompatibility/LOTPlatformCompat.h",
"src/lottie-ios/Classes/MacCompatibility/NSValue+Compat.h",
"src/lottie-ios/Classes/MacCompatibility/NSValue+Compat.m",
"src/lottie-ios/Classes/MacCompatibility/UIBezierPath.h",
"src/lottie-ios/Classes/MacCompatibility/UIBezierPath.m",
"src/lottie-ios/Classes/MacCompatibility/UIColor.h",
"src/lottie-ios/Classes/MacCompatibility/UIColor.m",
"src/lottie-ios/Classes/Models/LOTAsset.h",
"src/lottie-ios/Classes/Models/LOTAsset.m",
"src/lottie-ios/Classes/Models/LOTAssetGroup.h",
"src/lottie-ios/Classes/Models/LOTAssetGroup.m",
"src/lottie-ios/Classes/Models/LOTLayer.h",
"src/lottie-ios/Classes/Models/LOTLayer.m",
"src/lottie-ios/Classes/Models/LOTLayerGroup.h",
"src/lottie-ios/Classes/Models/LOTLayerGroup.m",
"src/lottie-ios/Classes/Models/LOTMask.h",
"src/lottie-ios/Classes/Models/LOTMask.m",
"src/lottie-ios/Classes/Models/LOTModels.h",
"src/lottie-ios/Classes/Models/LOTShapeCircle.h",
"src/lottie-ios/Classes/Models/LOTShapeCircle.m",
"src/lottie-ios/Classes/Models/LOTShapeFill.h",
"src/lottie-ios/Classes/Models/LOTShapeFill.m",
"src/lottie-ios/Classes/Models/LOTShapeGradientFill.h",
"src/lottie-ios/Classes/Models/LOTShapeGradientFill.m",
"src/lottie-ios/Classes/Models/LOTShapeGroup.h",
"src/lottie-ios/Classes/Models/LOTShapeGroup.m",
"src/lottie-ios/Classes/Models/LOTShapePath.h",
"src/lottie-ios/Classes/Models/LOTShapePath.m",
"src/lottie-ios/Classes/Models/LOTShapeRectangle.h",
"src/lottie-ios/Classes/Models/LOTShapeRectangle.m",
"src/lottie-ios/Classes/Models/LOTShapeRepeater.h",
"src/lottie-ios/Classes/Models/LOTShapeRepeater.m",
"src/lottie-ios/Classes/Models/LOTShapeStar.h",
"src/lottie-ios/Classes/Models/LOTShapeStar.m",
"src/lottie-ios/Classes/Models/LOTShapeStroke.h",
"src/lottie-ios/Classes/Models/LOTShapeStroke.m",
"src/lottie-ios/Classes/Models/LOTShapeTransform.h",
"src/lottie-ios/Classes/Models/LOTShapeTransform.m",
"src/lottie-ios/Classes/Models/LOTShapeTrimPath.h",
"src/lottie-ios/Classes/Models/LOTShapeTrimPath.m",
"src/lottie-ios/Classes/Private/LOTAnimatedControl.m",
"src/lottie-ios/Classes/Private/LOTAnimatedSwitch.m",
"src/lottie-ios/Classes/Private/LOTAnimationCache.m",
"src/lottie-ios/Classes/Private/LOTAnimationTransitionController.m",
"src/lottie-ios/Classes/Private/LOTAnimationView.m",
"src/lottie-ios/Classes/Private/LOTAnimationView_Internal.h",
"src/lottie-ios/Classes/Private/LOTBlockCallback.m",
"src/lottie-ios/Classes/Private/LOTCacheProvider.m",
"src/lottie-ios/Classes/Private/LOTComposition.m",
"src/lottie-ios/Classes/Private/LOTInterpolatorCallback.m",
"src/lottie-ios/Classes/Private/LOTKeypath.m",
"src/lottie-ios/Classes/Private/LOTValueCallback.m",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimatedControl.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimatedSwitch.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationCache.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationTransitionController.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationView.h",
"src/lottie-ios/Classes/PublicHeaders/LOTAnimationView_Compat.h",
"src/lottie-ios/Classes/PublicHeaders/LOTBlockCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTCacheProvider.h",
"src/lottie-ios/Classes/PublicHeaders/LOTComposition.h",
"src/lottie-ios/Classes/PublicHeaders/LOTInterpolatorCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTKeypath.h",
"src/lottie-ios/Classes/PublicHeaders/LOTValueCallback.h",
"src/lottie-ios/Classes/PublicHeaders/LOTValueDelegate.h",
"src/lottie-ios/Classes/PublicHeaders/Lottie.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTCircleAnimator.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTCircleAnimator.m",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPathAnimator.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPathAnimator.m",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolygonAnimator.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolygonAnimator.m",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolystarAnimator.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolystarAnimator.m",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTRoundedRectAnimator.h",
"src/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTRoundedRectAnimator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTArrayInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTArrayInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTColorInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTColorInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTNumberInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTNumberInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPathInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPathInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPointInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPointInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTTransformInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTTransformInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTValueInterpolator.h",
"src/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTValueInterpolator.m",
"src/lottie-ios/Classes/RenderSystem/LOTAnimatorNode.h",
"src/lottie-ios/Classes/RenderSystem/LOTAnimatorNode.m",
"src/lottie-ios/Classes/RenderSystem/LOTRenderNode.h",
"src/lottie-ios/Classes/RenderSystem/LOTRenderNode.m",
"src/lottie-ios/Classes/RenderSystem/ManipulatorNodes/LOTTrimPathNode.h",
"src/lottie-ios/Classes/RenderSystem/ManipulatorNodes/LOTTrimPathNode.m",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTFillRenderer.h",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTFillRenderer.m",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTGradientFillRender.h",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTGradientFillRender.m",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRenderGroup.h",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRenderGroup.m",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRepeaterRenderer.h",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRepeaterRenderer.m",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTStrokeRenderer.h",
"src/lottie-ios/Classes/RenderSystem/RenderNodes/LOTStrokeRenderer.m",
]

config("config") {
visibility = [ ":*" ]
include_dirs = _lottie_include_dirs
}

ios_framework_bundle("lottie") {
sources = _lottie_sources

info_plist = "Info.plist"
output_name = "Lottie"
public_headers = _lottie_public_headers

frameworks = [
"CoreGraphics.framework",
"Foundation.framework",
"CoreFoundation.framework",
"UIKit.framework",
"QuartzCore.framework",
"CoreVideo.framework",
"GLKit.framework",
]

configs -= [
"//build/config/compiler:chromium_code",
"//build/config/gcc:symbol_visibility_hidden",
]
configs += [
":config",
"//build/config/compiler:enable_arc",
"//build/config/compiler:no_chromium_code",
"//build/config/gcc:symbol_visibility_default",
]
}
20 changes: 20 additions & 0 deletions ios/third_party/lottie/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIdentifier</key>
<string>${BUNDLE_IDENTIFIER}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
</dict>
</plist>
Loading

0 comments on commit e5258e9

Please sign in to comment.