Correctly handle global properties. Correctly log
commit76e5dc334f067335ac4f3f21eb0e17ece0d821e0
authorankit <ankit@e3ebcda4-bce8-0310-ba0a-eca2169e7518>
Thu, 28 May 2009 23:22:02 +0000 (28 23:22 +0000)
committerankit <ankit@e3ebcda4-bce8-0310-ba0a-eca2169e7518>
Thu, 28 May 2009 23:22:02 +0000 (28 23:22 +0000)
tree307b16024da7b7c151635699a51020415efd429c
parent440547164ed5a23db3852c758418d39fdf91f57e
Correctly handle global properties. Correctly log
project/build events.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
Correctly handle global properties. Correctly log
project/build events.

* BuildPropertyGroup.cs (Clone): Implement.
* Engine.cs (globalProperties): Rename to ..
(global_properties): .. this.
(currentlyBuildingProjectsStack): New. Used to correctly
log and raise project/build start/finish events.
(BuildProjectFile): Override any project global properties
with explicitly specified ones, here in the param @globalProperties.
Mark project for reevaluation, which will update the engine's
global properties also.
Reset both engine and project's old global properties at the end.
(UnregisterAllLoggers): Log build finished only if we are currently
building.
(StartBuild): Rename to ..
(StartProjectBuild): .. this. Keeps track of the projects being built
in the new stack, and logs project and build events accordingly.
(EndProjectBuild): New. Uses the stack to keep track of projects
finishing builds, and raises project and build events accordingly.
(LogProjectStarted): Move here from Project.cs
(LogProjectFinished): Likewise.

* Project.cs (Build): Log start of project build.
Set current directory to the project file's dir, and reset at end.
(BuildInternal): Don't log here, its done in Build.
(BuildTarget): Already built targets are keyed by the set of global
properties that they were built with.
(GlobalPropertiesToString): New.
(ResetBuildStatus): 'building' must be true to allow built targets to be reset.
(RemoveBuiltTargets): Initialize builtTargetKeys in .ctor
(Evaluate): Remove built targets only if we are currently building and
build settings are None.
Merge project's global properties with those of the parent engine.
Add missing properties from engine's global properties.
(LogTargetSkipped): Fix format string, add the reqd argument.

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:

* EngineTest.cs (TestGlobalProperties*): New tests
and some helper methods.
* ProjectTest.cs (TestResetBuildStatus): Reset twice. Update
the event counts.

In class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks:

* TestMessageLogger.cs: Add counts for project/build start/finish
events.

git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@135019 e3ebcda4-bce8-0310-ba0a-eca2169e7518
class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs