Dependency handling improvement

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13028 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-03-06 18:11:55 +00:00
parent d533f8ae5f
commit d44bc0a85d
4 changed files with 49 additions and 36 deletions

View file

@ -482,6 +482,34 @@ main(int argc, char **argv, char **env)
mgr = [NSFileManager defaultManager];
/*
* Load any old project indexing information and determine when the
* indexing information was last updated (never ==> distant past)
*/
refsFile = [documentationDirectory
stringByAppendingPathComponent: project];
refsFile = [refsFile stringByAppendingPathExtension: @"igsdoc"];
projectRefs = [AGSIndex new];
originalIndex = nil;
rDate = [NSDate distantPast];
if ([mgr isReadableFileAtPath: refsFile] == YES)
{
originalIndex
= [[NSDictionary alloc] initWithContentsOfFile: refsFile];
if (originalIndex == nil)
{
NSLog(@"Unable to read project file '%@'", refsFile);
}
else
{
NSDictionary *dict;
[projectRefs mergeRefs: originalIndex override: NO];
dict = [mgr fileAttributesAtPath: refsFile traverseLink: YES];
rDate = [dict objectForKey: NSFileModificationDate];
}
}
count = [sFiles count];
if (count > 0)
{
@ -563,13 +591,10 @@ main(int argc, char **argv, char **env)
AUTORELEASE(RETAIN(sDate));
}
/*
* FIXME work out dependencies for .m files.
* for the moment, hack in an assumption that the .h simply
* depends on the corresponding .m
* Ask existing project info (.gsdoc file) for dependency
* information. Then check the dates on the source files.
*/
a = [NSArray arrayWithObject:
[[[hfile lastPathComponent] stringByDeletingPathExtension]
stringByAppendingPathExtension: @"m"]];
a = [projectRefs sourcesForHeader: hfile];
for (i = 0; i < [a count]; i++)
{
NSString *sfile = [a objectAtIndex: i];
@ -619,6 +644,14 @@ main(int argc, char **argv, char **env)
[parser parseFile: hfile isSource: NO];
a = [parser source];
/*
* Record dependency information.
*/
if ([a count] > 0)
{
[projectRefs setSources: a forHeader: hfile];
}
for (i = 0; i < [a count]; i++)
{
NSString *sfile = [a objectAtIndex: i];
@ -688,34 +721,6 @@ main(int argc, char **argv, char **env)
DESTROY(output);
}
/*
* Load any old project indexing information and determine when the
* indexing information was last updated (never ==> distant past)
*/
refsFile = [documentationDirectory
stringByAppendingPathComponent: project];
refsFile = [refsFile stringByAppendingPathExtension: @"igsdoc"];
projectRefs = [AGSIndex new];
originalIndex = nil;
rDate = [NSDate distantPast];
if ([mgr isReadableFileAtPath: refsFile] == YES)
{
originalIndex
= [[NSDictionary alloc] initWithContentsOfFile: refsFile];
if (originalIndex == nil)
{
NSLog(@"Unable to read project file '%@'", refsFile);
}
else
{
NSDictionary *dict;
[projectRefs mergeRefs: originalIndex override: NO];
dict = [mgr fileAttributesAtPath: refsFile traverseLink: YES];
rDate = [dict objectForKey: NSFileModificationDate];
}
}
count = [gFiles count];
if (count > 0)
{