[webkit-dev] File splitter script

Eric Seidel eseidel at apple.com
Thu Feb 9 00:04:48 PST 2006

Maciej asked for me to submit my file-splitter script to Subversion  
so that others can more easily go about completing our task of  
splitting files out into one-per class.

The script "split-file-by-class" can be used to take a single file  
containing many classes, and make many files, each containing one  
class.  It automatically handles doing the proper svn copy/svn move  
commands for you.


split-file-by-class my_file_with_many_classes.h

You point it at the header, it does all the rest (including splitting  
the corresponding .cpp file).

There are still lots of things I'd like to add to it, like better  
handling of private classes, static functions, etc.  Right now it  
will copy any text not specifically bound to one class to every  
copied file.  (this means license headers, static functions, private  
classes, etc.)

My normal usage includes:

1.  Run the script.
2.  Remove all remaining headers from the .h files.
3.  Search over the entire project remove all uses of the old header  
4.  Iteratively try to compile, adding back in the new header name  
uses (and appropriate headers to the new split files).


More information about the webkit-dev mailing list