Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the default header comment license in Swift Package

I want to change the default header in my Swift Package. Is this possible?

Note: I don't want to change it for a project. This is possible. If you want to change it for your Project: Changing the default header comment license in Xcode

like image 640
Godlike Avatar asked May 20 '21 06:05

Godlike


Video Answer


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>
like image 124
Snowy_1803 Avatar answered Nov 15 '22 00:11

Snowy_1803