mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
bugfix source file location.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14471 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b6f8a1abbc
commit
4e46a9170d
3 changed files with 79 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-09-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Tools/AGSParser.m: Bugfix ... look for source files more
|
||||||
|
intelligently. Try both current directory and relative to header.
|
||||||
|
|
||||||
2002-09-16 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-09-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSFileManager.m: Basic/dummy implementations of new MacOS-X
|
* Source/NSFileManager.m: Basic/dummy implementations of new MacOS-X
|
||||||
|
|
|
@ -787,11 +787,31 @@ fail:
|
||||||
[source removeAllObjects];
|
[source removeAllObjects];
|
||||||
if (isSource == NO)
|
if (isSource == NO)
|
||||||
{
|
{
|
||||||
|
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||||
|
NSString *path;
|
||||||
|
|
||||||
[info setObject: fileName forKey: @"Header"];
|
[info setObject: fileName forKey: @"Header"];
|
||||||
[source removeAllObjects];
|
[source removeAllObjects];
|
||||||
[source addObject:
|
|
||||||
[[[fileName lastPathComponent] stringByDeletingPathExtension]
|
/**
|
||||||
stringByAppendingPathExtension: @"m"]];
|
* 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.
|
||||||
|
*/
|
||||||
|
path = [fileName stringByDeletingPathExtension];
|
||||||
|
path = [path stringByAppendingPathExtension: @"m"];
|
||||||
|
if ([mgr isReadableFileAtPath: path] == NO)
|
||||||
|
{
|
||||||
|
path = [path lastPathComponent];
|
||||||
|
if ([mgr isReadableFileAtPath: path] == NO)
|
||||||
|
{
|
||||||
|
path = nil; // No default source file found.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (path != nil)
|
||||||
|
{
|
||||||
|
[source addObject: path];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
unitName = nil;
|
unitName = nil;
|
||||||
itemName = nil;
|
itemName = nil;
|
||||||
|
@ -2617,7 +2637,51 @@ fail:
|
||||||
if ([line length] > 0
|
if ([line length] > 0
|
||||||
&& [source containsObject: line] == NO)
|
&& [source containsObject: line] == NO)
|
||||||
{
|
{
|
||||||
[source addObject: line];
|
NSFileManager *mgr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See if the path given exists, and add it to
|
||||||
|
* the list of source files parsed for this
|
||||||
|
* header.
|
||||||
|
*/
|
||||||
|
mgr = [NSFileManager defaultManager];
|
||||||
|
if ([mgr isReadableFileAtPath: line] == NO)
|
||||||
|
{
|
||||||
|
if ([line isAbsolutePath] == YES)
|
||||||
|
{
|
||||||
|
[self log: @"AutogsdocSource: %@ not found!",
|
||||||
|
line];
|
||||||
|
line = nil;
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
[self log: @"AutogsdocSource: %@ not "
|
||||||
|
@"found (tried %@ too)!",
|
||||||
|
line, p];
|
||||||
|
line = nil;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
line = p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (line != nil)
|
||||||
|
{
|
||||||
|
[source addObject: line];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = NSMaxRange(r);
|
i = NSMaxRange(r);
|
||||||
r = NSMakeRange(i, commentLength - i);
|
r = NSMakeRange(i, commentLength - i);
|
||||||
|
|
|
@ -58,7 +58,12 @@
|
||||||
making the assumption that each .h file processed uses a .m file
|
making the assumption that each .h file processed uses a .m file
|
||||||
of the same name. You may supply multiple <code>AutogsdocSource</code>:
|
of the same name. You may supply multiple <code>AutogsdocSource</code>:
|
||||||
lines where a header file declares items which are defined in
|
lines where a header file declares items which are defined in
|
||||||
multiple source files.
|
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.
|
||||||
</item>
|
</item>
|
||||||
<item><strong><abstract></strong>
|
<item><strong><abstract></strong>
|
||||||
An abstract of the content of the document ... placed in the head
|
An abstract of the content of the document ... placed in the head
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue