Skip to content

Instantly share code, notes, and snippets.

@macneko-ayu
Created December 15, 2021 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macneko-ayu/2621414f90189f76c49bfc404e637d1d to your computer and use it in GitHub Desktop.
Save macneko-ayu/2621414f90189f76c49bfc404e637d1d to your computer and use it in GitHub Desktop.
Sample of generating a SwiftUI project file with XcodeGen
# 任意のProduct Nameに置き換える(Targetも同様)
name: FooProduct
options:
bundleIdPrefix: com.example
deploymentTarget:
iOS: 15.0
xcodeVersion: "13.1"
settings:
base:
# 任意のTeam IDに置き換える
DEVELOPMENT_TEAM: (YOUR_TEAM)
# すべてのTargetで共通にするためにここで指定する
MARKETING_VERSION: 1.0.0
# すべてのTargetで共通にするためにここで指定する
CURRENT_PROJECT_VERSION: 1
# Xcode 13.1のテンプレートから作成したものと差分があったので、あわせる
CLANG_CXX_LANGUAGE_STANDARD: gnu++17
# 任意でManualに置き換える
CODE_SIGN_STYLE: Automatic
targets:
# アプリのTarget定義を記載する
FooProduct:
type: application
platform: iOS
sources:
- FooProduct
settings:
base:
ENABLE_PREVIEWS: YES
DEVELOPMENT_ASSET_PATHS: "\"FooProduct/Preview Content\""
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor
# 生成するInfo.plistの設定を記載する
info:
# 生成先のPathを指定する
path: FooProduct/Info.plist
# 各種設定は基本的にXcode 13.1のテンプレートから作成したものとあわせる
properties:
# settingsで設定した環境変数を使用する
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
# settingsで設定した環境変数を使用する
CFBundleShortVersionString: $(MARKETING_VERSION)
LSRequiresIPhoneOS: YES
# UILaunchScreenをダミーでもいいので設定しないと、描画がおかしくなる
UILaunchScreen: ""
UIApplicationSupportsIndirectInputEvents: YES
UIApplicationSceneManifest:
UIApplicationSupportsMultipleScenes: YES
# Device Orientationは任意のものを指定する(現状はXcode 13.1のテンプレートとそろっている)
UISupportedInterfaceOrientations~iphone:
[UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight]
UISupportedInterfaceOrientations~ipad:
[UIInterfaceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight]
FooProductTests:
# UnitTestのTarget定義を指定する
type: bundle.unit-test
platform: iOS
sources:
- FooProductTests
dependencies:
- target: FooProduct
settings:
base:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: YES
# 生成するInfo.plistの設定を記載する
info:
# 生成先のPathを指定する
path: FooProductTests/Info.plist
# 各種設定は基本的にXcode 13.1のテンプレートから作成したものとあわせる
properties:
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
CFBundleShortVersionString: $(MARKETING_VERSION)
FooProductUITests:
# UITestのTarget定義
type: bundle.ui-testing
platform: iOS
sources:
- FooProductUITests
dependencies:
- target: FooProduct
settings:
base:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: YES
# 生成するInfo.plistの設定を記載する
info:
# 生成先のPathを指定する
path: FooProductUITests/Info.plist
# 各種設定は基本的にXcode 13.1のテンプレートから作成したものとあわせる
properties:
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
CFBundleShortVersionString: $(MARKETING_VERSION)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment