Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import os
# go through the whole folder, and add all directories, that contain sourcecode
# Which directories to scan
directories = ("MyFantasticProject", "External", "libs")
def find_all_source_directories(parentDir):
def directories_contains_source(files):
for f in files:
if f.split(".")[-1] in ("h", "m", "mm", "c"):
return True
return False
returnList = []
for (path, dirs, files) in os.walk(parentDir):
if directories_contains_source(files):
returnList.append(path)
return returnList
def format_directories(directories):
return "\n".join(['-I"%s"' % (p,) for p in directories])
if __name__ == "__main__":
codeDirs = []
for dir in directories:
codeDirs = codeDirs + find_all_source_directories(dir)
print format_directories(codeDirs)
@yoyokko

This comment has been minimized.

Show comment
Hide comment
@yoyokko

yoyokko Jan 6, 2014

Thanks for your blog to config vim for iOS development. And I wrote a script to generate the .clang_complete file here.
https://github.com/yoyokko/Tools/blob/master/clang_complete/clang_complete.py

yoyokko commented Jan 6, 2014

Thanks for your blog to config vim for iOS development. And I wrote a script to generate the .clang_complete file here.
https://github.com/yoyokko/Tools/blob/master/clang_complete/clang_complete.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment