Recently I created PackageBuilder to build a simple command-line structure easily by SwiftPM. Itβs very simple, but it saves a lot your development time if youβd like to create a command line tool like Marathon created by @JohnSundell. This automatic tool is based on his great article. Also, This tool inspired by JohnSundell/SwiftPlate. If you agree with them, Iβm sure youβll like it:)
In its usage, what you have to do is just like this,
$ packagebuilder {PACKAGE_NAME}
$ packagebuilder {PACKAGE_NAME} --path ~/Developer/project
For instance,
$ packagebuilder AwesomePackage
The output is simple.
Executing `swift package init --type executable` at /Users/pixyzehn/Developer/projects/AwesomePackage/
Creating Sources/AwesomePackage...
Creating Sources/AwesomePackageCore...
Creating Tests/AwesomePackageTests...
Deleting original files created by SwiftPM...
Cloning PackageBulder by HTTPS to get files in Templates...
Renaming {PACKAGE_NAME} to AwesomePackage...
Renaming {YOUR_NAME} to Nagasawa Hiroki...
Renaming {THIS_YEAR} to 2017...
Moving files in Templates to a correct position...
Deleting the temp folder...
Executing `swift build` & `swift test --parallel`
Generating xcodeproj...
Enjoy AwesomePackage π
And then, you will get the executable package like this,
.
βββ AwesomePackage.xcodeproj
βΒ Β βββ AwesomePackageCore_Info.plist
βΒ Β βββ AwesomePackageTests_Info.plist
βΒ Β βββ project.pbxproj
βΒ Β βββ xcshareddata
βΒ Β βββ xcschemes
βΒ Β βββ AwesomePackage.xcscheme
βΒ Β βββ xcschememanagement.plist
βββ LICENSE
βββ Package.swift
βββ README.md
βββ Sources
βΒ Β βββ AwesomePackage
βΒ Β βΒ Β βββ main.swift
βΒ Β βββ AwesomePackageCore
βΒ Β βββ AwesomePackage.swift
βββ Tests
βββ AwesomePackageTests
βΒ Β βββ AwesomePackageTests.swift
βββ LinuxMain.swift
8 directories, 12 files
The merit of this tool is that you can work on creating a package as soon as you come up with a good idea. Letβs start creating an awesome package by opening xcodeproj in Xcode!
Great new project generation tool by @pixyzehn - it's like SwiftPlate for Swift Package Manager-based command line tools! π #swiftlang https://t.co/bcNQjME3gn
β John Sundell (@johnsundell) May 18, 2017
Thank you again, @JohnSundell.
Contributions are more than welcome!