Proposed by @strangeliu in #2. Applied at the source this repository is exported from, so the pull request itself is not merged directly. Co-authored-by: strangeliu <5244588+strangeliu@users.noreply.github.com>
163 lines
13 KiB
YAML
163 lines
13 KiB
YAML
name: DmIOS
|
||
options:
|
||
bundleIdPrefix: ${DM_BUNDLE_ID}
|
||
deploymentTarget:
|
||
iOS: "26.0" # 命令翻译层走 Metal 4(MTL4CommandQueue 等,iOS 26 起);着色器编译的最低版本(tools/ios_metal.py)不动,免得缓存全量失效 | The command translation layer uses Metal 4 (MTL4CommandQueue etc., from iOS 26); the minimum version for shader compilation (tools/ios_metal.py) is left unchanged, to avoid invalidating the whole cache
|
||
configFiles: # run.sh build 生成:内嵌段链接参数 + 从 dm/host/Makefile 取的头文件路径与框架 | Generated by run.sh build: embedded-segment link flags + header paths and frameworks taken from dm/host/Makefile
|
||
Release: Gen/dm.xcconfig
|
||
Debug: Gen/dm.xcconfig
|
||
targets:
|
||
DmIOS:
|
||
type: application
|
||
platform: iOS
|
||
preBuildScripts: # 直接在 Xcode 里构建时:原版衍生资源不在就先从游戏文件生成(run.sh build 已生成过就跳过;dm/README.md「从你的游戏文件生成资源」) | When building directly in Xcode: if the assets derived from the original game are missing, generate them from game files first (skipped if run.sh build already generated them; see dm/README.md 「从你的游戏文件生成资源」(Generate assets from your game files))
|
||
- name: 从游戏文件生成资源
|
||
basedOnDependencyAnalysis: false
|
||
script: |
|
||
[ -f "$SRCROOT/Gen/assets/NativeHUD/v4/hud.json" ] && [ -f "$SRCROOT/Sources/dm_touch_native_art.c" ] || python3 "$SRCROOT/tools/gen_assets.py"
|
||
sources:
|
||
- Sources
|
||
- Assets.xcassets # App 图标(1024²、不透明;TestFlight 上传必需) | App icon (1024², opaque; required for TestFlight upload)
|
||
- path: Gen/assets/NativeHUD/v4/hud_v4_ui # 底部 UI v4 的 UIKit 素材(run.sh build 由 tools/gen_hud_v4.py 从游戏文件生成:几何、字形、难度数字、选择条格子) | UIKit art for bottom UI v4 (generated from game files by tools/gen_hud_v4.py during run.sh build: geometry, glyphs, difficulty digits, selection bar cells)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/assets/NativeHUD/mapgoal # 小地图任务终点的素材(run.sh build 由 tools/gen_map_goal_art.py 从游戏文件生成:塔拉夏符号、地图十字、原版名牌) | Art for the minimap quest goal (generated from game files by tools/gen_map_goal_art.py during run.sh build: Tal Rasha symbols, map cross, the original game's nameplate)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/romfs_overlay # RomFS 覆盖层(run.sh build 由 tools/gen_romfs_overlay.py 生成;main.m 设 DM_ROMFS_OVERLAY) | RomFS overlay (generated by tools/gen_romfs_overlay.py during run.sh build; main.m sets DM_ROMFS_OVERLAY)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/romfs_overlay_variants # 覆盖层的开关组合(物品注释…,同一脚本生成;main.m 按自定义开关挑一份) | Overlay switch combinations (item annotations..., generated by the same script; main.m picks one according to the custom switches)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/romfs_overlay_astc # 老机型补充包配套的 ASTC 版覆盖层与 pack.json(设了 DM_ASTC_PACK 才有内容;main.m 在不支持 BC 且补充包校验通过时用) | ASTC overlay and pack.json that go with the Legacy Device Pack (has content only when DM_ASTC_PACK is set; main.m uses it when BC is unsupported and the Legacy Device Pack passes verification)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/romfs_overlay_astc_variants
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/embed.S
|
||
- path: Gen/dm
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/msl # iOS 版 metallib + 反射 json(DM_MSL_DIR) | iOS metallib + reflection json (DM_MSL_DIR)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/save_ref # 标准存档 save_ref(DM_SAVE_FRESH 时换进 Documents/save) | Standard save save_ref (swapped into Documents/save when DM_SAVE_FRESH is set)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/save_ref_warlock # 术士存档(DM_SAVE_FRESH=warlock) | Warlock save (DM_SAVE_FRESH=warlock)
|
||
type: folder
|
||
buildPhase: resources
|
||
- path: Gen/src # dm/host/Makefile 编译命令里的源文件(gen_build.py 链入) | Source files from the compile commands of dm/host/Makefile (linked in by gen_build.py)
|
||
- path: Gen/main/main.c
|
||
compilerFlags: "-Dmain=dm_main"
|
||
info:
|
||
path: Sources/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: D2R Mobile
|
||
CFBundleVersion: $(CURRENT_PROJECT_VERSION) # 构建号(testflight.sh 传月日时分);xcodegen 缺省写死 1,TestFlight 会当重复构建 | Build number (testflight.sh passes month-day-hour-minute); xcodegen hardcodes 1 by default, which TestFlight treats as a duplicate build
|
||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||
SWUpdateURL: $(DM_UPDATE_URL) # 新版本提示查的版本文件地址(Sources/dm_update.m);出包脚本传,地址不进仓库。空 = 不查不提示 | URL of the version file checked for the new-version prompt (Sources/dm_update.m); passed by the packaging script, the URL is not committed to the repository. Empty = no check, no prompt
|
||
UILaunchStoryboardName: ""
|
||
UIFileSharingEnabled: true
|
||
LSSupportsOpeningDocumentsInPlace: true
|
||
UISupportedInterfaceOrientations: # 游戏画面 16:9 横屏(1600x900),只允许横屏两向 | The game picture is 16:9 landscape (1600x900); only the two landscape orientations are allowed
|
||
- UIInterfaceOrientationLandscapeRight
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
UIRequiresFullScreen: true
|
||
UIStatusBarHidden: true
|
||
UIViewControllerBasedStatusBarAppearance: false
|
||
LSApplicationCategoryType: public.app-category.role-playing-games # 声明为游戏:iOS 游戏模式(压后台活动、保持续性能)只对游戏类目的 App 自动开(此前没声明类目) | Declare as a game: iOS Game Mode (suppresses background activity, preserves sustained performance) turns on automatically only for Apps in a game category (no category was declared before)
|
||
LSSupportsGameMode: true # iOS 游戏模式的键(WWDC25 209)。先前误写成 GCSupportsGameMode(macOS 旧键),iOS 不认 | Key for iOS Game Mode (WWDC25 209). Previously miswritten as GCSupportsGameMode (the old macOS key), which iOS does not recognize
|
||
ITSAppUsesNonExemptEncryption: false # TestFlight 上传免出口合规问答(只用系统加密) | Skips the export compliance questionnaire on TestFlight upload (only system encryption is used)
|
||
BAAppGroupID: group.${DM_BUNDLE_ID} # 游戏资源(RomFS 9 GB,超安装包 4 GB 上限)走苹果托管资源包 romfs:TestFlight / 商店安装时随包下载 | Game assets (RomFS is 9 GB, over the 4 GB install package limit) go through the Apple-hosted asset pack romfs: downloaded with the package on TestFlight / Store install
|
||
BAHasManagedAssetPacks: true
|
||
BAUsesAppleHosting: true
|
||
CADisableMinimumFrameDurationOnPhone: true # iPhone 缺省把 App 限在 60 Hz;不设这个键,ProMotion 120 Hz 拿不到(画布每 16.6 ms 才给一张) | By default iPhone caps Apps at 60 Hz; without this key ProMotion 120 Hz is unavailable (the canvas hands out a drawable only every 16.6 ms)
|
||
UIApplicationSceneManifest:
|
||
UIApplicationSupportsMultipleScenes: false
|
||
UISceneConfigurations:
|
||
UIWindowSceneSessionRoleApplication:
|
||
- UISceneConfigurationName: Default
|
||
UISceneDelegateClassName: SceneDelegate
|
||
entitlements:
|
||
path: Sources/DmIOS.entitlements
|
||
properties:
|
||
com.apple.developer.kernel.increased-memory-limit: true
|
||
com.apple.developer.kernel.extended-virtual-addressing: true
|
||
com.apple.developer.sustained-execution: true # 持续执行模式:系统从启动起就按稳态功率给性能,凉机与热机表现一致(启动日志「持续执行档」核对是否生效) | Sustained execution mode: from launch the system grants performance at steady-state power, so a cold device and a hot device behave the same (check the startup log line 「持续执行档」(sustained execution tier) to see whether it took effect)
|
||
com.apple.security.application-groups: ["group.${DM_BUNDLE_ID}"]
|
||
com.apple.developer.icloud-container-identifiers: ["iCloud.${DM_BUNDLE_ID}"] # iCloud 同步存档(cloud_ios.m):App 私有的 iCloud Drive 容器,不在「文件」App 里露出 | iCloud save sync (cloud_ios.m): the App's private iCloud Drive container, not exposed in the Files app
|
||
com.apple.developer.icloud-services: [CloudDocuments]
|
||
com.apple.developer.ubiquity-container-identifiers: ["iCloud.${DM_BUNDLE_ID}"]
|
||
dependencies:
|
||
- target: RomfsDownloader # 苹果托管资源包要求的下载扩展(系统缺省实现) | Download extension required by Apple-hosted asset packs (system default implementation)
|
||
- sdk: BackgroundAssets.framework
|
||
settings:
|
||
PRODUCT_BUNDLE_IDENTIFIER: ${DM_BUNDLE_ID}
|
||
ENABLE_USER_SCRIPT_SANDBOXING: NO # 构建前脚本「从游戏文件生成资源」要读工程外的 RomFS(沙盒里读不到) | The pre-build script 「从游戏文件生成资源」(Generate assets from game files) needs to read the RomFS outside the project (unreadable inside the sandbox)
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
MARKETING_VERSION: "1.0"
|
||
CURRENT_PROJECT_VERSION: $(DM_BUILD_NUMBER) # TestFlight 每次上传须递增;tools/testflight.sh 传入,本地构建缺省 1 | Must be incremented for every TestFlight upload; passed in by tools/testflight.sh, defaults to 1 for local builds
|
||
DM_BUILD_NUMBER: "1"
|
||
DM_UPDATE_URL: "" # tools/adhoc.sh 在环境里有 DM_UPDATE_URL 时传入;本地构建缺省空 | Passed in by tools/adhoc.sh when DM_UPDATE_URL is in the environment; empty by default for local builds
|
||
DEVELOPMENT_TEAM: ${DM_TEAM_ID}
|
||
CODE_SIGN_STYLE: Automatic
|
||
TARGETED_DEVICE_FAMILY: $(DM_DEVICE_FAMILY) # 设备族:缺省同时面向 iPhone 与 iPad("1,2");只要 iPhone 时构建传 DM_DEVICE_FAMILY=1 | Device family: targets both iPhone and iPad by default ("1,2"); for iPhone only, pass DM_DEVICE_FAMILY=1 to the build
|
||
DM_DEVICE_FAMILY: "1,2"
|
||
ENABLE_BITCODE: NO
|
||
GCC_C_LANGUAGE_STANDARD: gnu11
|
||
OTHER_CFLAGS: $(inherited) -mcpu=apple-a18 # 只给 iPhone 17 Pro Max(A19)用;宿主汇编里有 LSE 原子指令,默认 a10 基线不认 | Only for iPhone 17 Pro Max (A19); the host assembly contains LSE atomic instructions, which the default a10 baseline does not accept
|
||
CLANG_ENABLE_OBJC_ARC: YES
|
||
DEBUG_INFORMATION_FORMAT: dwarf
|
||
RomfsDownloader:
|
||
type: extensionkit-extension
|
||
platform: iOS
|
||
sources:
|
||
- RomfsDownloader
|
||
info:
|
||
path: RomfsDownloader/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: RomfsDownloader
|
||
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
|
||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||
EXAppExtensionAttributes:
|
||
EXExtensionPointIdentifier: com.apple.background-asset-downloader-extension
|
||
entitlements:
|
||
path: RomfsDownloader/RomfsDownloader.entitlements
|
||
properties:
|
||
com.apple.security.application-groups: ["group.${DM_BUNDLE_ID}"]
|
||
settings:
|
||
PRODUCT_BUNDLE_IDENTIFIER: ${DM_BUNDLE_ID}.romfs-downloader
|
||
DEVELOPMENT_TEAM: ${DM_TEAM_ID}
|
||
CODE_SIGN_STYLE: Automatic
|
||
TARGETED_DEVICE_FAMILY: $(DM_DEVICE_FAMILY) # 设备族:缺省同时面向 iPhone 与 iPad("1,2");只要 iPhone 时构建传 DM_DEVICE_FAMILY=1 | Device family: targets both iPhone and iPad by default ("1,2"); for iPhone only, pass DM_DEVICE_FAMILY=1 to the build
|
||
DM_DEVICE_FAMILY: "1,2"
|
||
IPHONEOS_DEPLOYMENT_TARGET: "26.4"
|
||
SWIFT_VERSION: "6.0"
|
||
MARKETING_VERSION: "1.0"
|
||
CURRENT_PROJECT_VERSION: $(DM_BUILD_NUMBER)
|
||
DM_BUILD_NUMBER: "1"
|
||
TouchSmokeTests:
|
||
type: bundle.ui-testing
|
||
platform: iOS
|
||
sources:
|
||
- TouchSmokeTests
|
||
dependencies:
|
||
- target: DmIOS
|
||
settings:
|
||
DEVELOPMENT_TEAM: ${DM_TEAM_ID}
|
||
CODE_SIGN_STYLE: Automatic
|
||
GENERATE_INFOPLIST_FILE: YES
|
||
TEST_TARGET_NAME: DmIOS
|
||
schemes:
|
||
DmIOS:
|
||
build:
|
||
targets:
|
||
DmIOS: all
|
||
TouchSmokeTests: [test]
|
||
test:
|
||
targets:
|
||
- TouchSmokeTests
|