Skip to content
Merged
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
79 changes: 79 additions & 0 deletions Package@swift-5.10.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// swift-tools-version:5.10

import PackageDescription

let packageName = "Layout"

enum SwiftLint {
static let plugin = "SwiftLintPlugin-\(packageName)"
static let binary = "SwiftLintBinary-\(packageName)"
}

let package = Package(
name: packageName,
platforms: [
.iOS(.v13),
],
products: [
.library(
name: "Layout",
targets: ["Layout"]),
],
dependencies: [
.package(
url: "https://github.com/Quick/Nimble.git",
from: "13.0.0"),
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
from: "1.15.0"),
],
targets: [
.target(
name: "Layout",
swiftSettings: .swiftSettings,
plugins: [
.plugin(name: SwiftLint.plugin),
]),
.testTarget(
name: "LayoutTests",
dependencies: [
"Layout",
"Nimble",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
exclude: [
"__Snapshots__",
"UIKit/__Snapshots__",
],
swiftSettings: .swiftSettings,
plugins: [
.plugin(name: SwiftLint.plugin),
]),
.plugin(
name: "SwiftLintCommand",
capability: .command(intent: .custom(verb: "swiftlint", description: "SwiftLint Command Plugin")),
dependencies: [
.target(name: SwiftLint.binary)
]),
.plugin(
name: SwiftLint.plugin,
capability: .buildTool(),
dependencies: [
.target(name: SwiftLint.binary)
],
path: "Plugins/SwiftLintPlugin"),
.binaryTarget(
name: SwiftLint.binary,
url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"),
]
)

extension Array where Element == SwiftSetting {

static var swiftSettings: [SwiftSetting] {
[
.enableExperimentalFeature("StrictConcurrency"),
]
}
}
2 changes: 2 additions & 0 deletions Sources/Layout/LayoutItem/LayoutItems/ViewLayoutItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import UIKit

@preconcurrency
@MainActor
internal final class ViewLayoutItem: LayoutItem {

// MARK: - LayoutBoundary
Expand Down
2 changes: 1 addition & 1 deletion Tests/LayoutTests/Builders/ConstraintsBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import Layout
import Nimble
import XCTest

@MainActor
final class ConstraintsBuilderTests: XCTestCase {

@MainActor
func testConstraintsBuilder() {

// GIVEN
Expand Down
2 changes: 1 addition & 1 deletion Tests/LayoutTests/Builders/LayoutBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import Layout
import Nimble
import XCTest

@MainActor
final class LayoutBuilderTests: XCTestCase {

@MainActor
func testLayoutBuilder() {

// GIVEN
Expand Down
10 changes: 9 additions & 1 deletion Tests/LayoutTests/LayoutExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import Nimble
import XCTest

@MainActor
final class LayoutExampleTests: XCTestCase {

// MARK: - Readme

@MainActor
func testReadmeExample() {

// GIVEN
Expand Down Expand Up @@ -81,6 +81,7 @@ final class LayoutExampleTests: XCTestCase {

// MARK: - Layout

@MainActor
func testLayoutDocumentationExample() {

// GIVEN
Expand All @@ -94,6 +95,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testLayoutBuilderDocumentationExample() {

// GIVEN
Expand All @@ -115,6 +117,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testHorizontallyCenteringDocumentationExample() {

// GIVEN
Expand Down Expand Up @@ -142,6 +145,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testVerticallyCenteringDocumentationExample() {

// GIVEN
Expand Down Expand Up @@ -171,6 +175,7 @@ final class LayoutExampleTests: XCTestCase {

// MARK: - LayoutItem

@MainActor
func testSingleLayoutItemDocumentationExample() {

// GIVEN
Expand All @@ -185,6 +190,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testMultipleLayoutItemsDocumentationExample() {

// GIVEN
Expand All @@ -201,6 +207,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testHorizontallyCenteringLayoutItemDocumentationExample() {

// GIVEN
Expand Down Expand Up @@ -228,6 +235,7 @@ final class LayoutExampleTests: XCTestCase {
}
}

@MainActor
func testVerticallyCenteringLayoutItemDocumentationExample() {

// GIVEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import Layout
import Nimble
import XCTest

@MainActor
final class UIViewLayoutItemTests: XCTestCase {

@MainActor
func testLayoutItemView() {

// GIVEN
Expand All @@ -26,6 +26,7 @@ final class UIViewLayoutItemTests: XCTestCase {
expect(view.layoutItemView) === view
}

@MainActor
func testSuperviewConstraints() {

// GIVEN
Expand All @@ -37,6 +38,7 @@ final class UIViewLayoutItemTests: XCTestCase {
expect(view.superviewConstraints(view)).to(beEmpty())
}

@MainActor
func testLayoutBoundary() {

// GIVEN
Expand All @@ -57,6 +59,7 @@ final class UIViewLayoutItemTests: XCTestCase {
expect(boundary.bottom) == view.bottomAnchor
}

@MainActor
func testLayoutCenter() {

// GIVEN
Expand All @@ -73,6 +76,7 @@ final class UIViewLayoutItemTests: XCTestCase {
expect(center.centerY) == view.centerYAnchor
}

@MainActor
func testLayoutSize() {

// GIVEN
Expand All @@ -89,6 +93,7 @@ final class UIViewLayoutItemTests: XCTestCase {
expect(size.height) == view.heightAnchor
}

@MainActor
func testLayoutBaseline() {

// GIVEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import Nimble
import XCTest

@MainActor
final class ViewLayoutItemTests: XCTestCase {

@MainActor
func testInitLayoutItemViewSuperviewConstraints() {

// GIVEN
Expand Down Expand Up @@ -43,6 +43,7 @@ final class ViewLayoutItemTests: XCTestCase {
expect(layoutItems === [viewLayoutItem]) == true
}

@MainActor
func testLayoutBoundary() {

// GIVEN
Expand All @@ -63,6 +64,7 @@ final class ViewLayoutItemTests: XCTestCase {
expect(boundary.bottom) == view.bottom
}

@MainActor
func testLayoutCenter() {

// GIVEN
Expand All @@ -79,6 +81,7 @@ final class ViewLayoutItemTests: XCTestCase {
expect(center.centerY) == view.centerY
}

@MainActor
func testLayoutSize() {

// GIVEN
Expand All @@ -95,6 +98,7 @@ final class ViewLayoutItemTests: XCTestCase {
expect(size.height) == view.height
}

@MainActor
func testLayoutBaseline() {

// GIVEN
Expand Down
Loading