Skip to content

Commit

Permalink
Update xbuild and Microsoft.Build.* libs from trunk.
Browse files Browse the repository at this point in the history
In tools/xbuild:
2009-05-20  Jonathan Chambers  <joncham@gmail.com>

	* SolutionParser.cs (ParseSolution): Ignore vcproj projects in solutions 
	and issue warning. 

2009-04-27  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.VisualBasic.targets: Update to use
	CreateVisualBasicManifestResourceName task, and fix compiler params.

2009-04-25 Daniel Nauck <dna@mono-project.de>

	Fix bug #484649:
	* LoggerInfo.cs: fixed the parsing of the /logger: argument as described in
	http://msdn.microsoft.com/en-us/library/ms164311.aspx
	Added logger class detection if it's not explicit specified in the argument.

2009-03-19  Ankit Jain  <jankit@novell.com>

	Fix bug #484773.
	* Main.cs (Execute): Check whether the project file exists or not.
	* Parameters.cs (ParseArguments): Handle absolute paths too.

2009-03-13  Ankit Jain  <jankit@novell.com>

	* Main.cs (Execute): Build the project/sln with current directory set to
	the project file's dir.
	* SolutionParser.cs (ParseSolution): Project paths are relative to
	solution directory.

2009-03-06  Ankit Jain  <jankit@novell.com>

	Fix bug #481336.
	* SolutionParser.cs (AddWarningForMissingProjectConfiguration): New.
	(AddProjectTargets): Emit warning for missing project configurations.

2009-02-26  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.CSharp.targets (Csc): Fix "Resources" argument to use
	ManifestNonResxWithCultureOnDisk instead of ManifestResourceWithNoCultureOnDisk.

2009-02-26  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.Common.targets: Make targets extensible. Add
	before/after hooks.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.Common.targets: Use obj/$(Config) as the default intermediate
	output path, instead of just obj/

2009-02-25  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.Common.targets (CopyNonResxEmbeddedResources): New.
	(GenerateSatelliteAssemblies): Update to use the new ManifestNonResxWithCultureOnDisk
	instead of NonResxWithCulture.
	* xbuild/Microsoft.CSharp.targets (Csc): Fix "Resources" argument to use
	the new on disk file names instead of original filenames.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* xbuild/Microsoft.Common.targets (GetTargetPath): Add a path separator.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* SolutionParser.cs (ParseSolution): Report warning instead of error
	for unknown global sections.

2009-02-21  Ankit Jain  <jankit@novell.com>

	* xbuild/xbuild.rsp: Add descriptive comments.

2009-02-21  Ankit Jain  <jankit@novell.com>

	* Parameters.cs (LoadResponseFile): Handle comments.

2009-02-20  Ankit Jain  <jankit@novell.com>

	* SolutionParser.cs (ParseSolution): Ignore solution folders.

2009-02-20  Ankit Jain  <jankit@novell.com>

	* SolutionParser.cs (ParseSolution): Ignore GlobalSection named
	'NestedProjects'.

2009-02-20  Ankit Jain  <jankit@novell.com>

	* SolutionParser.cs (ParseProjectConfigurationPlatforms): Report missing
	project guids as Warnings and not errors. Report every missing guid only
	once.

2009-02-20  Ankit Jain  <jankit@novell.com>

	* SolutionParser.cs (projectRegex): Use '\s' to match whitespace.

2009-02-19  Jonathan Chambers  <joncham@gmail.com>

	* xbuild.csproj: Add.
	* xbuild.sln: Add.

2009-02-13  Jonathan Chambers  <joncham@gmail.com>

	* SolutionParser.cs: Make Guid Regex case insensitive.
	Handle project dependencies. The solution has explicit
	dependencies, but we have to open projects for implicit
	dependencies (via ProjectReferences).

2009-02-13  Jonathan Chambers  <joncham@gmail.com>

	* Main.cs: Add support for .sln files.
	* SolutionParser.cs: Class for generating project file
	from solution file.
	* xbuild.exe.sources: Added SolutionParser.cs.

