Bugs item #1191285, was opened at 2005-04-27 22:34
Message generated for change (Comment added) made by drieseng
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1191285&group_id=31650

>Category: Tasks
>Group: 0.85
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Robert Blum (rblum)
>Assigned to: Gert Driesen (drieseng)
Summary: CL task rebuilds too many files

Initial Comment:
The update-check for CL is a bit too generous - if
*any* of the submitted .cpp files are out of date with
respect to their header, *all* of them are rebuilt.

This is not a problem were I call [cl] by hand, but the
solution task submits batches of files based on
configuration groups. If all  files share the same
build configuration, having a single one of them out of
date causes all of them to be rebuilt..

I.e. you have 90 files including foo.h, 1 file
including bar.h. All CPP files share same config. Touch
bar.h, get 91 compiles (instead of 1)

I'm resorting to evil hackery to fix this for now
(deadlines and all)

In ClTask.cs, add a private member for outdated files:

                private StringCollection _OutdatedFileNames;

Then, in ExecuteTask, use that instead of
Sources.Filenames, with some special handling thrown in
for PCHs

                        _OutdatedFileNames = new StringCollection();

            if (NeedsCompiling()) {

                                // If we need compiling, but Outdate File
collection is empty, 
                                // it's PCH stuff - mark all files as outdated
                                if( _OutdatedFileNames.Count == 0 ) {
                                        Log(Level.Verbose, "PCH out of date, 
recompiling
all.");
                                        _OutdatedFileNames = Sources.FileNames;
                                }

                Log(Level.Info, "Compiling {0} files to
'{1}'.", 
                    _OutdatedFileNames.Count,
OutputDir.FullName);
 

.... lots of ExecuteTask code ... then, building the
list of files in ExecuteTask

                    // write each of the filenames
                    //foreach (string filename in
Sources.FileNames) {
                                        foreach (string filename in 
_OutdatedFileNames ) {
                       
writer.WriteLine(QuoteArgumentValue(filename));
                    }


... And finally, a modified AreObjsUpToDate that
collects all outdated cpp files

        private bool AreObjsUpToDate() {
            foreach (string filename in
Sources.FileNames) {
                // if the source file does not exist,
then we'll consider it
                // not up-to-date
                if (!File.Exists(filename)) {
                    Log(Level.Verbose, "'{0}' does not
exist, recompiling.", 
                        filename);
                                        _OutdatedFileNames.Add( filename );     
                                        
                }

                if (!IsObjUpToDate(filename)) {
                                        _OutdatedFileNames.Add( filename );     
                                        
                                }

            }
                        
                        // If we didn't have any outdated files, the OBJs
are up to date
                        return ( _OutdatedFileNames.Count ==0 );
                }




----------------------------------------------------------------------

>Comment By: Gert Driesen (drieseng)
Date: 2005-05-04 11:44

Message:
Logged In: YES 
user_id=707851

This is now fixed in cvs.

Thanks for the report !

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1191285&group_id=31650


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to