Swift Package Manager Files In Alphabetical Order?

Viewed 257

I'm working on removing code from a project file and making it it's own standalone Swift Package. In doing so, I imported a bunch of files, and these files are now in alphabetical order.

Is there anyway to change this?

Thanks

1 Answers

A package consists of Swift source files and a manifest file. The manifest file, called Package.swift. Xcode uses Package.swift file to open Swift Package Manager packages. A package is not a project and has not had a project/workspace file like .xcodeproj or .xcworkspace.

By convention, a target includes any source files located in the Sources/ directory. Just because has no project or workspace file it has no rules like alphabetical order or such so.

Try this

Open Finder, add any source file on the disk system via copy to the package's sources directory. The file Immediately will appear on the (Xcode) package too.

Short Answer

For now, this is not possible. Who knows in the future releases. Personally, I didn't care a lot until I add an Objective-C project. Then I realize that it's super hard to organize things. I understand your point.

I hope this explains the situation.

Best

Related