docs/agents/build-and-test.md
满足以下任一条件时运行 xcodebuild:
EasydictTests/**/*.swift 下的测试源码。在实现完成后再评估该阈值。统计任务变更 diff 中新增和删除的实质性行数,排除空行 及无关的既有变更。如果实现再次变化,重新计算。
不要针对同一个 workspace 和 DerivedData 位置并发运行 xcodebuild。如果默认
DerivedData 位置不可用,则使用外部临时目录,并在验证后删除。
# Build
xcodebuild build \
-workspace Easydict.xcworkspace \
-scheme Easydict | xcbeautify
# Test all tests
xcodebuild test \
-workspace Easydict.xcworkspace \
-scheme Easydict | xcbeautify
# Build for repeated test runs
xcodebuild build-for-testing \
-workspace Easydict.xcworkspace \
-scheme Easydict | xcbeautify
# Run a test suite after a compatible build-for-testing
xcodebuild test-without-building \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-only-testing:EasydictTests/<TestSuiteOrClass> | xcbeautify
# Run one test method
xcodebuild test-without-building \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-only-testing:EasydictTests/<TestSuiteOrClass>/<testMethod> | xcbeautify
如果已知变更对应的测试映射,使用 -only-testing:。如果映射不明确,则运行相关
的更大范围测试目标。
git diff --check。.xcstrings 或 JSON 数据(如适用)运行 jq -e .。bash -n。swiftformat --lint 或仓库现有格式化工具。