代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。