Changing the default header comment license in Swift Package

Viewed 845
1 Answers

To change the header comment for a single Swift Package, you will have to put your IDETemplateMacros.plist file in the following location, relative to your package root :

.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist

Unfortunately, in Xcode 13, the package name macro won't work, but you can just specify it manually. Here's an example content for your macros file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>FILEHEADER</key>
    <string>
//  ___FILENAME___
//  Your Package Name
// 
//  Created by ___FULLUSERNAME___ on ___DATE___.
//  Copyright © 2021 Your Name Or Company. All rights reserved.
//</string>
</dict>
</plist>
Related