Commit Graph
26 Commits
Author SHA1 Message Date
Marek Safar fee0db958c [xbuild] Allow metadata in skipped task output expressions 2014-08-28 17:44:42 +02:00
Marek Safar 93e590439c [xbuild] Resolve output properties for skipped task to match task output when it's not skipped 2014-08-22 09:24:40 +02:00
Martin Baulig a3c14d7686 [xbuild]: Support <PropertyGroup/ItemGroup> inside <Target>. 2013-04-05 13:07:02 +02:00
Andres G. Aragoneses b6c3382596 Microsoft.Build.Engine: Remove deprecated NET_2_0 conditionals 2012-09-15 18:06:34 +01:00
Ankit Jain fa501bf746 [xbuild] Log TaskFinished even when task fails to initialize. 2010-10-11 04:32:22 +05:30
Ankit Jain 4427a60080 Add support for ToolsVersion and correctly build msbuild+xbuild assemblies
for 3.5 and 4.0 profiles.

2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Process tools/xbuild for 3.5 also.

In class/Microsoft.Build.Engine:
2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Use the correct assembly name for MS.Build.Utilities*
	for 3.5 and 4.0 profiles. Copy the .config files for the test
	assembly.
	Import tools/xbuild/xbuild_targets.make, which copies the target
	and tasks file in the correct place, to allow running tests
	with different toolsversion.
	* Microsoft.Build.Engine.dll.sources: Add LogExtensions.cs,
	Toolset.cs, ToolsetDefinitionLocations.cs and ToolsetCollection.cs .
	* Test/test-config-file-net-3.5: New.
	* Test/test-config-file-net-4.0: New.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2010-04-03  Ankit Jain  <[email protected]>

	* BuildEngine.cs: Implement IBuildEngine2 instead of
	IBuildEngine.
	* BuildTasks.cs: Use the new extension methods for logging.
	(InitializeTask): Emit a message informing about the assembly
	from which the task is being loaded. Emit a useful debug message
	incase of a InvalidCastException.
	* Engine.cs: Add missing methods, constructors and properties related
	to ToolsVersion support. Setup a default set of Toolsets.
	Keep separate taskdbs' per ToolsVersion. The common tasks
	would come from different *.tasks file, and use different
	task assemblies.
	(DefaultToolsVersion): Correctly set this based on the profile.
	* LogExtensions.cs: New. Extension methods on Engine, for logging.
	* Project.cs: Add missing methods/contructors/properties related
	to ToolsVersion support. Add reserved properties -
	MSBuildToolsPath and MSBuildToolsVersion .
	* Toolset.cs: New.
	* ToolsetCollection.cs: New.
	* ToolsetDefinitionLocations.cs: New.

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2010-04-06  Ankit Jain  <[email protected]>

	* Consts.cs (ToolsVersionString): New.
	(GetTasksAsmPath): New.
	* EngineTest.cs: Use the direct path to the tasks assembly
	in the UsingTasks.
	* ProjectTest.cs: Set ToolsVersion to the current profile.

In class/Microsoft.Build.Framework:
2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
	the target and tasks file in the correct place, to allow running
	tests with different toolsversion.
	* Microsoft.Build.Framework.dll.sources: Add IBuildEngine2.cs .

In class/Microsoft.Build.Framework/Microsoft.Build.Framework:
2010-04-03  Ankit Jain  <[email protected]>

	* IBuildEngine2.cs: New.

In class/Microsoft.Build.Tasks:
2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
	the target and tasks file in the correct place, to allow running
	tests with different toolsversion. Copy the config file for the
	test assembly. Clean the generated test.dll .
	Use the correct target assembly name for 4.0 profile
	(ms.build.tasks.v4.0.dll), and for Utilities assembly.
	* Microsoft.Build.Tasks_test.dll.sources: Use Consts.cs from Engine
	instead of maintaining a copy here.

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2010-04-03  Ankit Jain  <[email protected]>

	* Csc.cs: Use dmcs as the compiler for 4.0 profile.
	* MSBuild.cs (ToolsVersion): New.
	Use toolsVersion for building.

In class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks:
2010-04-06  Ankit Jain  <[email protected]>

	* Consts.cs: Remove.
	* AssignProjectConfigurationTest.cs:
	* CreateCSharpManifestResourceNameTest.cs:
	* CreateVisualBasicManifestResourceNameTest.cs:
	* CreateItemTest.cs:
	* FindAppConfigFileTest.cs:
	* RemoveDuplicatesTest.cs:
	* TaskBatchingTest.cs:
	* WriteLinesToFileTest.cs:
	Set the ToolsVersion to match the profile. Use the
	full path to the tasks assembly for UsingTasks.

