0
A
回答
2
这是完整的设置!请注意,这也会产生Xcode错误。 :)
#!/bin/bash
searchString=`cat license.txt`
ERROR_COUNT=0
while read file
do
grep -F "${searchString}" $file > /dev/null
if [ $? -ne 0 ]; then
echo -e $file:1: error : No valid License Header found! 1>&2
ERROR_COUNT=1
fi
done < <(find . -type d \(-name "TTTAttributedLabel" -o -name "minizip" -o -name "SSZipArchive" \) -prune -o -type f \(-name "*.m" -o -name "*.h" -o -name "*.pch" \) -print)
exit $ERROR_COUNT
这里是如何设置的脚本: Xcode: Running a script before every build that modifies source code directly
如何在Xcode中报告错误: http://shazronatadobe.wordpress.com/2010/12/04/xcode-shell-build-phase-reporting-of-errors/
1
那么我不知道这是否是正确的答案,但您可以添加一个shell脚本到您的构建阶段,它可以检查项目中有效许可证标题(通过grep +正则表达式)中的文件。
相关问题
- 1. 软许可证检查
- 2. 许可证检查循环?
- 3. 更改Xcode中的默认标题注释许可证
- 4. 许可证问题:GPL版权标题
- 5. Xcode中的Cocoapod许可证
- 6. 多久检查一次许可证?
- 7. 执行前的许可证检查
- 8. 使用Python检查FME许可证
- 9. 创建和检查许可证编号
- 10. Corona SDK Google Play许可证检查
- 11. Android的许可证检查关闭
- 12. 自动添加许可证标题
- 13. HomeKit:检查许可
- 14. 如何接受Xcode许可证?
- 15. xcode设备安装问题(我有许可证)
- 16. gpl许可证问题
- 17. Oracle Coherence许可证问题
- 18. ikvm.net的许可证问题?
- 19. 许可证文件问题
- 20. Xcode:表格检查标记
- 21. 验证没有布尔检查的许可证信息?
- 22. 安全软件许可证检查/验证
- 23. 带有效许可证的JDataConnect许可证问题
- 24. 屡查jxbrowser许可证
- 25. 执行许可检查库
- 26. Android的检查许可
- 27. 检查窗口标题是否可见
- 28. OAuth在UWP PlayReady许可证检索
- 29. 许可证密钥模式检测?
- 30. php检查许可证ID与回发URL
谢谢,我不知道这是可能的。一旦我把所有的东西都运转起来,我会回来。 – dominik