XprojGenは、iOSアプリケーション用のXcodeプロジェクトを自動生成するSwift製のコマンドラインツールです。
XcodeGenとStencilを使用して、SwiftUIベースのプロジェクトを瞬時に作成できます。
また、R.swiftやSwiftLintも自動的にプロジェクトに組み込まれます。
mint run akidon0000/XprojGen {プロダクト名}これにより、以下の構造でプロジェクトが生成されます:
MyApp/
├── MyApp.xcodeproj
├── MyApp/
│ ├── MyAppApp.swift
│ └── ContentView.swift
mint run akidon0000/XprojGen {プロダクト名} --flat
# または
mint run akidon0000/XprojGen {プロダクト名} -fフラット構造では、現在のディレクトリに直接プロジェクトファイルが生成されます:
./
├── MyApp.xcodeproj
├── MyApp/
│ ├── MyAppApp.swift
│ └── ContentView.swift
--flat,-f: フラットなディレクトリ構造で生成します--help,-h: ヘルプメッセージを表示します
メインのアプリケーションエントリーポイント:
@main
struct {プロダクト名}App: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}SwiftUIベースのメインビュー:
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world! MyApp")
}
.padding()
}
}- プラットフォーム: iOS
- Swift バージョン: 6.0
- Bundle Identifier:
com.github.akidon0000.makexproj.gen.{プロダクト名} - Info.plist: 自動生成
- ビルド設定: Debug/Release設定を含む
git clone https://github.com/akidon0000/XprojGen.git
cd XprojGen
swift build -c release実行可能ファイルは .build/release/xprojgen に作成されます。
swift run --package-path /path/to/XprojGen xprojgen {プロダクト名}swift build- apple/swift-argument-parser: コマンドライン引数の解析
- stencilproject/Stencil: テンプレートエンジン
- yonaskolb/XcodeGen: Xcodeプロジェクト生成
このプロジェクトはLICENSEファイルに記載されたライセンスの下で公開されています。
- mtj0928/SlideGen 本プロジェクトのインスピレーション元となったツールです。