Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename targets, add actions #2

Merged
merged 2 commits into from
Feb 28, 2024
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
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Run SwiftLint"
run-name: Linting
on:
pull_request:
paths:
- '.github/workflows/swiftlint.yml'
- '.swiftlint.yml'
- '**/*.swift'
jobs:
SwiftLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Run Tests"
run-name: Testing
on: [pull_request]
jobs:
Test:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Test StreamDeckKitMacros
run: set -o pipefail && xcodebuild -scheme StreamDeckKitMacros test -destination "platform=iOS Simulator,name=iPhone 15,OS=latest" -skipMacroValidation | xcpretty
7 changes: 7 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
opt_in_rules:
- overridden_super_call

disabled_rules:
- identifier_name

line_length: 150
16 changes: 8 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ let package = Package(
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)],
products: [
.library(
name: "StreamDeckKitMacros",
targets: ["StreamDeckKitMacros"]
name: "StreamDeckView",
targets: ["StreamDeckView"]
)
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0")
],
targets: [
.macro(
name: "StreamDeckView",
name: "StreamDeckKitMacros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.target(name: "StreamDeckKitMacros", dependencies: ["StreamDeckView"]),
.target(name: "StreamDeckView", dependencies: ["StreamDeckKitMacros"]),
.testTarget(
name: "StreamDeckKitMacrosTests",
dependencies: [
"StreamDeckView",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
"StreamDeckKitMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
]
),
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ public protocol StreamDeckView: View {
/// ```
@attached(extension, conformances: StreamDeckView)
@attached(member, names: named(_$streamDeckViewContext), named(body), named(streamDeck), named(viewSize), named(viewIndex))
public macro StreamDeckView() = #externalMacro(module: "StreamDeckView", type: "StreamDeckViewMacro")
public macro StreamDeckView() = #externalMacro(module: "StreamDeckKitMacros", type: "StreamDeckViewMacro")