2009-02-02  Ankit Jain  <jankit@novell.com>

	* Microsoft.CSharp.targets: Add targets to generate resource ids.
	* Microsoft.Common.targets: Add targets for generating resources,
	generate and deploy satellite assemblies, resolve project and assembly
	references. All intermediate build output goes into a 'obj/' dir by
	default. 'Clean' target enabled.

In class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks:
2009-05-29  Ankit Jain  <jankit@novell.com>

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

2009-04-27  Ankit Jain  <jankit@novell.com>

	* CreateVisualBasicManifestResourceNameTest.cs: New.

2009-03-03  Ankit Jain  <jankit@novell.com>

	* CscTest.cs (DefineConstants): Add some extra semi-colons,
	that should get removed on output.
	(DefineConstants2): New. Test effectively empty define constants.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* CreateCSharpManifestResourceNameTest.cs (CheckResourceNames):
	Refactor a bit to improve error reporting.
	Update to use Path.Combine instead of hardcoding "\".

2009-02-24  Ankit Jain  <jankit@novell.com>

	* TestMessageLogger.cs (CheckLoggedMessageHead): Move here from
	* TaskBatchingTest.cs: .. here. Track api change.

2009-02-21  Ankit Jain  <jankit@novell.com>

	* CopyTest.cs: New.

2009-01-31  Ankit Jain  <jankit@novell.com>

	* TaskBatchingTest.cs (*): Add tests for target/task events.
	(TestTargetBatching*): New tests for target batching.
	* TestMessageLogger.cs: Add counts for target/task started/finished
	events.
	(NormalMessageCount): New.

In class/Microsoft.Build.Tasks/Test/resources:
2009-04-27  Ankit Jain  <jankit@novell.com>

	* Sample.vb: New.

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2009-04-27  Ankit Jain  <jankit@novell.com>

	* CreateCSharpManifestResourceName.cs (GetResourceIdFromFileName): Move
	to ..
	* CreateManifestResourceName.cs: .. here.
	* CreateVisualBasicManifestResourceName.cs: Implement.

2009-04-27  Ankit Jain  <jankit@novell.com>

	* Vbc.cs (AddResponseFileCommands): Escape DefineConstants as it can
	contain double quotes itself. Fix /doc switch.
	(EscapeDoubleQuotes): New.

2009-03-22  Daniel Nauck  <dna@mono-project.de>

	* GenerateResource.cs: Set BasePath property of
		ResXResourceReader class.
		See: http://lists.ximian.com/pipermail/mono-devel-list/2009-March/031459.html

2009-03-19  Ankit Jain  <jankit@novell.com>

	Fix bugs #323833 and #484384.
	* AssemblyResolver.cs (GatherGacAssemblies): Handle duplicate entries.
	These seem to be old copies of the assemblies with old keys. Pick
	the one with the latest timestamp.

2009-03-03  Ankit Jain  <jankit@novell.com>

	Fix bug #480856.
	* Csc.cs (AddResponseFileCommands): Split DefineConstants on ';'.

2009-02-26  Ankit Jain  <jankit@novell.com>

	* MakeDir.cs (Execute): Don't create+log if dir already exists.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* AL.cs (Execute): Use ToolTask.Execute instead of doing our own.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* AssemblyResolver.cs:
	* ResolveAssemblyReference.cs: Honor SpecificVersion. Emit detailed error
	messages incase assembly resolution fails. Make specific version
	strict.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* ManagedCompiler.cs (AddResponseFileCommands): Use LogicalName for
	embedded resources, wherever available.
	* CreateCSharpManifestResourceName.cs (GetResourceIdFromFileName): Use
	Path.Combine instead of hardcoding "\".

2009-02-25  Ankit Jain  <jankit@novell.com>

	* MSBuild.cs (Execute): Reset current directory back after every
	project's execution.

2009-02-21  Ankit Jain  <jankit@novell.com>

	Fix bug #458916.
	* Copy.cs: CopiedFiles and DestinationFiles should have target paths
	instead of source. Also, the metadata should get retained from source
	items. Based on a patch by Jeffrey Richardson <themann@indyfantasysports.net>
	Refactor a bit to remove code duplication.