In class/Microsoft.Build.Utilities:
2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
	the target and tasks file in the correct place, to allow running
	tests with different toolsversion.
	Use the correct target assembly name for 4.0 profile.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2010-04-03  Ankit Jain  <[email protected]>

	* TargetDotNetFrameworkVersion.cs: Add Version40 .
	* Task.cs (BuildEngine2): New.
	* ToolLocationHelper.cs: Use class/linet_* as the path
	for the assemblies and targets when running tests.
	Environment variable TESTING_MONO is set for testing.
	This allows a 4.0 xbuild to build 2.0/3.5 projects.

In tools:
2010-04-03  Ankit Jain  <[email protected]>

	* Makefile: Move xbuild from net_4_0_dirs to per_profile_dirs.

In tools/xbuild:
2010-04-03  Ankit Jain  <[email protected]>

	* Main.cs (Execute): If toolsversion is specified on the command line,
	then use that.
	* Parameters.cs: Read toolsversion from the command line ('/tv:..') .
	* SolutionParser.cs: Infer ToolsVersion from the sln version.
	Set ToolsVersion property of the MSBuild tasks, in the generated
	.sln.proj file, for building the projects.

	* xbuild/Microsoft.Common.tasks: Move to ..
	* xbuild/2.0/Microsoft.Common.tasks: .. here.
	* xbuild/3.5/Microsoft.Common.tasks: New.
	* xbuild/4.0/Microsoft.Common.tasks: New.
	Use the corresponding 3.5/4.0 tasks assembly.

	* xbuild_targets.make: Copies the target and tasks file in the correct
	place, to allow running tests with different toolsversion.
	* Makefile: Import xbuild_targets.make . Use correct assembly names for
	Utilities assembly, for 3.5/4.0 profiles.
	Install the correct Microsoft.Common.tasks file for the profile.
	Copy xbuild.exe to class/li$(PROFILE), so that it can find other
	profile dirs as relative path.
	(EXTRA_DISTFILES): Add the new Microsoft.Common.tasks files.

svn path=/trunk/mcs/; revision=154835
2010-04-06 09:57:58 +00:00
Ankit Jain d423e8c656 Improve error reporting.
In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
	* Target.cs (TargetFile): New. Gives the name of the file
	containing the target definition.
	* BuildEngine.cs (.ctor): Add a 'taskfile' parameters, and
	return this for ProjectFileOfTaskNode.
	* BuildTask.cs (LogTaskStarted):
	(LogTaskFinished): Use parentTarget.ProjectFileOfTaskNode for
	the event.
	(InitializeTask): Set BuildEngine's task file to parent target's
	TargetFile.
	* Engine.cs (LogProjectStarted): Incase of default targets, set
	TargetNames to String.Empty .
	* TargetBatchingImpl.cs (LogTargetStarted):
	(LogTargetFinished): Use target.TargetFile for the event.

	* ConsoleLogger.cs: Keep a stack of project/target/task being
	executed. And corresponding list of errors and warnings.
	(EventsToString): Stringifies the current "stack", to be used
	as key to the table of errors/warnings and for show messages
	at the end of the build.

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
	* ResolveAssemblyReference.cs: Remove unnecessary tab in the warning
	messages.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
	* TaskLoggingHelper.cs: Use the buildEngine.ProjectFileOfTaskNode
	in the event args.

svn path=/trunk/mcs/; revision=143937
2009-10-12 07:36:28 +00:00
Ankit Jain 64b342c4e8 In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
* Expression.cs (ParseOptions): New enum. Replace the bool params
	of exression.Parse with this. Add option to control expansion of
	metadata references.
	(CopyToExpressionCollection): Track api changes.

	Update all expr.Parse calls to use the new enum.
	* BuildItem.cs, BuildProperty.cs, BuildTask.cs, Import.cs,
	Target.cs, TargetBatchingImpl.cs, UsingTask.cs: Track api changes.

	* BatchingImplBase.cs: Track api changes. Allow metadata refs
	in task attributes.
	* ConditionFactorExpression.cs: Allow metadata refs in conditions.
	* ItemReference.cs: Allow metadata in transforms.
	* TaskEngine.cs: Allow metadata refs.

	* MetadataReference.cs (.ctor): Add a 'original string' param.

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

	* TaskBatchingTest.cs: Add new tests for metadata refs found
	in places other than task attributes.

