加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
project.yml 5.87 KB
一键复制 编辑 原始数据 按行查看 历史
zhxf 提交于 2023-10-10 17:10 . 适配xcode15 更新部分依赖库
name: BPBleOTA
options:
#carthage: true
deploymentTarget:
iOS: "12.0"
bundleIdPrefix: com.bbb.zhxf
version: 0.6.2
packages:
iOSMcuManagerLibrary:
url: https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager
from: 1.3.3
SwiftCBOR:
url: https://github.com/unrelentingtech/SwiftCBOR
from: 0.4.4
NordicDFU:
url: https://github.com/NordicSemiconductor/IOS-DFU-Library
from: 4.13.0
ZIPFoundation:
url: https://github.com/weichsel/ZIPFoundation
from: 0.9.11
targetTemplates:
Framework:
platform: iOS
type: framework
sources:
- ${frameworSourceFolder} #.build/checkouts/${frameworSourceFolder}
swift_versions: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"]
settings:
GENERATE_INFOPLIST_FILE: YES
CODE_SIGNING_ALLOWED: NO
MARKETING_VERSION: ${PACKAGE_VERSION}
CURRENT_PROJECT_VERSION: ${PACKAGE_VERSION}
#MACH_O_TYPE: staticlib
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
DYLIB_COMPATIBILITY_VERSION: ""
#CODE_SIGN_IDENTITY: "iPhone Distribution"
targets:
iOSMcuManagerLibrary:
templates:
- Framework
templateAttributes:
frameworSourceFolder: .build/checkouts/IOS-nRF-Connect-Device-Manager/Source
PACKAGE_VERSION: 1.3.3
dependencies:
- package: SwiftCBOR
SwiftCBOR:
templates:
- Framework
templateAttributes:
frameworSourceFolder: .build/checkouts/SwiftCBOR/Sources
PACKAGE_VERSION: 0.4.4
NordicDFU:
templates:
- Framework
templateAttributes:
frameworSourceFolder: .build/checkouts/IOS-DFU-Library/iOSDFULibrary
PACKAGE_VERSION: 4.13.0
dependencies:
- package: ZIPFoundation
ZIPFoundation:
templates:
- Framework
templateAttributes:
frameworSourceFolder: .build/checkouts/ZIPFoundation/Sources
PACKAGE_VERSION: 0.9.11
BPBleOTA:
templates:
- Framework
templateAttributes:
frameworSourceFolder: Sources
PACKAGE_VERSION: 0.6.2
dependencies:
- package: iOSMcuManagerLibrary
- package: NordicDFU
settings:
SWIFT_ACTIVE_COMPILATION_CONDITIONS: "$(inherited) SWIFT_PACKAGE"
CURRENT_PROJECT_VERSION: 0.6.0220231010
BPBleOTATests:
type: bundle.unit-test
platform: iOS
sources: Tests
dependencies:
- target: BPBleOTA
settings:
HEADER_SEARCH_PATHS: $(SRCROOT)/Sources
GENERATE_INFOPLIST_FILE: YES
CODE_SIGNING_ALLOWED: NO
aggregateTargets:
BuildAllFrameworks :
settings:
HEADER_SEARCH_PATHS: $(SRCROOT)/Sources
SWIFT_ACTIVE_COMPILATION_CONDITIONS: "$(inherited) SWIFT_PACKAGE"
buildScripts:
- name: Run Script
script: |
BUILD_DIR="Build"
PRODUCT_DIR="Products"
success_count=0
function build_framework() {
local framework_name="$1"
local scheme="${framework_name}"
local tmp_dir="${BUILD_DIR}/${framework_name}"
local ios_archive_path="${tmp_dir}/iOS.xcarchive"
local ios_sim_archive_path="${tmp_dir}/iOSSimulator.xcarchive"
# Clean up any previous build artifacts
rm -rf "${tmp_dir}"
#rm -rf "${PRODUCT_DIR}/${framework_name}.xcframework"
# Build archives for iOS and iOS Simulator
xcodebuild archive \
-scheme "${scheme}" \
-project "${PROJECT_NAME}.xcodeproj" \
-archivePath "${ios_sim_archive_path}" \
-destination "generic/platform=iOS Simulator" \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES || { echo "Error: Failed to build archive for ${framework_name} (iOS Simulator)"; exit 1; }
xcodebuild archive \
-scheme "${scheme}" \
-project "${PROJECT_NAME}.xcodeproj" \
-archivePath "${ios_archive_path}" \
-destination "generic/platform=iOS" \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES || { echo "Error: Failed to build archive for ${framework_name} (iOS)"; exit 1; }
rm -rf "${PRODUCT_DIR}/${framework_name}.xcframework"
xcodebuild -create-xcframework \
-framework ${ios_sim_archive_path}/Products/Library/Frameworks/${framework_name}.framework \
-framework ${ios_archive_path}/Products/Library/Frameworks/${framework_name}.framework \
-output ${PRODUCT_DIR}/${framework_name}.xcframework \
#| xcpretty
if [ $? -eq 0 ]; then
echo "build_framework ${framework_name} succeeded!"
((success_count++))
else
echo "Error: Failed to create xcframework for ${framework_name}"
exit 1
fi
#echo "build_framework ${framework_name} Successed!"
}
#build_framework "SwiftCBOR" && \
#build_framework "iOSMcuManagerLibrary" && \
#build_framework "ZIPFoundation" && \
#build_framework "NordicDFU" && \
#build_framework "BPBleOTA"
frameworks=("SwiftCBOR" "iOSMcuManagerLibrary" "ZIPFoundation" "NordicDFU" "BPBleOTA")
for framework in "${frameworks[@]}"; do
build_framework "$framework"
if [ $result -ne 0 ]; then
echo "Terminating script due to build ${framework} failure"
break
fi
done
if [ $success_count -eq ${#frameworks[@]} ]; then
echo "build all frameworks succeeded!"
exit 0
else
echo "Failed to build all frameworks"
exit 1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化