Swift Package Manager with resources compile errors

后端 未结 1 1756
长情又很酷
长情又很酷 2021-01-26 03:09

I am trying to use resources inside my Package.swift file:

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swif         


        
相关标签:
1条回答
  • 2021-01-26 03:19

    You missed a , after the target close parentheses:

            .target(
                name: "BioSwift",
                resources: [
                   .process("Resources/unimod.xml"),
                   .process("Resources/aminoacids.json"),
                   .process("Resources/elements.json"),
                   .process("Resources/enzymes.json"),
                   .process("Resources/functionalgroups.json"),
                   .process("Resources/hydropathy.json")
                ]
            ), // Here is the missed `,`
    

    Also, you don't need to add files one by one! Instead, you can add a directory:

    .process("Resources")
    
    0 讨论(0)
提交回复
热议问题