2009-02-21  Ankit Jain  <jankit@novell.com>

	* MSBuild.cs (SplitPropertiesToDictionary): Split into exactly 2 parts.

2009-02-11  Leszek Ciesielski <skolima@gmail.com>

	* ResolveAssemblyReference.cs : AllowedRelatedFileExtensions stub

2009-02-02  Ankit Jain  <jankit@novell.com>

	* MSBuild.cs (Execute): Disable incorrect 'rebaseOutputs' behavior.

2009-02-02  Ankit Jain  <jankit@novell.com>

	* ResolveAssemblyReference.cs: Honor SearchPaths and the special
	items like '{HintPathFromItem}', '{TargetFrameworkDirectory}' etc.
	* AssemblyResolver.cs: Add api for more specific search, like search
	in a directory, target frameworks, gac etc.

2009-02-01  Ankit Jain  <jankit@novell.com>

	* CallTarget.cs: Copy all items from target to TargetOutputs.

2009-02-01  Ankit Jain  <jankit@novell.com>

	* Csc.cs (AddResponseFileCommands):
	* ManagedCompiler.cs (AddResponseFileCommands): 'AddModules' and
	'AdditionalLibPaths' can be empty.

2009-01-30  Ankit Jain  <jankit@novell.com>

	* Copy.cs (Execute): Use for loop instead of enumerators.
	sourceFiles and destinationFiles can be null, handle that.
	Create new directory if required.

2009-01-27  Ankit Jain  <jankit@novell.com>

	* Delete.cs (Execute): Skip non-existant files.

In class/Microsoft.Build.Tasks:
2009-05-14  Ankit Jain  <jankit@novell.com>

	Fix tests on monobuild
	* Makefile (EXTRA_DISTFILES): Add Test/resources/Sample.vb

2009-04-28  Raja R Harinath  <harinath@hurrynot.org>

	* Makefile (NAME_SUFFIX): New.
	(LIBRARY_NAME): Use it.
	(TEST_MCS_FLAGS): Don't mention name of library.  Use NAME_SUFFIX
	as appropriate when referring to other msbuild dlls.

2009-04-27  Ankit Jain  <jankit@novell.com>

	* Microsoft.Build.Tasks_test.dll.sources: Added
	CreateVisualBasicManifestResourceNameTest.cs .

2009-04-25  Jonathan Chambers  <joncham@gmail.com>

	* Makefile: Adjust assembly name for 3.5 profile.

2009-02-21  Ankit Jain  <jankit@novell.com>

	* Microsoft.Build.Tasks_test.dll.sources: Added CopyTest.cs

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-05-29  Ankit Jain  <jankit@novell.com>

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

2009-05-15  Marek Sieradzki  <marek.sieradzki@gmail.com>

	* BuildItemTest.cs:
	* BuildPropertyGroupTest.cs:
	* BuildPropertyGroupCollectionTest.cs:
	* BuildPropertyTest.cs:
	* BuildItemGroupTest.cs:
	* EngineTest.cs:
	* InternalLoggerExceptionTest.cs:
	* ProjectTest.cs: Don't compare exception messages.

2009-05-12  Ankit Jain  <jankit@novell.com>

	* ProjectTest.cs (TestAssignment1):
	* UsingTaskTest.cs (TestTaskName):
	(TestAssemblyNameOrAssemblyFile1):
	(TestAssemblyNameOrAssemblyFile2): Don't compare exception messages. 

2009-03-27  Jonathan Chambers  <joncham@gmail.com>

	* BuildChooseTest.cs: Enable tests.
	* Microsoft.Build.Engine.Test.csproj: Update post build step.

2009-03-26  Jonathan Chambers  <joncham@gmail.com>

	* BuildTaskTest.cs (TestTaskInNamespace): Add test for Task in namespace.

2009-02-24  Ankit Jain  <jankit@novell.com>

	* UsingTaskTest.cs (TestLazyLoad{1,2,3}): New.
	(TestAssemblyNameOrAssemblyFileConditionFalse): New.
	(TestDuplicate1): New.
	* TargetTest (CheckLoggedMessageHead): Moved to TestMessageLogger,
	use that.

