Skip to content

Commit

Permalink
Macros package dependency fix (#108)
Browse files Browse the repository at this point in the history
* rearranged local macro package

* updated dependency config for macro

* fixed import in test
  • Loading branch information
KazaiMazai authored Sep 10, 2024
1 parent 2ad384a commit ae4a8e0
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 112 deletions.
9 changes: 3 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@ let package = Package(
targets: ["Puredux"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
.package(name: "PureduxMacros", path: "Packages/PureduxMacros")
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0")
],
targets: [
.macro(
name: "PureduxMacrosPlugin",
name: "PureduxMacros",
dependencies: [
"PureduxMacros",
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.target(
name: "Puredux",
dependencies: [
"PureduxMacros",
"PureduxMacrosPlugin"
"PureduxMacros"
]
),
.testTarget(
Expand Down
8 changes: 0 additions & 8 deletions Packages/PureduxMacros/.gitignore

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions Packages/PureduxMacros/Package.swift

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/Puredux/PureduxMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import PureduxMacros
@attached(peer, names: arbitrary)
public macro InjectEntry() =
#externalMacro(
module: "PureduxMacrosPlugin", type: "InjectedStoreMacro"
module: "PureduxMacros", type: "InjectedStoreMacro"
)
16 changes: 16 additions & 0 deletions Sources/PureduxMacros/Plugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// File.swift
//
//
// Created by Sergey Kazakov on 25/08/2024.
//

import SwiftCompilerPlugin
import SwiftSyntaxMacros

@main
struct MacrosPlugin: CompilerPlugin {
let providingMacros: [Macro.Type] = [
InjectedStoreMacro.self
]
}
42 changes: 0 additions & 42 deletions Sources/PureduxMacrosPlugin/MacrosPlugin.swift

This file was deleted.

1 change: 1 addition & 0 deletions Tests/PureduxTests/TestUtils/TestRootAppStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import XCTest
@testable import Puredux
import SwiftUI
import UIKit
import PureduxMacros

extension Injected {
@InjectEntry var rootStore = StateStore<Int, Int>(0) { state, action in state += action }
Expand Down

0 comments on commit ae4a8e0

Please sign in to comment.