- 为 Android、Flutter、iOS 和 RN SDK 的 Jenkinsfile 添加模块化版本控制 - 引入版本升级策略选择(major/minor/patch)和自定义版本号功能 - 实现多模块独立版本管理和选择性构建发布 - 更新 iOS SDK Package.swift 以支持独立模块化库 - 修改 iOS SDK podspec 文件以适应新的标签命名约定 - 优化 Jenkins 构建流程以支持按需选择特定模块进行构建和发布 - 修复 iOS 测试中的可选类型转换问题以提高代码健壮性
47 行
1.2 KiB
Swift
47 行
1.2 KiB
Swift
import XuqmCoreSDK
|
|
#if canImport(UIKit)
|
|
import UIKit
|
|
#endif
|
|
import Foundation
|
|
|
|
enum DeviceInfoProvider {
|
|
|
|
static func getDeviceId(store: LicenseStore) -> String {
|
|
if let existing = store.deviceId { return existing }
|
|
#if canImport(UIKit)
|
|
let id = UIDevice.current.identifierForVendor?.uuidString ?? UUID().uuidString
|
|
#else
|
|
let id = UUID().uuidString
|
|
#endif
|
|
store.deviceId = id
|
|
return id
|
|
}
|
|
|
|
static func getDeviceName() -> String {
|
|
#if canImport(UIKit)
|
|
return UIDevice.current.name
|
|
#else
|
|
return Host.current().localizedName ?? "Mac"
|
|
#endif
|
|
}
|
|
|
|
static func getDeviceModel() -> String {
|
|
#if canImport(UIKit)
|
|
return UIDevice.current.model
|
|
#else
|
|
return "Mac"
|
|
#endif
|
|
}
|
|
|
|
static func getDeviceVendor() -> String { "Apple" }
|
|
|
|
static func getOsVersion() -> String {
|
|
#if canImport(UIKit)
|
|
return "iOS \(UIDevice.current.systemVersion)"
|
|
#else
|
|
let v = ProcessInfo.processInfo.operatingSystemVersion
|
|
return "macOS \(v.majorVersion).\(v.minorVersion).\(v.patchVersion)"
|
|
#endif
|
|
}
|
|
}
|