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
31 changes: 17 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,20 @@ 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: "600.0.0"),
],
targets: [
.target(
name: "QuickLayout",
dependencies: [
"QuickLayoutMacro",
"QuickLayoutBridge",
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS])),
],
path: "Sources/QuickLayout/QuickLayout",
exclude: [
Expand All @@ -55,11 +47,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 +62,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
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/

import QuickLayoutMacro
import SwiftSyntaxMacros
import SwiftSyntaxMacrosTestSupport
import XCTest
#if canImport(QuickLayoutMacro)
@testable import QuickLayoutMacro

// patternlint-disable meta-subclass-view

Expand Down Expand Up @@ -476,3 +477,4 @@ class QuickLayoutTests: XCTestCase {
)
}
}
#endif