2009-02-15  Jonathan Chambers  <joncham@gmail.com>

	* BuildChooseTest.cs (TestValueXml): Add tests for Choose.
	Currently not working.

2009-02-12  Jonathan Chambers  <joncham@gmail.com>

	* BuildPropertyTest.cs (TestValueXml): New.

2009-02-01  Ankit Jain  <jankit@novell.com>

	* ProjectTest.cs (TestBuild[23]): Check number of task started/finished
	events.
	(TestResetBuildStat): Remove "NotWorking".
	(TestBuild4): Likewise. Check number of task started/finished events.

	* TargetTest.cs (TestTargetOutputs1): New.

2009-01-30  Ankit Jain  <jankit@novell.com>

	* ProjectTest.cs (TestRequiredTask_*): New.
	(TestBatchedMetadataRef5): New.

2009-01-29  Ankit Jain  <jankit@novell.com>

	* BuildItemTest.cs (TestBuildItemTransform): New.

In class/Microsoft.Build.Engine/Test/various:
2009-05-29  Ankit Jain  <jankit@novell.com>

	* Conditions.cs (TestHasTrailingSlash1): New.
	(TestUnknownFunction): New.

2009-05-15  Marek Sieradzki  <marek.sieradzki@gmail.com>

	* Items.cs
	* Conditions.cs: Don't check exception messages.

2009-02-23  Ankit Jain  <jankit@novell.com>

	* Items.cs (TestItemsInTarget8): New.
	(TestItemsInTarget9): New.

2009-02-20  Ankit Jain  <jankit@novell.com>

	* Conditions.cs (TestCondition11): New. Test unquoted item/property
	references in conditions.

In class/Microsoft.Build.Engine/Test/resources:
2009-03-26  Jonathan Chambers  <joncham@gmail.com>

	* TestTasks.cs (NamespacedOutputTestTask): New.

2009-02-24  Ankit Jain  <jankit@novell.com>

	* TestTasks.cs (Another.SameTask): New.
	(Other.SameTask): New.

2009-01-30  Ankit Jain  <jankit@novell.com>

	* TestTasks.cs (RequiredTestTask): Rename to ..
	(RequiredTestTask_TaskItems): .. this.
	(RequiredTestTask_*): New types.

2009-01-29  Ankit Jain  <jankit@novell.com>

	* TestTasks.cs (BatchingTestTask.TaskItemsOutput): New.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-05-29  Ankit Jain  <jankit@novell.com>

	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.

2009-05-29  Ankit Jain  <jankit@novell.com>

	* ConditionFunctionExpression.cs: Add 'HasTrailingSlash' function.
	(HasTrailingSlash): New.

2009-05-12  Ankit Jain  <jankit@novell.com>

	* Project.cs (.ctor): Init timeOfLastDirty.

2009-05-05  Miguel de Icaza  <miguel@novell.com>

	* Contribution from Martin Brenn to fix #498154.

2009-04-27  Ankit Jain  <jankit@novell.com>

	Fix bug #497839.
	* Engine.cs (BuildProjectFile): Set project's GlobalProperties to the
	one passed as argument.

2009-04-27  Ankit Jain  <jankit@novell.com>

	* TaskEngine.cs (Prepare): Emit a useful error message property value
	can't be converted to required type.

2009-04-27  Ankit Jain  <jankit@novell.com>

	* ExpressionCollection.cs (ConvertToObject): Allow true/on/yes
	as valid true values for bool, and corresponding for false.

2009-03-27  Jonathan Chambers  <joncham@gmail.com>

	* BuildWhen.cs: Add basic implementation.
	* BuildChoose.cs: Add basic implementation.
	* BuildItem.cs (AddEvaluatedItem): Add BuiltItem to 
	EvaluatedItemsIgnoringCondition.
	* GroupingCollection.cs: Add evaluation of BuildChoose items.

2009-03-26  Jonathan Chambers  <joncham@gmail.com>

	* TaskDatabase.cs (RegisterTask): Search for class by name
	if task was not found using GetType (which uses namespace). 

2009-02-26  Ankit Jain  <jankit@novell.com>

	* Target.cs: Handle target with no tasks. Log errors.

