|
1 | | -// swift-tools-version: 5.9 |
2 | | -import CompilerPluginSupport |
| 1 | +// swift-tools-version: 5.8 |
3 | 2 | import PackageDescription |
4 | 3 |
|
5 | 4 | let package = Package( |
6 | 5 | name: "SmartCodable", |
7 | | - platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13), .visionOS(.v1)], |
| 6 | + // This manifest is intentionally kept macro-free so older SwiftPM versions |
| 7 | + // can still build the runtime library without pulling in swift-syntax. |
| 8 | + // |
| 9 | + // SwiftPM will automatically pick `Package@swift-5.9.swift` on Swift 5.9+, |
| 10 | + // where macro targets and swift-syntax dependencies are defined. |
| 11 | + platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)], |
8 | 12 | products: [ |
9 | 13 | // Core library without macro support (no swift-syntax dependency) |
10 | 14 | // Recommended for users who don't need inheritance features |
11 | 15 | .library( |
12 | 16 | name: "SmartCodable", |
13 | 17 | targets: ["SmartCodable"] |
14 | | - ), |
15 | | - // Full library with macro support (includes swift-syntax dependency) |
16 | | - // Use this if you need @SmartSubclass and inheritance features |
17 | | - .library( |
18 | | - name: "SmartCodableWithMacros", |
19 | | - targets: ["SmartCodable", "SmartCodableInherit"] |
20 | | - ), |
21 | | - // Legacy product name for backward compatibility |
22 | | - // Deprecated: Use SmartCodableWithMacros instead |
23 | | - .library( |
24 | | - name: "SmartCodableInherit", |
25 | | - targets: ["SmartCodableInherit"] |
26 | 18 | ) |
27 | 19 | ], |
28 | | - dependencies: [ |
29 | | - // Depend on the latest Swift 5.9 SwiftSyntax |
30 | | - .package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"700.0.0") |
31 | | - ], |
32 | 20 | targets: [ |
33 | | - // Targets are the basic building blocks of a package, defining a module or a test suite. |
34 | | - // Targets can depend on other targets in this package and products from dependencies. |
35 | | - // Macro implementation that performs the source transformation of a macro. |
36 | | - .macro( |
37 | | - name: "SmartCodableMacros", |
38 | | - dependencies: [ |
39 | | - .product(name: "SwiftSyntax", package: "swift-syntax"), |
40 | | - .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), |
41 | | - .product(name: "SwiftOperators", package: "swift-syntax"), |
42 | | - .product(name: "SwiftParser", package: "swift-syntax"), |
43 | | - .product(name: "SwiftParserDiagnostics", package: "swift-syntax"), |
44 | | - .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), |
45 | | - ] |
46 | | - ), |
47 | | - |
48 | | - // Library that exposes a macro as part of its API, which is used in client programs. |
49 | 21 | .target( |
50 | 22 | name: "SmartCodable", |
51 | 23 | exclude: ["MacroSupport"]), |
52 | | - |
53 | | - .target( |
54 | | - name: "SmartCodableInherit", |
55 | | - dependencies: [ |
56 | | - "SmartCodableMacros" |
57 | | - ], |
58 | | - path: "Sources/SmartCodable/MacroSupport"), |
59 | | - |
60 | | - // A test target used to develop the macro implementation. |
61 | | - .testTarget( |
62 | | - name: "SmartCodableTests", |
63 | | - dependencies: [ |
64 | | - "SmartCodable", |
65 | | - "SmartCodableInherit", |
66 | | - "SmartCodableMacros", |
67 | | - .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"), |
68 | | - ] |
69 | | - ), |
70 | 24 | ] |
71 | 25 | ) |
0 commit comments