Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build-and-test:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: '6.0'

- name: Build
run: swift build --build-tests

- name: Run tests
run: swift test
32 changes: 18 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,21 @@ let package = Package(
name: "QuickLayout",
targets: ["QuickLayout"]
),
.library(
name: "QuickLayoutCore",
targets: ["QuickLayoutCore"]
),
.library(
name: "FastResultBuilder",
targets: ["FastResultBuilder"]
),
.library(
name: "QuickLayoutBridge",
targets: ["QuickLayoutBridge"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0")
.package(url: "https://github.com/apple/swift-syntax.git", from: "602.0.0"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version was dropped from 600 to 602 in the pervious pull request https://github.com/facebookincubator/QuickLayout/pull/3/files from @JonyFang.
What features do you need from 602 to support for this pull request?

.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", from: "0.6.4"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this package for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a third-party tool to simplify Macro testing. While the library looks interesting and perhaps helpful, it's a third-party dependency which we might not have at Meta. Until, there are heavy reasons, I would prefer QuickLayout stick to vanilla Apple frameworks. Could you please remove it? Thank you.

],
targets: [
.target(
name: "QuickLayout",
dependencies: [
"QuickLayoutMacro",
"QuickLayoutBridge",
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS])),
],
path: "Sources/QuickLayout/QuickLayout",
exclude: [
Expand All @@ -55,11 +48,11 @@ let package = Package(
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
],
path: "Sources/QuickLayout/QuickLayoutMacro",
path: "Sources/QuickLayout/QuickLayoutMacro"
),
.target(
name: "QuickLayoutCore",
path: "Sources/QuickLayout/QuickLayoutCore",
path: "Sources/QuickLayout/QuickLayoutCore"
),
.target(
name: "FastResultBuilder",
Expand All @@ -70,12 +63,23 @@ let package = Package(
),
.target(
name: "QuickLayoutBridge",
dependencies: ["FastResultBuilder", "QuickLayoutCore"],
dependencies: [
"FastResultBuilder",
.target(name: "QuickLayoutCore", condition: .when(platforms: [.iOS])),
],
path: "Sources/QuickLayout/QuickLayoutBridge",
exclude: [
"__server_snapshot_tests__",
"__tests__",
]
),
],
.testTarget(
name: "QuickLayoutMacroTests",
dependencies: [
"QuickLayoutMacro",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
],
path: "Sources/QuickLayout/QuickLayoutMacroTests"
)
]
)
2 changes: 2 additions & 0 deletions Sources/QuickLayout/QuickLayout/QuickLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

#if canImport(QuickLayoutBridge)
@_exported import QuickLayoutBridge
#endif