svn path=/trunk/mcs/; revision=140998
2009-09-01 04:00:38 +00:00
Ankit Jain 2f3d65b5c3 In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
* Expression.cs (ExpressionOptions): New.

	Introduce a ExpressionOptions argument to all ConvertTo*
	methods. Implement the rule: in evaluation phase, expand
	all items completely, but dont expand item refs in properties.
	At other times, expand the item refs in the properties.
	See comments in Expression.cs, for a full explanation.
	* BuildItem.cs: Track api changes.
	* BuildItemGroup.cs: Likewise.
	* BuildProperty.cs: Track api changes. Handle self-references.
	* BuildTask.cs: Track api changes.
	* IReference.cs: Add ExpressionOptions param.
	* ItemReference.cs: Track api changes.
	* PropertyReference.cs: Likewise.
	* MetadataReference.cs: Likewise.
	* ExpressionCollection.cs: Track api changes. Add support for
	converting all primitive types and DateTime, instead of a fixed
	few.
	* Project.cs (GetMetadataBatched): Use the evaluated metadata.
	* TaskBatchingImpl.cs: Handle the case when batching is required,
	but no items are available.

	* TaskEngine.cs: Throw on unsupported types. Correctly handle
	properties in case of empty values.

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

	* BuildItemTest.cs (TestSetMetadata5a): New.
	* ProjectTest.cs: Add tests for different property types
	with required attribute. Also, check the values - null or
	empty array.
	* TestTasks.cs: Add new tasks for above.

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

	* TestTasks.cs: Add new tasks for different property types
	with required attribute. Also, emit whether the value was
	null or a zero length array.

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

	* Items.cs: Add tests for property/item evaluation.

svn path=/trunk/mcs/; revision=140911
2009-08-28 21:55:29 +00:00
Ankit Jain df378a28f3 * BuildTask.cs (Execute): Use task_logger only after the task
has been initialized. Catch and report task loading errors.
* Target.cs (DoBuild): Dont rethrow the exception, and emit
the stacktrace as a low importance message.

svn path=/trunk/mcs/; revision=140302
2009-08-19 22:44:52 +00:00
Ankit Jain e2b6b480a7 * Target.cs (Build): Log a message if a target is skipped.
(LogMessage): New.
* BuildTask.cs (Execute): Log error if task execution fails.

svn path=/trunk/mcs/; revision=139126
2009-07-30 21:24:18 +00:00
Ankit Jain 45ca9cf99e * BuildTask.cs (Execute): PublishOutput only if task runs successfully.
svn path=/trunk/mcs/; revision=121723
2008-12-17 19:20:58 +00:00
Ankit Jain d25f2e6b86 In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
* BuildEngine.cs (.ctor): Replace 'projectFile' param with 'project'.
	(BuildProjectFile): If filename is null (project.LoadXml) then use
	engine.BuildProject
	* BuildTask.cs (InitializeTask): Track api change.
	* Expression.cs (Parse): Skip empty entries in the expression.

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

	* ProjectTest.cs: Refactor BuildProjectFile tests. Add tests for loading
	project from files and xml string.

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

	* CallTarget.cs (Execute): Implement.

In tools/xbuild:

	* xbuild/Microsoft.Common.tasks: Add CallTarget and AssignTargetPath task.