2009-02-24  Ankit Jain  <jankit@novell.com>

	Lazily load UsingTask tasks.
	* UsingTask.cs (Evaluate): Register 'this' with task database,
	but don't load it yet. Register only if condition evaluates to true.
	Move the load logic to ..
	(Load): .. here. Register with the specified task database.
	* TaskDatabase.cs (RegisterUsingTask): Store the UsingTask instance
	in a table keyed by task name, but don't load it yet.
	(GetTypeFromClassName): Try to load UsingTask if task is not already
	loaded. Move loading logic to ..
	(GetTypeFromClassNameInternal): .. here.
	(CopyTasks): Copy the usingTasks table also.

2009-02-23  Ankit Jain  <jankit@novell.com>

	* BuildItem.cs (AddMetadata): Allow overwriting older values.

2009-02-22  Ankit Jain  <jankit@novell.com>

	* BuildItem.cs: Iterate over XmlElements childnodes with XmlNode
	instead of XmlElement. Eg. XmlComment

2009-02-21  Ankit Jain  <jankit@novell.com>

	* Utilities.cs (FromMSBuildPath): Copy from monodevelop.
	* Project.cs (Load): Use FromMSBuildPath on the path.
	(InitializeProperties): Set "MSBuildToolsPath" also.

2009-02-20  Ankit Jain  <jankit@novell.com>

	Fix #449683.
	* ConditionTokenizer.cs: Handle unquoted item references (with or w/o
	transforms) in conditions.
	* ConditionParser.cs: Parse unquoted item, property references.
	eg. Condition = " @(Foo->'%(Extension)') == '.exe' "
	* Token.cs (Token.ToString): Override.
	(TokenType.Transform): Uncomment.

2009-02-12  Jonathan Chambers  <joncham@gmail.com>

	* BuildProperty.cs: Value corresponds to XmlElement.InnerXml
	no XmlElement.InnerText. This allows properties to be additional 
	xml elements.

2009-02-01  Ankit Jain  <jankit@novell.com>

	* BuildEngine.cs (BuildProjectFile): Use
	BuildSettings.DoNotResetPreviouslyBuiltTargets for building projects.
	* Engine.cs (BuiltTargetsOutputByName): New. Table of targets already
	built. Move logging of project start/finish to ..
	* Project.cs: .. here. Build a target only if hasn't been built already.
	Keep track of target outputs, and return those even if an already built
	target has been invoked again.
	Honor BuildSettings.None and DoNotResetPreviouslyBuiltTargets .

2009-01-31  Ankit Jain  <jankit@novell.com>

	* BatchingImpl.cs: Split into ..
	* BatchingImplBase.cs: .. this,
	* TaskBatchingImpl.cs: .. this ..
	* TargetBatchingImpl.cs: .. and this. Implement target batching here.

	* Target.cs (DoBuild): Use TargetBatchingImpl for building.
	(Log*): Move to TargetBatchingImpl .
	(BuildTasks): New.
	(Engine): New.

2009-01-30  Ankit Jain  <jankit@novell.com>

	* TaskEngine.cs (GetObjectFromString): Empty value is allowed only for
	arrays.

2009-01-29  Ankit Jain  <jankit@novell.com>

	* BuildItem.cs (child_items): Change type from BuildItemGroup to
	List<BuildItem>.
	(HasParent): Rename to ..
	(HasParentItem): .. this.
	(ParentItemGroup): Add setter.

	* BuildItemGroup.cs (.ctor): Add overload with @project param.
	(AddNewItem):
	(AddItem): Correctly set the ParentItemGroup for new build items.
	(ParentProject): Add setter.
	* Project.cs: Set the project for new BuildItemGroup instances.
	* TaskEngine.cs (PublishItemGroup): Likewise.

In class/Microsoft.Build.Engine:
2009-02-21  Ankit Jain  <jankit@novell.com>

	* Import.cs (GetFullPath): Use Utilities.FromMSBuildPath .

2009-02-19  Jonathan Chambers  <joncham@gmail.com>

	* Microsoft.Build.Engine.csproj: Add.
	* Microsoft.Build.Engine.Test.csproj: Update.

