三 Flavor(Shijiaobao / Clinical / Yiwangxin)iOS 项目
架构
- Shared/ 全部共用层:AppHomeView、WebMessageHandler(JSBridge)、DevUrlSettings
- *Flavor/ 各 flavor 入口:AppConfig、*App(@main)、AppDelegate(Yiwangxin 含 Push)
- project.yml + xcodegen 管理项目结构
SDK 集成
- 引用 Gitea SPM 包(branch: main,SNAPSHOT 开发模式)
- sdk.properties 追踪当前 SDK_REF,scripts/use-sdk.sh 支持 main/local/x.y.z 一键切换
- 含各 flavor xuqm/*.xuqmconfig 配置文件
JSBridge 协议
- window.webkit.messageHandlers.SZYX_APP.postMessage(json)
- 回调 window.SZYX_YWX_WebViewBridge.onMessage(json)
- 实现 setTitle/getDeviceInfo/login/setUserInfo/getAppVersion/checkUpdate
setStorage/getStorage/removeStorage/clearStorage/setOrientation/apiError
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
166 行
5.1 KiB
YAML
166 行
5.1 KiB
YAML
name: YwxMobileApp
|
||
options:
|
||
deploymentTarget:
|
||
iOS: "16.0"
|
||
createIntermediateGroups: true
|
||
groupSortPosition: top
|
||
defaultConfig: Debug
|
||
|
||
packages:
|
||
# SNAPSHOT 开发期使用 branch: main(Jenkins SNAPSHOT job 推送到此分支)
|
||
# 正式发版后改为 from: "x.y.z"(对应 Jenkins Release job 打出的 tag)
|
||
# 本地 SDK 调试可临时改为 path: ../../../XuqmGroup/XuqmGroup-iOSSDK
|
||
XuqmGroupSDK:
|
||
url: https://xuqinmin.com/xuqmGroup/XuqmGroup-iOSSDK.git
|
||
branch: main
|
||
|
||
settings:
|
||
base:
|
||
SWIFT_VERSION: "5.9"
|
||
IPHONEOS_DEPLOYMENT_TARGET: "16.0"
|
||
MARKETING_VERSION: "1.0.0"
|
||
CURRENT_PROJECT_VERSION: "1"
|
||
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
|
||
ENABLE_HARDENED_RUNTIME: YES
|
||
|
||
configs:
|
||
Debug: debug
|
||
Release: release
|
||
|
||
targets:
|
||
|
||
# ─────────────────── Shijiaobao ───────────────────
|
||
Shijiaobao:
|
||
type: application
|
||
platform: iOS
|
||
sources:
|
||
- path: Shared
|
||
- path: Shijiaobao
|
||
info:
|
||
path: Shijiaobao/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: 识校宝
|
||
CFBundleShortVersionString: "$(MARKETING_VERSION)"
|
||
CFBundleVersion: "$(CURRENT_PROJECT_VERSION)"
|
||
UILaunchScreen:
|
||
UILaunchScreen: {}
|
||
NSAppTransportSecurity:
|
||
NSAllowsArbitraryLoads: true
|
||
UISupportedInterfaceOrientations:
|
||
- UIInterfaceOrientationPortrait
|
||
- UIInterfaceOrientationPortraitUpsideDown
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
- UIInterfaceOrientationLandscapeRight
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.szyx.app.shijiaobao
|
||
PRODUCT_NAME: Shijiaobao
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
configs:
|
||
Debug:
|
||
SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG
|
||
resources:
|
||
- path: Shijiaobao/xuqm
|
||
type: folder
|
||
dependencies:
|
||
- package: XuqmGroupSDK
|
||
product: XuqmCoreSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmWebViewSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmUpdateSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmBugCollectSDK
|
||
|
||
# ─────────────────── Clinical ───────────────────
|
||
Clinical:
|
||
type: application
|
||
platform: iOS
|
||
sources:
|
||
- path: Shared
|
||
- path: Clinical
|
||
info:
|
||
path: Clinical/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: 临床知识库
|
||
CFBundleShortVersionString: "$(MARKETING_VERSION)"
|
||
CFBundleVersion: "$(CURRENT_PROJECT_VERSION)"
|
||
UILaunchScreen:
|
||
UILaunchScreen: {}
|
||
NSAppTransportSecurity:
|
||
NSAllowsArbitraryLoads: true
|
||
UISupportedInterfaceOrientations:
|
||
- UIInterfaceOrientationPortrait
|
||
- UIInterfaceOrientationPortraitUpsideDown
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
- UIInterfaceOrientationLandscapeRight
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.szyx.app.clinical
|
||
PRODUCT_NAME: Clinical
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
configs:
|
||
Debug:
|
||
SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG
|
||
resources:
|
||
- path: Clinical/xuqm
|
||
type: folder
|
||
dependencies:
|
||
- package: XuqmGroupSDK
|
||
product: XuqmCoreSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmWebViewSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmUpdateSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmBugCollectSDK
|
||
|
||
# ─────────────────── Yiwangxin ───────────────────
|
||
Yiwangxin:
|
||
type: application
|
||
platform: iOS
|
||
sources:
|
||
- path: Shared
|
||
- path: Yiwangxin
|
||
info:
|
||
path: Yiwangxin/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: 医网信
|
||
CFBundleShortVersionString: "$(MARKETING_VERSION)"
|
||
CFBundleVersion: "$(CURRENT_PROJECT_VERSION)"
|
||
UILaunchScreen:
|
||
UILaunchScreen: {}
|
||
NSAppTransportSecurity:
|
||
NSAllowsArbitraryLoads: true
|
||
UIBackgroundModes:
|
||
- remote-notification
|
||
UISupportedInterfaceOrientations:
|
||
- UIInterfaceOrientationPortrait
|
||
- UIInterfaceOrientationPortraitUpsideDown
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
- UIInterfaceOrientationLandscapeRight
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: cn.org.bjca.wcert.ywq.ios
|
||
PRODUCT_NAME: Yiwangxin
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
configs:
|
||
Debug:
|
||
SWIFT_ACTIVE_COMPILATION_CONDITIONS: "DEBUG PUSH_ENABLED"
|
||
Release:
|
||
SWIFT_ACTIVE_COMPILATION_CONDITIONS: PUSH_ENABLED
|
||
resources:
|
||
- path: Yiwangxin/xuqm
|
||
type: folder
|
||
dependencies:
|
||
- package: XuqmGroupSDK
|
||
product: XuqmCoreSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmWebViewSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmUpdateSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmBugCollectSDK
|
||
- package: XuqmGroupSDK
|
||
product: XuqmPushSDK
|