svn path=/trunk/mcs/; revision=114590
2008-10-01 16:58:09 +00:00
Marek Sieradzki f92b1040d8 2007-02-18 Marek Sieradzki <[email protected]>
* ExpressionCollection.cs (ConvertToITaskItemArrayFromString):
		Simplified.

	* ConditionFunctionExpression.cs: Removed warnings.

	* BuildTask.cs (Execute): Write exceptions to std err (they should be
	       logged but it's better than swallowing).



svn path=/trunk/mcs/; revision=73072
2007-02-18 13:04:26 +00:00
Marek Sieradzki eb9fb79006 2007-01-29 Marek Sieradzki <[email protected]>
* BuildTask.cs (Execute): Log errors that happen when invoking ITask
        .ctor.

        * ConsoleLogger.cs (TargetFinishedHandler)
        (TaskFinishedHandler): Increment error count.


svn path=/trunk/mcs/; revision=71865
2007-01-29 12:52:31 +00:00
Marek Sieradzki 4b6c9514dc 2007-01-23 Marek Sieradzki <[email protected]>
* BuildTask.cs, ConditionFactorExpression.cs, Target.cs,
        TaskEngine.cs, UsingTask.cs, ItemReference.cs, BuildItem.cs,
        BatchingImpl.cs, BuildProperty.cs: Track API changes.

        * Expression.cs (Parse): Added allowItems parameter and made regexes
        static.

        * Import.cs (Evaluate): Moved hack from tools/xbuild/Makefile here. It
        will try to import a.ext when given a.EXT.


svn path=/trunk/mcs/; revision=71563
2007-01-23 21:38:27 +00:00
Marek Sieradzki c0abdbf887 2007-01-08 Marek Sieradzki <[email protected]>
* BuildWhen.cs, BuildPropertyGroupCollection.cs,
        BuildItemGroupCollection.cs, Project.cs: Track API changes.

        * GroupingCollection.cs: Now it needs Project reference so added it.

        * BuildTask.cs: Formatting.

        * InvalidProjectFileException.cs: Use MS' names in GetObjectData ().

        * ConditionParser.cs (ParseAndEvaluate): Added.

        * BuildItem.cs: Changed exception message.


svn path=/trunk/mcs/; revision=70638
2007-01-08 11:27:34 +00:00
Marek Sieradzki d4e1ed0407 2007-01-02 Marek Sieradzki <[email protected]>
* BuildWhen.cs, BuildPropertyGroupCollection.cs,
        BuildItemGroupCollection.cs, Project.cs, GroupingCollection.cs:
        GroupingCollection doesn't need Project reference.

        * BuildTask.cs, Target.cs, TaskEngine.cs, BatchingImpl.cs: Formatting

        * BuildItemGroup.cs: Added new readOnly parameter to ctor.
        (Project.EvaluatedItems is a read only item group.)
        (ReplaceWith): Added.

        * BuildPropertyGroup.cs (IsGlobal): Added. Setting a property in
        global property group causes reevaluation of its project.

        * Project.cs: ProcessXml () is internal and can be "safely" invoked by
        other classes.

        * OldExpression.cs: Removed.

        * BuildProperty.cs (Evaluate): Simplified.

        * ChangeType.cs (TemporaryTransform): Simplified.

        * BuildItem.cs: There are now 3 types of build items: from XML, having
        parent from XML, virtual. Added SplitParentItem ().


svn path=/trunk/mcs/; revision=70342
2007-01-02 11:21:51 +00:00
Marek Sieradzki 52f8ef62f9 006-12-16 Marek Sieradzki <[email protected]>
* ItemPropertyGroupingBase.cs, TaskEngineAssemblyResolver.cs: Removed
        classes that were public in Beta 2 and aren't used.

        * Expression.cs: Added replacement for parsing expressions char by
        char. It uses regexes to find item/property/metadata references in
        given text.

        * ExpressionCollection.cs, BuildTask.cs, ConditionFactorExpression.cs,
        Target.cs, TaskEngine.cs, BuildItemGroup.cs, UsingTask.cs, Import.cs,
        BuildItem.cs, BatchingImpl.cs, BuildProperty.cs: Track API changes.

        * ConditionRelationalExpression.cs: Formatting.

        * OldExpression.cs: Commented everything.

        * MetadataReference.cs, ItemReference.cs, PropertyReference.cs: Moved
        parsing to Expression.

        * BuildItem.cs: Check if project is from XML in set_Condition and
        set_Exclude.

        * BuildPropertyGroup.cs, Project.cs: Add ImportedProject to 
        Project.ctor.

        * ConditionNotExpression.cs, ConditionAndExpression.cs: Check if we
        can evaluate expression in CanEvaluateToBool ().


svn path=/trunk/mcs/; revision=69557
2006-12-15 23:35:11 +00:00
Marek Sieradzki 988e75c34a 2006-12-07 Marek Sieradzki <[email protected]>
* BuildTask.cs: Implemented AddOutputItem () and AddOutputProperty ().

        * UsingTaskCollection.cs: Removed [MonoTODO] and used CopyTo in CopyTo
        (UsingTask[] array, int index)

        * TaskEngine.cs: Reformatted PublishOutput () and added copying of
        items to Project.EvaluatedItems in PublishItemGroup ();

        * BuildItemGroup.cs: Added [MonoTODO].

        * UsingTask.cs: Used expression for AssemblyFile to get around
        problems with '\' and '/'.

        * BuildItem.cs (ctor): Added null checks.
        (GetMetadata): Return unevaluatedMetadata not evaluatedMetadata.
        (SetMetadata): Don't escape evaluatedMetadata and escape
        unevaluatedMetadata only when treatPropertyValueAsLiteral.

        * BuildPropertyGroup.cs (GetEnumerator, Evaluate, RemoveProperty): Use
        FromXml () instead of null checks.
        (SetProperty): Escape propertyValue when it is literal.

        * BuildProperty.cs: Changed exception message.

        * Project.cs: Added XmlNamespaceManager and XmlNamespace internal 
        properties.
        (GetProjectExtensions): Implemented.


svn path=/trunk/mcs/; revision=69165
2006-12-07 10:30:42 +00:00
Marek Sieradzki dd91824dce 2006-12-05 Marek Sieradzki <[email protected]>
* BuildTask.cs: Remove [MonoTODO], add exception throwing in
        GetParameterValue (), use expressions in ContinueOnError.
        * ConditionFactorException.cs: Throw InvalidProjectFileException ()
        instead of InvalidOperationException ().
        * ImportCollection.cs: Implement CopyTo ().
        * Target.cs: Remove redundant variables (XmlAttributes), return
        String.Empty in DependsOnTargets, add a null check in RemoveTask ().
        * BuildItemGroup.cs, BuildPropertyGroup.cs: Remove [MonoTODO].
        * Import.cs: Throw an exception when file does not exist.
        * Target.cs: Use StringComparer.InvariantCultureIgnoreCase.
        * ConditionTokenizer.cs: Treat '-' as beginning of a number. We'll
        need to treat item as a token probably


svn path=/trunk/mcs/; revision=69027
2006-12-05 11:17:31 +00:00
Marek Sieradzki c654ca4dc0 2006-08-15 Marek Sieradzki <[email protected]>
* BuildTask.cs, UsingTaskCollection.cs, ImportCollection.cs,
        Target.cs, TaskDatabase.cs, TaskEngine.cs, BuildItemGroup.cs,
        BuildChoose.cs, DirectoryScanner.cs, BuildPropertyGroup.cs,
        TargetCollection.cs, Engine.cs, Project.cs: Started to use generics.


svn path=/trunk/mcs/; revision=63750
2006-08-15 09:29:31 +00:00
Marek Sieradzki c2b743d7a7 2006-04-14 Marek Sieradzki <[email protected]>
* BuildTask.cs: Removed unnecessary variable.
        * Engine.cs: Added logging of the build start.
        * Project.cs: Removed unnecessary variable.


svn path=/trunk/mcs/; revision=59481
2006-04-14 14:40:15 +00:00
Marek Sieradzki c83df40ab3 2006-03-21 Crestez Leonard <[email protected]>
* Target.cs, TaskEngine.cs, BuildItemGroup.cs, BuildItem.cs,
	BuildPropertyGroup.cs, TargetCollection.cs, BuildProperty.cs,
	Engine.cs, Project.cs, BuildTask.cs, UsingTask.cs: Separate xml
	binding and evaluation, merge xml binding in constructors.
	* DirectoryScanner.cs: Includes CAN be empty.
	* BuildChoose.cs, ItemReference.cs, ChangeType.cs: Newline at EOF.
	* ConsoleLogger.cs: Fix compilation warning.

svn path=/trunk/mcs/; revision=58226
2006-03-21 17:06:28 +00:00
Marek Sieradzki b1af4814bb 2006-03-18 Crestez Leonard <[email protected]>
* Project.cs: Cleaned up add.
	* Expression.cs: Hacked to transform \ and / to path separators.
	* BuildPropertyGroup.cs: Small cleanup.
	* BuildTask.cs, TaskEngine.cs: Fix TaskEngine not getting a Project
	reference.

svn path=/trunk/mcs/; revision=58135
2006-03-18 12:03:06 +00:00
Marek Sieradzki 74041f540e 2006-03-11 Marek Sieradzki <[email protected]>
* BatchingImpl.cs: Updated with BuildTask instead of TaskElement.
	* BuildItem.cs: Updated for new API and fixed crashing on non-existent
	files.
	* BuildItemGroup.cs, BuildItemGroupCollection.cs, BuildProperty.cs,
	BuildPropertyGroup.cs, BuildPropertyGroupCollection.cs, ConsoleLogger.cs,
	Engine.cs, Project.cs, Target.cs, TargetCollection.cs: Updated for new
	API.
	* DirectoryScanner.cs: Fixed ordering and crashing on duplicated items.
	* TaskElement.cs: Temporarily removed.
	* Xml.cs: Changed to static.

svn path=/trunk/mcs/; revision=57832
2006-03-11 17:41:42 +00:00