2009-01-31  Ankit Jain  <jankit@novell.com>

	* Microsoft.Build.Engine_test.dll.sources: Replace BatchingImpl.cs with
	BatchingImplBase.cs, TargetBatchingImpl.cs and TaskBatchingImpl.cs

In class/Microsoft.Build.Utilities:
2009-04-25  Jonathan Chambers  <joncham@gmail.com>

	* Makefile: Adjust assembly name for 3.5 profile.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* Microsoft.Build.Utilities.dll.sources: Add ProcessService.cs,
	ProcessWrapper.cs, IAsyncOperation.cs and IProcessAsyncOperation.cs

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-04-24  Ankit Jain  <jankit@novell.com>

	* ToolTask.cs (RealExecute): Handle TypeLoadExceptions, compiler
	crashes and report them. Borrow some tricks from md.
	(LogEventsFromTextOutput): Ignore known non-error messages. Don't
	log unknown lines, crashes get handled elsewhere.

2009-04-08  Ankit Jain  <jankit@novell.com>

	Fix bug #491828.
	* ToolTask.cs (LogEventsFromTextOutput): Log even in case of
	unrecognized errors.

2009-02-25  Ankit Jain  <jankit@novell.com>

	* ProcessService.cs, IAsyncOperation.cs, IProcessAsyncOperation.cs,
	ProcessWrapper.cs: Brought in from monodevelop.
	* ToolTask.cs: Use the new ProcessService to execute the tool. Honor
	SkipTaskExecution (). Use response files, but log the contents of the
	response file instead of "@foo.rsp". Support environmentOverrides.
	(LogEventsFromTextOutput): Add null check.
	* Exec.cs (GetWorkingDirectory): Use the workingDirectory property.

2009-02-20  Ankit Jain  <jankit@novell.com>

	Fix bug #475438.
	* ToolTask.cs (RealExecute): Check whether the target executable exists.
	Log any execution errors.


svn path=/branches/mono-2-4/mcs/; revision=135336
  • Loading branch information
radical committed Jun 3, 2009
1 parent 9551a9a commit 973d8fe
Show file tree
Hide file tree
Showing 106 changed files with 6,948 additions and 640 deletions.
14 changes: 14 additions & 0 deletions mcs/class/Microsoft.Build.Engine/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2009-02-21 Ankit Jain <jankit@novell.com>

* Import.cs (GetFullPath): Use Utilities.FromMSBuildPath .

2009-02-19 Jonathan Chambers <joncham@gmail.com>

* Microsoft.Build.Engine.csproj: Add.
* Microsoft.Build.Engine.Test.csproj: Update.

2009-01-31 Ankit Jain <jankit@novell.com>

* Microsoft.Build.Engine_test.dll.sources: Replace BatchingImpl.cs with
BatchingImplBase.cs, TargetBatchingImpl.cs and TaskBatchingImpl.cs

2009-01-06 Ankit Jain <jankit@novell.com>

* Microsoft.Build.Engine_test.dll.sources: Add TestMessageLogger from
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
//
// BatchingImplBase.cs: Base class that implements BatchingAlgorithm from the wiki.
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
// Ankit Jain (jankit@novell.com)
//
// (C) 2005 Marek Sieradzki
// Copyright 2008 Novell, Inc (http://www.novell.com)
// Copyright 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#if NET_2_0

using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using Microsoft.Build.Framework;

