Files
cappuccino/Tools/Documentation/make_headers
T
Aparajita FishmanandTom Robinson 90a63e1b14 Fixes/enhancements to jake docs:
- We now have class hierarchy information! Don't remove generated headers before doxygen runs so it can generate class hierarchies. Now the headers are cleaned up separately.

- Added inline collapsible class hierarchy diagrams within each class.

- Enabled the built-in search! It's awesome!

- Changed image format to gif, dot is generated invalid png on Mac OS X.

- Explicitly turned off generation of to do and bug list.

- Turned off most warnings, most of them are useless warnings arising from the fact that we are pretending Objective-J is Objective-C.

- Doxyfile format updated to 1.7.1.
2010-08-13 15:42:43 -07:00

49 lines
1.2 KiB
Ruby
Executable File

#! /usr/bin/env ruby
@outputFiles = []
def makeHeaderFileFrom(fileName)
# Grab the entire file (text)
data = File.new(fileName).read
# Extract out all the "implementation" lines. Note, there may be
# more than on in a given .j file.
m = data.scan(/.*?(@implementation.*?\{.*?\})/m)
if m.length > 0
for i in 0...m.length
line = m[i][0]
# Skip category definitions
if not /.*?\(.*?\).*?\{/m.match(line)
# Extract the class name
m2 = line.scan(/.*?@implementation(.*?):.*/m)
if !m2.nil? && !m2[0].nil?
className = m2[0][0].strip()
# Change "implementation" to "interface", create the .h file, and write the interface
newLine = line.sub("implementation", "interface")
newFileName = File.dirname(fileName) + "/" + className + ".h"
f = File.new(newFileName, "w")
f.write(newLine + "\n@end")
f.close()
@outputFiles.push(newFileName)
end
end
end
end
end
fileList = Dir['AppKit/**/*.j'] + Dir['Foundation/**/*.j']
for fileName in fileList
makeHeaderFileFrom(fileName)
end
f = File.new(File.dirname(__FILE__) + "/header_files", "w")
f.write(@outputFiles.join("\n"))
f.close()