Xcode 如何计算整个项目的代码行数
2024-10-21 03:34:24
参考链接:https://www.cnblogs.com/sunfuyou/p/7921538.html
1、打开终端
2、cd 空格 将工程的文件夹拖到终端上,回车,此时进入到工程的路径
此时已经进入到工程文件夹下
3、运行指令
(第一个方案:)
find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs wc -l 【最后一个字母是L不是数字1】
回车,执行--这条指令是获取每个文件内的代码行数,并在最后统计出一共的代码行数【注释也统计在代码量之内】
和文件内的代码行数对比一下:数目是正确的。
(第二个方案:)
find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs grep -v "^$"|wc -l
这条指令是获取代码总行数,去掉空行。grep -v "^$"是去掉空行。注释也统计在代码量之内。
还有其他的命令:
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l
-name "*.m" 就表示扩展名为.m的文件。
统计java文件和xml文件的命令分别是:
find . "(" -name "*.java" ")" -print | xargs wc -l
find . "(" -name "*.xml" ")" -print | xargs wc -l
最新文章
- C#设计模式系列:工厂方法模式(Factory Method)
- wikioi 2235 机票打折 【考查浮点数四舍五入的技巧】
- linux 分区
- python使用tesseract-ocr完成验证码识别(模型训练和使用部分)
- STL - priority_queue(优先队列)
- Python内置函数(41)——max
- 16.python-I/O模型
- zabbix监控概念
- c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0);
- [leetcode]156.Binary Tree Upside Down颠倒二叉树
- Tomcat8源码笔记(一)Lifecycle接口
- mysql-binlog_cache_size
- js获取变量的值
- bootstrap-table 应用
- 51CTO 资料汇总 截止20150504
- ThinkPHP项目笔记之函数篇
- 《Java程序设计》实验1实验报告
- 码云+jenkins+自动回复邮件
- YUV转为RGB24及IplImage格式(I420和YV12)及Java版实现
- convolutional neural network 课程笔记
热门文章
- CPL学习笔记(二)
- Linux - mkdir -p a/b/c
- paper:synthesizable finit state machine design techniques using the new systemverilog 3.0 enhancements之enhanced coding styles
- laravel中使用PHPQuery实现网页采集
- loc与iloc函数的使用
- (转)iOS平台UDID方案比较
- 查看 EGLIBC 版本
- poj 3281 Dining(网络流+拆点)
- splay模板三合一 luogu2042 [NOI2005]维护数列/bzoj1500 [NOI2005]维修数列 | poj3580 SuperMemo | luogu3391 【模板】文艺平衡树(Splay)
- 微信小程序开发 -- 获取当前页面路径