Skip to content

Commit

Permalink
Merge pull request #5 from nixzhu/drop-macros
Browse files Browse the repository at this point in the history
Drop Macros
  • Loading branch information
nixzhu authored Jun 14, 2024
2 parents 8d0cdfd + 09d4001 commit 4e99086
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 806 deletions.
13 changes: 2 additions & 11 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/michaeleisel/JJLISO8601DateFormatter.git",
"state" : {
"revision" : "ed1d996123688bade6e895aa49595f0d862900e7",
"version" : "0.1.7"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd",
"version" : "510.0.1"
"revision" : "741a9e45db01148a8ac60c5e12f7c978181a22d3",
"version" : "0.1.8"
}
},
{
Expand Down
29 changes: 2 additions & 27 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// swift-tools-version: 5.9

import PackageDescription
import CompilerPluginSupport

let package = Package(
name: "Ananda",
Expand All @@ -26,31 +25,13 @@ let package = Package(
),
.package(
url: "https://github.com/michaeleisel/JJLISO8601DateFormatter.git",
from: "0.1.7"
),
.package(
url: "https://github.com/apple/swift-syntax.git",
"509.0.0"..<"511.0.0"
from: "0.1.8"
),
],
targets: [
.macro(
name: "AnandaMacros",
dependencies: [
.product(
name: "SwiftSyntaxMacros",
package: "swift-syntax"
),
.product(
name: "SwiftCompilerPlugin",
package: "swift-syntax"
),
]
),
.target(
name: "Ananda",
dependencies: [
"AnandaMacros",
.product(
name: "yyjson",
package: "yyjson"
Expand All @@ -66,13 +47,7 @@ let package = Package(
),
.testTarget(
name: "AnandaTests",
dependencies: [
"Ananda",
.product(
name: "SwiftSyntaxMacrosTestSupport",
package: "swift-syntax"
),
]
dependencies: ["Ananda"]
),
]
)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ let toots = [Mastodon.Toot].decode(from: jsonData, path: ["toots"])

## Swift Macro

With Swift 5.9, you can use macro to eliminate the initialization methods as follow:
With Swift 5.9 and [AnandaMacros](https://github.com/nixzhu/AnandaMacros), you can use macro to eliminate the initialization methods as follow:

```swift
import Foundation
import Ananda
import AnandaMacros

@AnandaInit
struct Mastodon: AnandaModel {
Expand Down
20 changes: 0 additions & 20 deletions Sources/Ananda/Macros.swift

This file was deleted.

14 changes: 0 additions & 14 deletions Sources/AnandaMacros/AnandaIgnoredMacro.swift

This file was deleted.

Loading

0 comments on commit 4e99086

Please sign in to comment.