|
|
XCode - Get Line Number Count
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
How do I get the number of lines in an entire project?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Do a project-wide search for "\n"?
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Doesn't seem to work, and also there must be a better way. I think I remember Codewarrior being able to do this easily.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Feb 2004
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status:
Offline
|
|
I don't know about Xcode, but I use this command line combo to get the line count of a folder full of files:
Code:
cd MyProjectFolder
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" ")" -print | xargs wc -l
This will work recursively, and you can, of course, include whatever file extensions you want to count the lines of. You could probably also whip up a similar command using Spotlight via mdfind.
I agree this should really be a feature in Xcode though.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
A bit simpler, and searching all files withing a directly, and counting all instances of newlines is:
Code:
grep -d recurse "\n" path-to-parent-directory | wc -l
I just made this up, and haven't tested it much, but it seems to produce output that might be accurate I got 9096 lines for one of my small shareware projects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|