private bool NeedsCompiling(FileInfo licensesFile)
{
if (!licensesFile.Exists) {
Log(Level.Verbose, ResourceUtils.GetString("String_OutputFileDoesNotExist"),
licensesFile.FullName);
return true;
}
// check if assembly references were updated
string fileName = FileSet.FindMoreRecentLastWriteTime(Assemblies.FileNames, licensesFile.LastWriteTime);
if (fileName != null) {
Log(Level.Verbose, ResourceUtils.GetString("String_FileHasBeenUpdated"),
fileName);
return true;
}
// check if input file was updated
if (InputFile != null) {
fileName = FileSet.FindMoreRecentLastWriteTime(InputFile.FullName, licensesFile.LastWriteTime);
if (fileName != null) {
Log(Level.Verbose, ResourceUtils.GetString("String_FileHasBeenUpdated"),
fileName);
return true;
}
}
// if we made it here then we don't have to recompile
return false;
}