git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14475 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-09-17 11:29:51 +00:00
parent 8b72e1dcc2
commit 96c50773f8
2 changed files with 70 additions and 27 deletions

View file

@ -796,7 +796,8 @@ fail:
/**
* We initially assume that the location of a source file is the
* same as the header, but if there is no file at that location,
* we expect the source to be in the current directory instead.
* we expect the source to be in the documentatation directory
* or the current directory instead.
*/
path = [fileName stringByDeletingPathExtension];
path = [path stringByAppendingPathExtension: @"m"];
@ -805,7 +806,23 @@ fail:
path = [path lastPathComponent];
if ([mgr isReadableFileAtPath: path] == NO)
{
path = nil; // No default source file found.
NSUserDefaults *defs;
NSString *ddir;
defs = [NSUserDefaults standardUserDefaults];
ddir = [defs stringForKey: @"DocumentationDirectory"];
if ([ddir length] > 0)
{
path = [ddir stringByAppendingPathComponent: path];
if ([mgr isReadableFileAtPath: path] == NO)
{
path = nil; // No default source file found.
}
}
else
{
path = nil; // No default source file found.
}
}
}
if (path != nil)
@ -2645,36 +2662,60 @@ fail:
* header.
*/
mgr = [NSFileManager defaultManager];
if ([mgr isReadableFileAtPath: line] == NO)
if ([line isAbsolutePath] == YES)
{
if ([line isAbsolutePath] == YES)
if ([mgr isReadableFileAtPath: line] == NO)
{
[self log: @"AutogsdocSource: %@ not found!",
line];
line = nil;
}
else
{
NSString *p;
}
else
{
NSString *p;
/*
* Try forming a path relative to the
* header file if the source file was not
* found in the specified location.
*/
p = [info objectForKey: @"Header"];
p = [p stringByDeletingLastPathComponent];
p = [p stringByAppendingPathComponent: line];
if ([mgr isReadableFileAtPath: p] == NO)
/*
* Try forming a path relative to the header.
*/
p = [info objectForKey: @"Header"];
p = [p stringByDeletingLastPathComponent];
p = [p stringByAppendingPathComponent: line];
if ([mgr isReadableFileAtPath: p] == YES)
{
line = p;
}
else if ([mgr isReadableFileAtPath: line] == NO)
{
NSUserDefaults *defs;
NSString *ddir;
NSString *old = p;
defs = [NSUserDefaults standardUserDefaults];
ddir = [defs stringForKey:
@"DocumentationDirectory"];
if ([ddir length] > 0)
{
[self log: @"AutogsdocSource: %@ not "
@"found (tried %@ too)!",
line, p];
line = nil;
p = [ddir stringByAppendingPathComponent:
line];
if ([mgr isReadableFileAtPath: p] == YES)
{
line = p;
}
else
{
[self log: @"AutogsdocSource: %@ not "
@"found (tried %@ and %@ too)!",
line, old, p];
line = nil;
}
}
else
{
line = p;
[self log: @"AutogsdocSource: %@ not "
@"found (tried %@ too)!",
line, old];
line = nil;
}
}
}

View file

@ -29,9 +29,10 @@
<p>
The simple way to use this is to run the command with one or more
header file names as arguments ... the tool will automatically
parse corresponding source files in the same directory (or the
directory specified using the DocumentationDirectory default),
and produce gsdoc files as output.<br />
parse corresponding source files in the same directory as the
headers (or the current directory, or the directory specified
using the DocumentationDirectory default), and produce gsdoc
files as output.
</p>
<p>
Even without any human assistance, this tool will produce skeleton
@ -61,9 +62,10 @@
multiple source files.<br />
If a file name is absolute, it is used just as supplied.<br />
If on the other hand, it is a relative path, the software looks for
the source file first relative to the direcotory in which autogsdoc
is running and then, if not found there, relative to the directory
in which the header file is located.
the source file first relative to the location of the header file,
and if not found there, relative to the current directory in which
autogsdoc is running, and finally relative to the directory
specified by the DocumentationDirectory default.
</item>
<item><strong>&lt;abstract&gt;</strong>
An abstract of the content of the document ... placed in the head