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

Ios/feature/create swift package #1

Merged
merged 5 commits into from
Jan 12, 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.swiftpm
/Package.resolved
34 changes: 16 additions & 18 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let package = Package(
)
],
dependencies: [
.package(path: "../MacroTester"),
.package(url: "[email protected]:num42/swift-macrotester.git", from: "1.0.0"),
// Depend on the Swift 5.9 release of SwiftSyntax
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
.package(
Expand All @@ -36,33 +36,31 @@ let package = Package(
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
// plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
],
plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
Copy link
Member

Choose a reason for hiding this comment

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

this elongated the build a lot, will not be a problem when we use the "macros via mint" solution but might increase build time at first

Copy link
Member

Choose a reason for hiding this comment

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

(so: leave it as it is now, just a heads-up comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

still need support on that, i managed to include it in Mint but was not able to successfully reference it inside the classes (implementation was not found)

Copy link
Member

Choose a reason for hiding this comment

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

I documented my knowledge in #3

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 ok will address this inside the issue for migrating to Mint

),

// Library that exposes a macro as part of its API, which is used in client programs.
.target(
name: "Changeable",
dependencies: ["ChangeableMacros"]
// plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
dependencies: ["ChangeableMacros"],
plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
),

// A client of the library, which is able to use the macro in its own code.
.executableTarget(
name: "ChangeableClient",
dependencies: ["Changeable"]
// plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
)

dependencies: ["Changeable"],
plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
),
// A test target used to develop the macro implementation.
// .testTarget(
// name: "ChangeableTests",
// dependencies: [
// "ChangeableMacros",
// .product(name: "MacroTester", package: "MacroTester"),
// .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
// ]
// plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
// )
.testTarget(
name: "ChangeableTests",
dependencies: ["ChangeableMacros",
.product(name: "MacroTester", package: "swift-macrotester"),
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
],
plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
)
]
)
2 changes: 1 addition & 1 deletion Tests/ChangeableTests/ChangeableTests.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ChangeableMacros
import MacroTester
import SwiftSyntaxMacros
import SwiftSyntaxMacrosTestSupport
import XCTest
import MacroTester

let testMacros: [String: Macro.Type] = [
"Changeable": ChangeableFunctionMacro.self
Expand Down