namespace Microsoft.Build.BuildEngine {
internal class BatchingImplBase {

protected Dictionary<string, BuildItemGroup> consumedItemsByName;
protected List<MetadataReference> consumedMetadataReferences;
protected List<MetadataReference> consumedQMetadataReferences;
protected List<MetadataReference> consumedUQMetadataReferences;
protected Dictionary<string, BuildItemGroup> batchedItemsByName;
protected Dictionary<string, BuildItemGroup> commonItemsByName;

protected Project project;
protected ICollection<Dictionary<string, BuildItemGroup>> buckets;

protected BatchingImplBase (Project project)
{
if (project == null)
throw new ArgumentNullException ("project");

this.project = project;
}

protected void Init ()
{
// all referenced item lists
consumedItemsByName = new Dictionary<string, BuildItemGroup> ();

// all referenced metadata
consumedMetadataReferences = new List<MetadataReference> ();
consumedQMetadataReferences = new List<MetadataReference> ();
consumedUQMetadataReferences = new List<MetadataReference> ();
}

protected void BatchAndPrepareBuckets ()
{
batchedItemsByName = new Dictionary<string, BuildItemGroup> ();

// These will passed as is for every batch
commonItemsByName = new Dictionary<string, BuildItemGroup> ();

ValidateUnqualifiedMetadataReferences ();

if (consumedUQMetadataReferences.Count > 0) {
// Atleast one unqualified metadata ref is found, so
// batching will be done for all referenced item lists
foreach (KeyValuePair<string, BuildItemGroup> pair in consumedItemsByName)
batchedItemsByName [pair.Key] = pair.Value;
}

// All items referred via qualified metadata refs will be batched
foreach (MetadataReference mr in consumedQMetadataReferences) {
BuildItemGroup group;
if (project.TryGetEvaluatedItemByNameBatched (mr.ItemName, out group))
batchedItemsByName [mr.ItemName] = group;
}

// CommonItemNames = ConsumedItemNames - BatchedItemNames
foreach (KeyValuePair<string, BuildItemGroup> pair in consumedItemsByName) {
if (!batchedItemsByName.ContainsKey (pair.Key))
commonItemsByName [pair.Key] = pair.Value;
}

// Bucketizing
buckets = Bucketize ();
}

protected void ParseAttribute (string value)
{
Expression expr = new Expression ();
expr.Parse (value, true);

foreach (object o in expr.Collection) {
MetadataReference mr = o as MetadataReference;
if (mr != null) {
consumedMetadataReferences.Add (mr);
if (mr.IsQualified)
consumedQMetadataReferences.Add (mr);
else
consumedUQMetadataReferences.Add (mr);
continue;
}

ItemReference ir = o as ItemReference;
if (ir != null) {
BuildItemGroup group;
if (!project.TryGetEvaluatedItemByNameBatched (ir.ItemName, out group))
if (!project.EvaluatedItemsByName.TryGetValue (ir.ItemName, out group))
group = new BuildItemGroup ();

consumedItemsByName [ir.ItemName] = group;
}
}
}

//Ensure that for every metadataReference in consumedUQMetadataReferences,
//every item in every itemlist in consumedItemsByName has a non-null value
//for that metadata
void ValidateUnqualifiedMetadataReferences ()
{
if (consumedUQMetadataReferences.Count > 0 &&
consumedItemsByName.Count == 0 &&
consumedQMetadataReferences.Count == 0) {
throw new Exception ("Item metadata should be referenced with the item name %(ItemName.MetadataName)");
}

foreach (MetadataReference mr in consumedUQMetadataReferences) {
foreach (KeyValuePair<string, BuildItemGroup> pair in consumedItemsByName) {
foreach (BuildItem item in pair.Value) {
if (item.HasMetadata (mr.MetadataName))
continue;

throw new Exception (String.Format (
"Metadata named '{0}' not found in item named {1} in item list named {2}",
mr.MetadataName, item.FinalItemSpec, pair.Key));
}
}
}
}

ICollection<Dictionary<string, BuildItemGroup>> Bucketize ()
{
Dictionary<string, Dictionary<string, BuildItemGroup>> buckets =
new Dictionary<string, Dictionary<string, BuildItemGroup>> ();

// For each item list represented in "BatchedItemNames", and then for each item
// within that list, get the values for that item for each of the metadata in
// "ConsumedMetadataReferences". In the table of metadata values, "%(MyItem.MyMetadata)"
// would get a separate entry than "%(MyMetadata)", even though the metadata name is the same.

foreach (KeyValuePair<string, BuildItemGroup> pair in batchedItemsByName) {
string itemName = pair.Key;
BuildItemGroup group = pair.Value;
foreach (BuildItem item in group) {
StringBuilder key_sb = new StringBuilder ();
string value = String.Empty;

// build the bucket key, unique set of metadata values
foreach (MetadataReference mr in consumedMetadataReferences) {
value = String.Empty;
if (mr.IsQualified) {
if (String.Compare (mr.ItemName, itemName) == 0)
value = item.GetEvaluatedMetadata (mr.MetadataName);
} else {
if (item.HasMetadata (mr.MetadataName))
value = item.GetEvaluatedMetadata (mr.MetadataName);
}

key_sb.AppendFormat ("{0}.{1}:{2},",
mr.IsQualified ? mr.ItemName : "",
mr.MetadataName,
value);
}

// Every bucket corresponds to a unique _set_ of metadata values
// So, every bucket would have itemGroups with same set of metadata
// values

string bucket_key = key_sb.ToString ();
Dictionary<string, BuildItemGroup> bucket;
if (!buckets.TryGetValue (bucket_key, out bucket))
// new bucket
buckets [bucket_key] = bucket = new Dictionary<string, BuildItemGroup> ();

string itemGroup_key = item.Name;
BuildItemGroup itemGroup;
if (!bucket.TryGetValue (itemGroup_key, out itemGroup))
bucket [itemGroup_key] = itemGroup = new BuildItemGroup ();

itemGroup.AddItem (item);
}
}

if (buckets.Values.Count == 0) {
// no buckets
buckets.Add ("none", new Dictionary<string, BuildItemGroup> ());
AddEmptyGroups (buckets);
if (buckets ["none"].Values.Count == 0)
buckets.Remove ("none");
} else {
AddEmptyGroups (buckets);
}

return buckets.Values;
}

void AddEmptyGroups (Dictionary<string, Dictionary<string, BuildItemGroup>> buckets)
{
foreach (Dictionary<string, BuildItemGroup> bucket in buckets.Values) {
foreach (string name in batchedItemsByName.Keys) {
BuildItemGroup group;
if (!bucket.TryGetValue (name, out group))
bucket [name] = new BuildItemGroup ();
}
}
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,36 @@ namespace Microsoft.Build.BuildEngine {
internal class BuildChoose {

BuildWhen otherwise;
//Project project;
//XmlElement xmlElement;
Project project;
XmlElement xmlElement;
List <BuildWhen> whens;

public BuildChoose (XmlElement xmlElement, Project project)
{
//this.xmlElement = xmlElement;
//this.project = project;
this.xmlElement = xmlElement;
this.project = project;
this.whens = new List <BuildWhen> ();

foreach (XmlNode xn in xmlElement.ChildNodes) {
if (!(xn is XmlElement))
continue;

XmlElement xe = (XmlElement)xn;

if (xe.Name == "When") {
if (otherwise != null)
throw new InvalidProjectFileException ("The 'Otherwise' element must be last in a 'Choose' element.");
if (xe.Attributes.GetNamedItem ("Condition") == null)
throw new InvalidProjectFileException ("The 'When' element requires a 'Condition' attribute.");
BuildWhen bw = new BuildWhen (xe, project);
whens.Add (bw);
} else if (xe.Name == "Otherwise") {
if (this.whens.Count == 0)
throw new InvalidProjectFileException ("At least one 'When' element must occur in a 'Choose' element.");

otherwise = new BuildWhen (xe, project);
}
}
}

public void Evaluate ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public bool BuildProjectFile (string projectFileName,
IDictionary targetOutputs)
{
if (String.IsNullOrEmpty (projectFileName)) {
return engine.BuildProject (project, targetNames, targetOutputs);
return engine.BuildProject (project, targetNames, targetOutputs,
BuildSettings.DoNotResetPreviouslyBuiltTargets);
} else {
BuildPropertyGroup bpg = new BuildPropertyGroup ();
if (globalProperties != null)
Expand All @@ -68,7 +69,7 @@ public bool BuildProjectFile (string projectFileName,
(string) de.Key, (string) de.Value,
PropertyType.Global));
return engine.BuildProjectFile (projectFileName,
targetNames, bpg, targetOutputs);
targetNames, bpg, targetOutputs, BuildSettings.DoNotResetPreviouslyBuiltTargets);
}
}

Expand Down
Loading

0 comments on commit 973d8fe

Please sign in to comment.