- 
                Notifications
    You must be signed in to change notification settings 
- Fork 857
Open
Description
Here I try to include my macros locally into the project. But eventually have this issue in logs:
Error: external macro implementation type 'MyLocalMcr.MockekeMacro' could not be found for macro 'Mockeke()'
I'm using 2.42.0 XcodeGen
My yml config:
name: TemplateProject
options:
  deploymentTarget:
    iOS: "15.0"
settings:
  base:
    MARKETING_VERSION: 1.0
targetTemplates:
  Framework:
    type: framework
    platform: iOS
    settings:
      BUILD_LIBRARY_FOR_DISTRIBUTION: true
    info:
      path: Info.plist
packages:
  MyLocalMcr:
    path: ./../MyLocalMcr   // Here I try to include it
targets:
  TemplateProjectDemo:
    type: application
    platform: iOS
    deploymentTarget: "15.0"
    info:
      path: TemplateProjectDemo/Info.plist
      properties:
        NSAppTransportSecurity:
          NSAllowsArbitraryLoads: true
    sources:
      - TemplateProjectDemo
    dependencies:
      - framework: Products/xc/TemplateProject.xcframework
      - package: MyLocalMcr
        linkType: static
        destinationFilters: [iOS, macOS]
      - framework: Products/xc/OtherFramework1.xcframework
      - framework: Products/xc/OtherFramework1.xcframework
      - framework: Products/xc/OtherFramework1.xcframeworkCould you please provide examples: how to include macros into the project (as local package, or as target, etc)
Because I have faced it today and it's stumbling block for my project :(
MyLocalMcr is SPM package
import CompilerPluginSupport
import PackageDescription
let package = Package(
    name: "MyLocalMcr",
    platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .macCatalyst(.v13)],
    products: [
        .library(
            name: "MyLocalMcr",
            targets: ["MyLocalMcr"]
        )
    ],
    dependencies: [
        .package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0")
    ],
    targets: [
        .macro(
            name: "MyLocalMcrMacros",
            dependencies: [
                .product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
                .product(name: "SwiftCompilerPlugin", package: "swift-syntax")
            ]
        ),
        .target(name: "MyLocalMcr", dependencies: ["MyLocalMcrMacros"])
    ]
)XcodeGen macros error
Macros doesn't work with XcodeGen
timoninas and otnielyehezkiel
Metadata
Metadata
Assignees
Labels
No labels