Incomplete file/copyright headers in Swift Package with Xcode 12 / 13

Is there any way to automatically add package/target name and copyright + company name to the header when creating new files while developing a swift package with Xcode 12/13?

Just create a new package (File > New > Package) and add a new file to the sources (File > New > File).

Currently gives me this:

//  File.swift
//  Created by User Name on 02.10.21.

instead of this (like when adding files to regular Xcode project):

//  File.swift
//  MyPackage
//  Created by User Name on 02.10.21.
//  Copyright © 2021 Company Name. All rights reserved.



    1. create a file named IDETemplateMacros.plist. The content for this new file should like this,
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
    <plist version="1.0">
    //  ___FILENAME___
    //  ___WORKSPACENAME___
    //  Created by ___FULLUSERNAME___ on ___DATE___.
    //  Copyright © 2021 Your Name Or Company. All rights reserved.
    1. put this file in one of the following locations,

      a. Has an impact on files created by the specified user (username) in the current workspace:

       <Your Package Root>/.swiftpm/xcode/package.xcworkspace/xcuserdata/<Your username>.xcuserdatad/IDETemplateMacros.plist

      b. Affects files created by all members in the current workspace:

      <Your Package Root>/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist


    • If you cannot see the .swiftpm folder even when "showing hidden files" is enabled, please double click the Package.swift file to open the package in Xcode. Then you will find the .swiftpm file created.

    • you should right click 'show package content' of the package.xcworkspace to get inside screen shot


    • If you find this process to be very cumbersome, you can try using the tool I have created. ➡️ spcreator