Skip to content

akidon0000/XprojGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XprojGen

XprojGenは、iOSアプリケーション用のXcodeプロジェクトを自動生成するSwift製のコマンドラインツールです。 XcodeGenStencilを使用して、SwiftUIベースのプロジェクトを瞬時に作成できます。 また、R.swiftSwiftLintも自動的にプロジェクトに組み込まれます。

使用方法

基本的な使用方法

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: ヘルプメッセージを表示します

生成されるファイル

App.swift

メインのアプリケーションエントリーポイント:

@main
struct {プロダクト名}App: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

ContentView.swift

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

依存関係

ライセンス

このプロジェクトはLICENSEファイルに記載されたライセンスの下で公開されています。

参考リンク

  • mtj0928/SlideGen 本プロジェクトのインスピレーション元となったツールです。

作者

akidon0000

About

SwiftUIベースのiOSプロジェクトを自動生成するCLIツール

Resources

License

Stars

Watchers

Forks

Contributors

Languages