Skip to content

Commit b04d8d8

Browse files
committed
chore: Replace FlexLayoutYoga with facebook/yoga dependency
- Remove custom FlexLayoutYoga implementation - Add facebook/yoga as dependency - Update related configurations
1 parent d382904 commit b04d8d8

File tree

83 files changed

+75
-10356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+75
-10356
lines changed

FlexLayout.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ Pod::Spec.new do |spec|
2222
'-std=c++20',
2323
'-fPIC'
2424
]
25+
26+
spec.dependency 'Yoga'
2527
end

FlexLayout.xcodeproj/project.pbxproj

Lines changed: 45 additions & 328 deletions
Large diffs are not rendered by default.

Package.resolved

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@ import PackageDescription
66
let package = Package(
77
name: "FlexLayout",
88
platforms: [
9-
.iOS(.v12)
9+
.iOS(.v12),
1010
],
1111
products: [
1212
.library(name: "FlexLayout", targets: ["FlexLayout"]),
1313
],
14+
dependencies: [
15+
.package(url: "https://github.com/facebook/yoga.git", from: "3.1.0"),
16+
],
1417
targets: [
1518
.target(
1619
name: "FlexLayout",
1720
dependencies: ["FlexLayoutYogaKit"],
1821
path: "Sources/Swift",
1922
publicHeadersPath: "Public"
2023
),
21-
.target(
22-
name: "FlexLayoutYoga",
23-
dependencies: [],
24-
path: "Sources/yoga",
25-
publicHeadersPath: "include/yoga"
26-
),
2724
.target(
2825
name: "FlexLayoutYogaKit",
29-
dependencies: ["FlexLayoutYoga"],
26+
dependencies: ["yoga"],
3027
path: "Sources/YogaKit",
3128
publicHeadersPath: "include/YogaKit"
3229
),

Sources/Swift/Impl/FlexLayout+Enum.swift

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,65 +14,7 @@
1414

1515
import UIKit
1616

17-
#if SWIFT_PACKAGE
18-
import FlexLayoutYoga
19-
20-
extension YGFlexDirection {
21-
static let column = YGFlexDirectionColumn
22-
static let columnReverse = YGFlexDirectionColumnReverse
23-
static let row = YGFlexDirectionRow
24-
static let rowReverse = YGFlexDirectionRowReverse
25-
}
26-
27-
extension YGJustify {
28-
static let flexStart = YGJustifyFlexStart
29-
static let center = YGJustifyCenter
30-
static let flexEnd = YGJustifyFlexEnd
31-
static let spaceBetween = YGJustifySpaceBetween
32-
static let spaceAround = YGJustifySpaceAround
33-
static let spaceEvenly = YGJustifySpaceEvenly
34-
}
35-
36-
extension YGAlign {
37-
static let auto = YGAlignAuto
38-
static let baseline = YGAlignBaseline
39-
static let stretch = YGAlignStretch
40-
static let flexStart = YGAlignFlexStart
41-
static let center = YGAlignCenter
42-
static let flexEnd = YGAlignFlexEnd
43-
static let spaceBetween = YGAlignSpaceBetween
44-
static let spaceAround = YGAlignSpaceAround
45-
static let spaceEvenly = YGAlignSpaceEvenly
46-
}
47-
48-
extension YGWrap {
49-
static let noWrap = YGWrapNoWrap
50-
static let wrap = YGWrapWrap
51-
static let wrapReverse = YGWrapWrapReverse
52-
}
53-
54-
extension YGPositionType {
55-
static let relative = YGPositionTypeRelative
56-
static let absolute = YGPositionTypeAbsolute
57-
static let `static` = YGPositionTypeStatic
58-
}
59-
60-
extension YGDirection {
61-
static let LTR = YGDirectionLTR
62-
static let RTL = YGDirectionRTL
63-
static let inherit = YGDirectionInherit
64-
}
65-
66-
extension YGDisplay {
67-
static let flex = YGDisplayFlex
68-
static let none = YGDisplayNone
69-
}
70-
71-
extension YGUnit {
72-
static let percent = YGUnitPercent
73-
static let point = YGUnitPoint
74-
}
75-
#endif
17+
import yoga
7618

7719
extension Flex.Direction {
7820
var yogaValue: YGFlexDirection {

Sources/Swift/Impl/FlexLayout+Private.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
import UIKit
1010

11-
#if SWIFT_PACKAGE
12-
import FlexLayoutYoga
13-
#endif
11+
import yoga
1412

1513
extension Flex {
1614
func valueOrUndefined(_ value: CGFloat?) -> YGValue {

Sources/Swift/YGLayoutExtensions.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
import CoreGraphics
99

10-
#if SWIFT_PACKAGE
11-
import FlexLayoutYoga
12-
#endif
10+
import yoga
1311

1412
extension Int {
1513
public static postfix func %(value: Int) -> YGValue {

Sources/YogaKit/include/YogaKit/YGLayout+Private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import "Yoga.h"
8+
#import <yoga/Yoga.h>
99
#import "YGLayout.h"
1010

1111
@interface YGLayout ()

Sources/YogaKit/include/YogaKit/YGLayout.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
#import <UIKit/UIKit.h>
99

10-
#import "YGEnums.h"
11-
#import "YGMacros.h"
12-
#import "Yoga.h"
10+
#import <yoga/YGEnums.h>
11+
#import <yoga/YGMacros.h>
12+
#import <yoga/Yoga.h>
1313

1414
YG_EXTERN_C_BEGIN
1515

0 commit comments

Comments
 (0)