Compare commits

...
614 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 8a7c716e20 2009-06-25 Gonzalo Paniagua Javier <[email protected]>
* BuildManager.cs: backport r131138.


svn path=/branches/mono-2-4-2/mcs/; revision=136882
2009-06-25 20:30:08 +00:00
Marek Habersack 01bbe61085 Backport of r136398
svn path=/branches/mono-2-4-2/mcs/; revision=136457
2009-06-19 06:19:27 +00:00
Marek Habersack 0f89bbf80c Backport of r136396
svn path=/branches/mono-2-4-2/mono/; revision=136456
2009-06-19 06:18:46 +00:00
Marek Habersack d6aaa92a41 Backport of r136395
svn path=/branches/mono-2-4-2/mono/; revision=136455
2009-06-19 06:17:52 +00:00
Gonzalo Paniagua Javier 497ee8788b 2009-06-17 Gonzalo Paniagua Javier <[email protected]>
* EndPointListener.cs: call CheckIfRemove() after removing a regular
	prefix. Fixes bug #513849.
	* EndPointManager.cs: make sure we use the right lock when one prefix
	of a collection fails to be added and we need to remove all of the
	prefixes.
	Clear the ip_to_endpoints hashtable if there are no more prefixes
	listening on that address.


svn path=/branches/mono-2-4-2/mcs/; revision=136322
2009-06-17 15:26:34 +00:00
Gonzalo Paniagua Javier 0bdac5d044 updated browscap.ini
svn path=/branches/mono-2-4-2/mono/; revision=136319
2009-06-17 15:05:34 +00:00
Andreia Gaita 8e9b735376 2009-06-15 Andreia Gaita <[email protected]>
* data/config.in: add libcups dllmap entry
	[Fixes #511414, backported from r136039]

svn path=/branches/mono-2-4-2/mono/; revision=136156
2009-06-15 19:47:09 +00:00
Miguel de Icaza f393a5f321 Backport
svn path=/branches/mono-2-4-2/mcs/; revision=136154
2009-06-15 19:22:26 +00:00
Miguel de Icaza 4d8b0d9ceb Backport 136112 to 2.4.2 as well
svn path=/branches/mono-2-4-2/mcs/; revision=136153
2009-06-15 19:18:40 +00:00
Zoltan Varga ec6664a238 2009-06-09 Zoltan Varga <[email protected]>
* metadata.c (free_inflated_method): Call
	mono_marshal_free_inflated_wrappers (), which was missed earlier.

svn path=/branches/mono-2-4-2/mono/; revision=136150
2009-06-15 18:52:39 +00:00
Marek Habersack 18407d4460 Backport of r136096
svn path=/branches/mono-2-4-2/mcs/; revision=136098
2009-06-15 08:29:09 +00:00
Marek Habersack 6e06f985d5 Backport of r136089
svn path=/branches/mono-2-4-2/mcs/; revision=136090
2009-06-15 07:28:53 +00:00
Gonzalo Paniagua Javier ea9fc09f44 This was commited in March but never backported to 2.4: implement WaitOne(TimeSpan)
svn path=/branches/mono-2-4-2/mcs/; revision=136076
2009-06-14 08:45:00 +00:00
Gonzalo Paniagua Javier 87b622b806 2009-06-12 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationHost.cs: workaround to avoid definition errors when
	a null config path is passed.



svn path=/branches/mono-2-4-2/mcs/; revision=136071
2009-06-14 01:23:09 +00:00
Ankit Jain 1afa2326c0 Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:

	* xbuild/Microsoft.Common.targets (ProjectDir): Fix typo.

	* xbuild/Microsoft.Common.targets (IntermediateAssembly): Change to
	an Item list to match msbuild.
	* xbuild/Microsoft.CSharp.targets (IntermediateAssembly): Update for
	above changes.

	* Parameters.cs (.ctor): Use assembly's location to build
	path for the default response file.

In tools/xbuild/tests:
	* standalone/Project01: Add missing Lib2.deploy.txt in the correct
	location.

	* standalone/Project01: Fix location for lib2.deploy.txt

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

	* Utilities.cs: New.
	* AL.cs, AspNetCompiler.cs, Csc.cs,
	SGen.cs, Vbc.cs (ToolName): Append ".bat" when running
	on windows.

	* MSBuild.cs (Execute): Copy metadata from the @Projects items
	to the target outputs.

	* ResolvedReference.cs: Add missing file.


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

	* EngineTest.cs (TestMSBuildOutputs): New.

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

	* Items.cs (TestItemsInTarget3a): Add another case for valid whitespace
	around an item ref.

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

	Fix bug #512535.
	* ExpressionCollection.cs (ConvertToITaskItemArray): Whitespace around a
	itemref is allowed if the prev/next element is ";".

	* Utilities.cs (FromMSBuildPath): Return null if the path contains
	"drive:" only on windows.


svn path=/branches/mono-2-4-2/mcs/; revision=136028
2009-06-12 20:16:03 +00:00
Marek Habersack 68d381371c Backport of r135918
svn path=/branches/mono-2-4-2/mcs/; revision=135920
2009-06-11 09:21:35 +00:00
Gonzalo Paniagua Javier a76a4800ef 2009-06-09 Gonzalo Paniagua Javier <[email protected]>
* XPathExpression.cs: Backport to Mono 2.4 the bug fix
	for multithreaded applications that use XPath.

	This was the fix for #477049 which also fixes #505678


svn path=/branches/mono-2-4-2/mcs/; revision=135816
2009-06-10 02:46:36 +00:00
Rodrigo Kumpera a4f5795010 2009-06-09 Rodrigo Kumpera <[email protected]>
Revert previous commit to threads.c until the race condition
	is fixed.


svn path=/branches/mono-2-4-2/mono/; revision=135757
2009-06-09 15:12:47 +00:00
Andrew Jorgensen ab03b83eb4 Bump version numbers
svn path=/branches/mono-2-4-2/mono/; revision=135675
2009-06-08 17:12:00 +00:00
Rodrigo Kumpera 3075fb3f7c 2009-06-08 Rodrigo Kumpera <[email protected]>
Backport of 135171.

	* threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
	Check if the thread was interrupted and proccess it straight away.
	Makes abortion much more responsive.

	Backport of 135170.

	* threads.c (mono_thread_execute_interruption): Use atomic cas with
	MonoThread::interruption_requested to match it's counterpart.

	Fixes a hang in abort-stress-1 on a 2 core x86.


svn path=/branches/mono-2-4/mono/; revision=135666
2009-06-08 15:45:51 +00:00
Martin Baulig aa667d9821 Improve exception handling when running in mdb: check whether an exception is caught inside a runtime-invoked method or the runtime-invoke wrapper.
2009-06-08  Martin Baulig  <[email protected]>

	* debug-mini.c
	(MonoDebuggerExceptionAction): Moved into debug-mini.h.
	(_mono_debugger_throw_exception): Don't make this static.
	(_mono_debugger_unhandled_exception): Likewise.
	(mono_debugger_handle_exception): Moved to mini-exceptions.c

	* debug-mini.c
	(MonoDebuggerExceptionAction): Moved here from debug-mini.c.
	(_mono_debugger_throw_exception): Add function prototype.
	(_mono_debugger_unhandled_exception): Likewise.

	* mini-exceptions.c
	(mono_handle_exception_internal): Added `MonoJitInfo **out_ji'
	arg; return the first exception handler if the exception is caught
	and we're running inside the debugger.
	(mono_debugger_handle_exception): Moved here from debug-mini.c;
	improve exception handle inside runtime-invoke, check whether the
	exception is actually caught in the method being invoked and not
	by the runtime-invoke-wrapper.

svn path=/branches/mono-2-4/mono/; revision=135636
2009-06-08 08:46:08 +00:00
Marek Habersack 8c11b0cb13 Backport of r135630
svn path=/branches/mono-2-4/mcs/; revision=135631
2009-06-08 07:19:59 +00:00
Ankit Jain d3f7781195 In class/PEAPI:
2009-03-31  Rodrigo Kumpera  <[email protected]>

	* Code.cs (CILLabel): Add new constructor to signal that
	a label is an absolute il offset. This is required by exception
	handling declarations that use offsets and not labels.

In ilasm/codegen:
2009-05-27  Rodrigo Kumpera  <[email protected]>

	* TypeDef.cs: Add field method_list to preserve definition
	order of methods when emiting the PE file.

2009-04-20  Ankit Jain  <[email protected]>

	Fix bug #494221
	* MethodDef.cs (BeginLocalsScope): New.
	(EndLocalsScope): New.
	(AddLocals):
	(GetNamedLocal): Support scoping for .locals

	* MethodDef.cs (GetNamedLocalSlot): Return -1 if local var not found.

2009-03-31  Rodrigo Kumpera  <[email protected]>

	* MethodDef.cs (WriteCode): Emit labels which use offsets as absolute PEAPI
	CilLabels.

In ilasm/scanner:

	* StringHelper.cs (startIdChars): New. Set of chars that can start an
	identifier.
	(Start): Use startIdChars instead of idchars.

	Fix bug #487155.
	* StringHelper.cs: Handle octal values in strings.
	Patch from  Stephen Gennard ([email protected])

In ilasm/parser:
	Fix bug #494221.
	* ILParser.jay (scope_block_begin): Mark begin .locals scope.
	(scope_block): Mark end .locals scope.

	* ILParser.jay (instr): Handle unidentified local var id.

2009-03-31  Rodrigo Kumpera  <[email protected]>

	* ILParser.jay: Fix integer labels in handler blocks.

svn path=/branches/mono-2-4/mcs/; revision=135623
2009-06-08 00:47:03 +00:00
Ankit Jain acc1b29080 Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:

	* xbuild/Microsoft.Common.targets: Use ResolveAssemblyReference
	to find satellite assemblies, dependent assemblies, dependent
	files, copy local files etc.
	Add targets to fetch all this info for all referenced projects,
	and copy them to the target locations. Also, copy the debug (.mdb)
	files. Honor, "CopyToOutputDirectory" metadata.

	* Parameters.cs (ProcessProperty): Handle invalid syntax.

	* SolutionParser.cs (AddGeneralSettings): Don't hardcode the default
	config/platform. Move to ..
	(AddDefaultSolutionConfiguration): .. here.
	(AddCurrentSolutionConfigurationContents): Use the first solution target
	as the default config/platform or use Debug/anycpu if no config is available.

In tools/xbuild/tests:

	* standalone/Project01: New. Solution with interdependent multiple projects,
	with deploy files, satellite assemblies etc.

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

	* CreateCSharpManifestResourceNameTest.cs (TestInvalidCulture): New.

	* CscTest.cs (TestDefineConstants): Update DefineConstants to include
	spaces also.

	* AssignTargetPathTest.cs: Update tests to not depend on a fixed
	root (C:\) or cur dir.

In class/Microsoft.Build.Tasks:

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

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

	* AssignCulture.cs (TrySplitResourceName): Reset culture arg to null
	if returning false.
	* CreateCSharpManifestResourceName.cs: Set culture to null if the
	culture was invalid.

	* ResolvedReference.cs: New.
	* AssemblyResolver.cs (GetResolvedReference): New. Honor's the
	'Private' metadata and sets CopyLocal.
	(SearchPath): New. Used to track how the reference was resolved.
	(IsStrongNamed): Fix potential null ref.
	All the assembly resolution methods now return ResolvedReference
	instead of strings, to aid in proper CopyLocal behavior and
	dependency resolution.
	* ResolveAssemblyReference.cs: Add support for finding related files,
	satellite files, resolving dependencies, copy local files.
	Resolve files specified in "AssemblyFiles" param also, used to resolve
	project references and dependencies.

	* Csc.cs (AddResponseFileCommands): Split DefineConstants on space also.

	* AssignTargetPath.cs (Execute): Expand incoming path to absolute
	path, and correctly extract relative path (skipping over the preceding
	dir separator).

	* Copy.cs (CopyFile): Don't copy if the source and dest are the same.

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

	* ProjectTest (TestBuildSolutionProject): New. Disabled for now.
	* Consts.cs (RunningOnMono): Make public.

	* TargetTest (TestTargetOutputsIncludingMetadata): New.

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

	* Target.cs (Outputs): Use ITaskItem[] for conversion, to retain
	the metadata.

svn path=/branches/mono-2-4/mcs/; revision=135620
2009-06-08 00:28:26 +00:00
Marek Habersack 3325e79f38 Backport of r130909
svn path=/branches/mono-2-4/mcs/; revision=135562
2009-06-05 21:26:49 +00:00
Marek Habersack 14c36e347e Fix the 1.1 build
svn path=/branches/mono-2-4/mcs/; revision=135561
2009-06-05 21:11:02 +00:00
Marek Habersack 9cea00c852 Backport of r135558
svn path=/branches/mono-2-4/mcs/; revision=135559
2009-06-05 20:53:59 +00:00
Robert Jordan 13c1574f1e merge from trunk r135532.
svn path=/branches/mono-2-4/mcs/; revision=135533
2009-06-05 14:57:11 +00:00
Marek Habersack 7bcec499bb Backport of r135488
svn path=/branches/mono-2-4/mcs/; revision=135489
2009-06-04 21:23:04 +00:00
Marek Habersack 905299db93 Backport of r135486
svn path=/branches/mono-2-4/mcs/; revision=135487
2009-06-04 21:18:44 +00:00
Marek Habersack 69340b378c Backport of r135471
svn path=/branches/mono-2-4/mcs/; revision=135472
2009-06-04 18:48:30 +00:00
Marek Habersack db984ca1f9 Backport of r135464
svn path=/branches/mono-2-4/mcs/; revision=135465
2009-06-04 17:45:39 +00:00
Marek Habersack cde24e99e0 Backport of r135460
svn path=/branches/mono-2-4/mcs/; revision=135462
2009-06-04 17:34:36 +00:00
Marek Habersack 181c888eb3 Backport of r135438
svn path=/branches/mono-2-4/mcs/; revision=135439
2009-06-04 15:31:55 +00:00
Zoltan Varga 981e7e4a91 2009-06-04 Zoltan Varga <[email protected]>
* marshal.c metadata.c: Applied patch from Ulrich Weigand
	<[email protected]>: Free the wrappers of inflated generic methods when
	the inflated method is freed. Fixes #508389.

	The code is contributed under the MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=135435
2009-06-04 15:26:16 +00:00
Veerapuram Varadhan 384885ad15 2009-06-04 Veerapuram Varadhan <[email protected]>
* OracleParameter.cs: Infer size only for 2.0 profile when only
	value is passed.  Fixes test failure under 1.1 profile.

svn path=/branches/mono-2-4/mcs/; revision=135429
2009-06-04 15:15:21 +00:00
Jb Evain 631c51205f 2009-06-03 Jb Evain <[email protected]>
backport of 135337.

	* main.c (dis_code): don't try to locate invalid entry points.


svn path=/branches/mono-2-4/mono/; revision=135339
2009-06-03 18:58:04 +00:00
Ankit Jain 973d8fe897 Update xbuild and Microsoft.Build.* libs from trunk.
In tools/xbuild:
2009-05-20  Jonathan Chambers  <[email protected]>

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

2009-04-27  Ankit Jain  <[email protected]>

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

2009-04-25 Daniel Nauck <[email protected]>

	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  <[email protected]>

	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  <[email protected]>

	* 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  <[email protected]>

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

2009-02-26  Ankit Jain  <[email protected]>

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

2009-02-26  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-21  Ankit Jain  <[email protected]>

	* xbuild/xbuild.rsp: Add descriptive comments.

2009-02-21  Ankit Jain  <[email protected]>

	* Parameters.cs (LoadResponseFile): Handle comments.

2009-02-20  Ankit Jain  <[email protected]>

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

2009-02-20  Ankit Jain  <[email protected]>

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

2009-02-20  Ankit Jain  <[email protected]>

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

2009-02-20  Ankit Jain  <[email protected]>

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

2009-02-19  Jonathan Chambers  <[email protected]>

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

2009-02-13  Jonathan Chambers  <[email protected]>

	* 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  <[email protected]>

	* 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  <[email protected]>

	* 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  <[email protected]>

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

2009-04-27  Ankit Jain  <[email protected]>

	* CreateVisualBasicManifestResourceNameTest.cs: New.

2009-03-03  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

2009-02-24  Ankit Jain  <[email protected]>

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

2009-02-21  Ankit Jain  <[email protected]>

	* CopyTest.cs: New.

2009-01-31  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

	* Sample.vb: New.

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

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

2009-04-27  Ankit Jain  <[email protected]>

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

2009-03-22  Daniel Nauck  <[email protected]>

	* 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  <[email protected]>

	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  <[email protected]>

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

2009-02-26  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

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

2009-02-21  Ankit Jain  <[email protected]>

	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 <[email protected]>
	Refactor a bit to remove code duplication.

2009-02-21  Ankit Jain  <[email protected]>

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

2009-02-11  Leszek Ciesielski <[email protected]>

	* ResolveAssemblyReference.cs : AllowedRelatedFileExtensions stub

2009-02-02  Ankit Jain  <[email protected]>

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

2009-02-02  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

2009-02-01  Ankit Jain  <[email protected]>

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

2009-01-30  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

In class/Microsoft.Build.Tasks:
2009-05-14  Ankit Jain  <[email protected]>

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

2009-04-28  Raja R Harinath  <[email protected]>

	* 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  <[email protected]>

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

2009-04-25  Jonathan Chambers  <[email protected]>

	* Makefile: Adjust assembly name for 3.5 profile.

2009-02-21  Ankit Jain  <[email protected]>

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

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-05-29  Ankit Jain  <[email protected]>

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

2009-05-15  Marek Sieradzki  <[email protected]>

	* 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  <[email protected]>

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

2009-03-27  Jonathan Chambers  <[email protected]>

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

2009-03-26  Jonathan Chambers  <[email protected]>

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

2009-02-24  Ankit Jain  <[email protected]>

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

2009-02-15  Jonathan Chambers  <[email protected]>

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

2009-02-12  Jonathan Chambers  <[email protected]>

	* BuildPropertyTest.cs (TestValueXml): New.

2009-02-01  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

2009-01-29  Ankit Jain  <[email protected]>

	* BuildItemTest.cs (TestBuildItemTransform): New.

In class/Microsoft.Build.Engine/Test/various:
2009-05-29  Ankit Jain  <[email protected]>

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

2009-05-15  Marek Sieradzki  <[email protected]>

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

2009-02-23  Ankit Jain  <[email protected]>

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

2009-02-20  Ankit Jain  <[email protected]>

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

In class/Microsoft.Build.Engine/Test/resources:
2009-03-26  Jonathan Chambers  <[email protected]>

	* TestTasks.cs (NamespacedOutputTestTask): New.

2009-02-24  Ankit Jain  <[email protected]>

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

2009-01-30  Ankit Jain  <[email protected]>

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

2009-01-29  Ankit Jain  <[email protected]>

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

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-05-29  Ankit Jain  <[email protected]>

	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  <[email protected]>

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

2009-05-12  Ankit Jain  <[email protected]>

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

2009-05-05  Miguel de Icaza  <[email protected]>

	* Contribution from Martin Brenn to fix #498154.

2009-04-27  Ankit Jain  <[email protected]>

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

2009-04-27  Ankit Jain  <[email protected]>

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

2009-04-27  Ankit Jain  <[email protected]>

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

2009-03-27  Jonathan Chambers  <[email protected]>

	* 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  <[email protected]>

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

2009-02-26  Ankit Jain  <[email protected]>

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

2009-02-24  Ankit Jain  <[email protected]>

	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  <[email protected]>

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

2009-02-22  Ankit Jain  <[email protected]>

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

2009-02-21  Ankit Jain  <[email protected]>

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

2009-02-20  Ankit Jain  <[email protected]>

	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  <[email protected]>

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

2009-02-01  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

	* 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  <[email protected]>

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

2009-01-29  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

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

2009-02-19  Jonathan Chambers  <[email protected]>

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

2009-01-31  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

	* Makefile: Adjust assembly name for 3.5 profile.

2009-02-25  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

	* 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  <[email protected]>

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

2009-02-25  Ankit Jain  <[email protected]>

	* 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  <[email protected]>

	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
2009-06-03 18:54:33 +00:00
Jb Evain 9551a9a3f1 2009-06-03 Jb Evain <[email protected]>
backport of r135334.

	* main.c (dis_type): escape namespaces.


svn path=/branches/mono-2-4/mono/; revision=135335
2009-06-03 18:46:21 +00:00
Marek Habersack 78d49ba450 Backport of r135328
svn path=/branches/mono-2-4/mcs/; revision=135329
2009-06-03 17:55:32 +00:00
Veerapuram Varadhan ee8e74d14c 2009-06-03 Veerapuram Varadhan <[email protected]>
* OracleParameterTest.cs: Mark tests for bug #424908 as NotWorking
        as it requires some more thorough debugging.

svn path=/branches/mono-2-4/mcs/; revision=135315
2009-06-03 16:32:38 +00:00
Marek Habersack bc46a3e762 Backport of r135313
svn path=/branches/mono-2-4/mcs/; revision=135314
2009-06-03 16:32:38 +00:00
Veerapuram Varadhan 4dc9024c2d 2009-06-03 Veerapuram Varadhan <[email protected]>
* OracleParameter.cs:  Infer the ocitype before inferring the size

svn path=/branches/mono-2-4/mcs/; revision=135312
2009-06-03 16:31:43 +00:00
Marek Habersack 622db0d809 Backport of r135307
svn path=/branches/mono-2-4/mcs/; revision=135308
2009-06-03 15:44:48 +00:00
Gonzalo Paniagua Javier 9f8949286a 2009-06-02 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: KeepAlive check not needed.
	Fixes bug #465613.


svn path=/branches/mono-2-4/mcs/; revision=135247
2009-06-02 22:13:50 +00:00
Gonzalo Paniagua Javier 0ea6d04a70 2009-06-02 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: unbind the context after every read for keep-alive
	connections.
	Bug #502274 fixed.


svn path=/branches/mono-2-4/mcs/; revision=135242
2009-06-02 21:42:38 +00:00
Marek Habersack 6fedac8703 Backport of r135237
svn path=/branches/mono-2-4/mcs/; revision=135238
2009-06-02 21:27:30 +00:00
Veerapuram Varadhan df6f839eae 2009-06-03 Veerapuram Varadhan <[email protected]>
* OracleParameter.cs:  If a non-zero size is passed, update
	the size member but sizeSet is updated only when a non-null
	value is passed.

svn path=/branches/mono-2-4/mcs/; revision=135236
2009-06-02 21:09:06 +00:00
Gonzalo Paniagua Javier 2c79e8fd29 2009-06-02 Gonzalo Paniagua Javier <[email protected]>
* BuildManager.cs: allow deployment of precompiled applications under
	any virtual path, not just the default one used when precompiling.
	Fixes bug #483268.


svn path=/branches/mono-2-4/mcs/; revision=135232
2009-06-02 20:38:11 +00:00
Marek Habersack 8cce221351 Backport of r135205
svn path=/branches/mono-2-4/mcs/; revision=135206
2009-06-02 15:27:43 +00:00
Marek Habersack 12907a6ff5 Backport of r135147
svn path=/branches/mono-2-4/mcs/; revision=135148
2009-06-01 20:43:46 +00:00
Marek Habersack edce13a1d5 Backport of r135144
svn path=/branches/mono-2-4/mcs/; revision=135145
2009-06-01 20:18:28 +00:00
Rodrigo Kumpera 59b33685c6 2009-06-01 Rodrigo Kumpera <[email protected]>
* bug-508538.cs: New regression test.


svn path=/branches/mono-2-4/mono/; revision=135139
2009-06-01 18:47:20 +00:00
Rodrigo Kumpera e76bf9dc64 2009-06-01 Rodrigo Kumpera <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
	of ldind opcode for generic instances so we don't fail for direct wrappers.

	Fixes #508538.


svn path=/branches/mono-2-4/mono/; revision=135138
2009-06-01 18:46:37 +00:00
Marek Habersack 9c8de626c2 Backport of r135134
svn path=/branches/mono-2-4/mcs/; revision=135135
2009-06-01 18:26:26 +00:00
Marek Habersack a48a335e5f Backport of r135057
svn path=/branches/mono-2-4/mcs/; revision=135058
2009-05-29 10:25:59 +00:00
Mark Probst 385565fad4 2009-05-28 Mark Probst <[email protected]>
* collection.c (_wapi_collection_init): If pthread_create() fails,
	try again with larger and then with no stack size set.  Fixes
	#470336.

	Backport of r134985.

svn path=/branches/mono-2-4/mono/; revision=134986
2009-05-28 19:54:38 +00:00
Rodrigo Kumpera 635e76be8e 2009-05-28 Rodrigo Kumpera <[email protected]>
Backport of r134810.

	* icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
	discarded based on their most specific definition so we set the method_slots
	array before checking if the method is acceptable or not.

	Fixes #506757.


svn path=/branches/mono-2-4/mono/; revision=134944
2009-05-28 13:02:26 +00:00
Marek Habersack b32d5cd5c8 Backport of r134942
svn path=/branches/mono-2-4/mcs/; revision=134943
2009-05-28 12:34:59 +00:00
Marek Habersack 25134ad072 Backport of r134931
svn path=/branches/mono-2-4/mcs/; revision=134932
2009-05-28 09:03:48 +00:00
Marek Habersack 798a6ee9cf Backport of r134877
svn path=/branches/mono-2-4/mcs/; revision=134878
2009-05-27 20:54:42 +00:00
Andrew Jorgensen 01e82cb527 fix dist
svn path=/branches/mono-2-4/mcs/; revision=134874
2009-05-27 20:25:22 +00:00
Zoltan Varga cebff568eb 2009-05-27 Zoltan Varga <[email protected]>
* configure.in: Disable USE_MUNMAP on ppc to work around #504411.

svn path=/branches/mono-2-4/mono/; revision=134829
2009-05-27 12:26:05 +00:00
Zoltan Varga 92ff723bd0 2009-05-27 Zoltan Varga <[email protected]>
* AppDomain.cs (DoAssemblyResolve): Fix recursion detection. Fixes #507003.

svn path=/branches/mono-2-4/mcs/; revision=134825
2009-05-27 11:06:11 +00:00
Zoltan Varga 0ccffa1c56 2009-05-26 Zoltan Varga <[email protected]>
* mini-sparc.c (add_outarg_load): Fix the sparc build.

svn path=/branches/mono-2-4/mono/; revision=134800
2009-05-26 21:11:10 +00:00
Michael Barker 77884bdfa9 2009-05-25 Michael Barker <[email protected]>
* Removed amqp spec files and modified generated code to fix licensing 
	issues.

svn path=/branches/mono-2-4/mcs/; revision=134751
2009-05-26 10:52:31 +00:00
Marek Habersack d60167594d Backport of r134747
svn path=/branches/mono-2-4/mcs/; revision=134748
2009-05-26 10:02:27 +00:00
Rodrigo Kumpera c18b529f02 2009-05-25 Rodrigo Kumpera <[email protected]>
Backport of r134723.

	* class.c (mono_class_setup_fields): Don't mark simd types as having
	16 bytes alignment as the whole runtime doesn't support.


svn path=/branches/mono-2-4/mono/; revision=134724
2009-05-25 20:58:54 +00:00
Rodrigo Kumpera 83feb875fa 2009-05-25 Rodrigo Kumpera <[email protected]>
Backport of r134713/134715.

	* basic.cs: Add regression test for #506915.

	* method-to-ir.c (mono_method_to_ir): When doing the ldobj+stobj
	optimization we must check the bb of the first byte of stobj as
	it's the only one set in cil_offset_to_bb.

	Fixes #506915.	


svn path=/branches/mono-2-4/mono/; revision=134719
2009-05-25 19:04:10 +00:00
Marek Habersack bd9d2c3ecc Backport of r134682
svn path=/branches/mono-2-4/mcs/; revision=134683
2009-05-25 12:39:14 +00:00
Rodrigo Kumpera b5ef3f0ba0 2009-05-21 Rodrigo Kumpera <[email protected]>
Backport of r134536.

	* mini-x86.c (mono_arch_emit_call): The decompose code now supports
	decomposing 8 bytes structs into a LCALL.

	* mini-x86.c (emit_move_return_value): We no longer push the vtype
	pointer for where to store the returned regs.

	* decompose.c (mono_decompose_vtype_opts): Fix the comment to properly
	state the concern.

	Fixes #471747, #471751 and #4734530 (in fact, it's a bunch of dups).


svn path=/branches/mono-2-4/mono/; revision=134538
2009-05-21 14:55:04 +00:00
Marek Safar efb5876c2b 2009-05-21 Marek Safar <[email protected]>
A fix for bug #504667
	* class.cs: Check for static class using parent container instead of
	parent type.


svn path=/branches/mono-2-4/mcs/; revision=134524
2009-05-21 10:15:08 +00:00
Marek Safar baaa805118 2009-04-28 Marek Safar <[email protected]>
A fix for bug #495112
	* class.cs (IsUnmanagedType): Handle recursive unmanaged types using
	local cache.


svn path=/branches/mono-2-4/mcs/; revision=134522
2009-05-21 10:09:20 +00:00
Rodrigo Kumpera a5100746a9 2009-05-20 Rodrigo Kumpera <[email protected]>
Backport of r134470.

	* local-propagation.c (mono_local_cprop): Avoid local propagation
	across paired add/sub if the first instruction dest reg is it's
	source reg. For example:

	int_add_imm R12 <- R12 [1] clobbers: 1
	int_sub_imm R42 <- R12 [1] clobbers: 1

	The cprop pass would wrongly const prop + 1 to int_sub_imm which doesn't
	maintain the math identify.

	Fixes #505375.


svn path=/branches/mono-2-4/mono/; revision=134472
2009-05-20 19:52:20 +00:00
Dick Porter 7e797f40cd 2009-05-20 Dick Porter <[email protected]>
* XplatUICarbon.cs: Add more locking around MessageQueue
	manipulations.


svn path=/branches/mono-2-4/mcs/; revision=134466
2009-05-20 16:11:21 +00:00
Gonzalo Paniagua Javier c2c809fb85 revert. more things broken than fixed
svn path=/branches/mono-2-4/mcs/; revision=134364
2009-05-19 03:02:55 +00:00
Marek Habersack 6e9f407dfe Backport of r134342
svn path=/branches/mono-2-4/mcs/; revision=134343
2009-05-18 19:04:06 +00:00
Jb Evain b29ead8210 2009-05-18 Jb Evain <[email protected]>
backport of 134333.

	* Enumerable.cs (Max, Min): fix generic versions.


svn path=/branches/mono-2-4/mcs/; revision=134334
2009-05-18 17:09:15 +00:00
Veerapuram Varadhan 4a3d91e86d fix for #417398
svn path=/branches/mono-2-4/mcs/; revision=134314
2009-05-18 11:47:47 +00:00
Gonzalo Paniagua Javier 0320aca3ce 2009-05-16 Gonzalo Paniagua Javier <[email protected]>
* RouteCollection.cs: when there is no named route, try the current
	route before going through the list. The known values (default or
	not) for the current route are merged with the values provided when
	attempting to match.
	Example:
		Html.RouteLink ("Text", new { page = 5 });
	
	when the current path is /some/path-here and the route is:

		routes.MapRoute("RouteName", "some/{one}-{two}/{page}",
		new { controller = "Some", action = "Index", page = 1});


svn path=/branches/mono-2-4/mcs/; revision=134273
2009-05-16 09:41:11 +00:00
Gonzalo Paniagua Javier 175a146f47 2009-05-16 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs:
	* HttpWebRequest.cs: support automatic decompression of the response.
	Fixes bug #504391.



svn path=/branches/mono-2-4/mcs/; revision=134270
2009-05-16 05:47:12 +00:00
Veerapuram Varadhan 961333f673 2009-05-16 Veerapuram Varadhan <[email protected]>
** Fixes #325464 - ToolItems.xsd
	* CustomDataClassGenerator.cs (CreateDataSetTableMembers): Prefix a "_" to
	member names when it is same as that of the dataset.  Fixes the CS0542 error
	during compilation of the generated source.

svn path=/branches/mono-2-4/mcs/; revision=134264
2009-05-16 02:43:50 +00:00
Veerapuram Varadhan 7715562698 2009-05-16 Veerapuram Varadhan <[email protected]>
* Tds70.cs (WriteParameterInfo): fix r134256 backport errors.

svn path=/branches/mono-2-4/mcs/; revision=134262
2009-05-16 01:48:14 +00:00
Veerapuram Varadhan bf47ba5538 Nunit 2.4 changes and other sqlserver config fixes
svn path=/branches/mono-2-4/mcs/; revision=134261
2009-05-16 01:48:00 +00:00
Veerapuram Varadhan f114e716b0 Fix for bug #382589 and corresponding tests
svn path=/branches/mono-2-4/mcs/; revision=134260
2009-05-16 01:47:45 +00:00
Veerapuram Varadhan c0a0cb21a4 2009-05-16 Veerapuram Varadhan <[email protected]>
** Fixes #382589
	* Tds.cs (ServerTdsVersion): New property to access ServerVersion.

	* Tds70.cs (WriteParameterInfo): Treat Decimal types as Numeric
	types from SQL Server 2000.

	* TdsVersion.cs: Add SQL Server 2008 version.

svn path=/branches/mono-2-4/mcs/; revision=134259
2009-05-16 01:47:28 +00:00
Veerapuram Varadhan 2f6f1603b6 2009-09-15 Veerapuram Varadhan <[email protected]>
* OracleParameter.cs: Consider DBNull.Value as null and
	update size and sizeSet accordingly.

svn path=/branches/mono-2-4/mcs/; revision=134195
2009-05-15 11:04:10 +00:00
Veerapuram Varadhan 3730ece7de 2009-05-15 Veerapuram Varadhan <[email protected]>
** Fixes #424908
	* OracleParameter.cs:  Make sure size and sizeSet are properly
	updated whenever value changes.

svn path=/branches/mono-2-4/mcs/; revision=134194
2009-05-15 11:03:48 +00:00
Marek Habersack 953716e8cd Backport of r134176
svn path=/branches/mono-2-4/mcs/; revision=134177
2009-05-15 01:21:56 +00:00
Miguel de Icaza 00a66dbe5d Here as well
svn path=/branches/mono-2-4/mono/; revision=134145
2009-05-14 16:51:40 +00:00
Gonzalo Paniagua Javier cfa2cc2a08 2009-05-14 Gonzalo Paniagua Javier <[email protected]>
* TypeTest.cs: test for bug #503728


svn path=/branches/mono-2-4/mcs/; revision=134115
2009-05-14 10:24:18 +00:00
Gonzalo Paniagua Javier cccde54ea0 2009-05-14 Gonzalo Paniagua Javier <[email protected]>
* Type.cs: (GetInterfaceMap) 'this' can't be an interface itself.
	Fixed bug #503728.


svn path=/branches/mono-2-4/mcs/; revision=134113
2009-05-14 10:18:27 +00:00
Marek Habersack 6a5a182180 Backport r134097
svn path=/branches/mono-2-4/mcs/; revision=134098
2009-05-14 01:19:39 +00:00
Veerapuram Varadhan 1e81e3db35 2009-05-12 Veerapuram Varadhan <[email protected]>
** Fixes rest of #497715 - Patch by Jonas Larsson <[email protected]>
	* TdsMetaParameter.cs: Add support for XML type.  For now, handle
	XML type as just NVarchar.
	backport of r134079

svn path=/branches/mono-2-4/mcs/; revision=134080
2009-05-13 21:08:02 +00:00
Zoltan Varga 72a67245bd 2009-04-17 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_output_basic_block): Add a few nops before
	indirect calls to simplify get_vcall_slot_addr (). Fixes #494567.
	(mono_arch_get_vcall_slot): Simplify this.

svn path=/branches/mono-2-4/mono/; revision=134066
2009-05-13 15:58:38 +00:00
Zoltan Varga 6a1d1d113b 2009-05-07 Zoltan Varga <[email protected]>
* aot-compiler.c (add_wrappers): Add remoting-invoke-with-check wrappers
	for virtual methods too.

svn path=/branches/mono-2-4/mono/; revision=134065
2009-05-13 15:58:31 +00:00
Gonzalo Paniagua Javier 5e4ee8006b 2009-05-12 Gonzalo Paniagua Javier <[email protected]>
* UrlPattern.cs: if the pattern is line {a}/{b} and {b} is substituted
	by an empty string, remove the '/' too.


svn path=/branches/mono-2-4/mcs/; revision=134027
2009-05-13 00:39:20 +00:00
Gonzalo Paniagua Javier c75f541751 2009-05-12 Gonzalo Paniagua Javier <[email protected]>
* UrlPattern.cs: non-string default arguments work now.


svn path=/branches/mono-2-4/mcs/; revision=134013
2009-05-12 23:17:26 +00:00
Marek Habersack 2f447342f4 Backport of r133997
svn path=/branches/mono-2-4/mcs/; revision=133998
2009-05-12 21:51:19 +00:00
Marek Habersack 0e67677eaa Backport of r133990
svn path=/branches/mono-2-4/mcs/; revision=133991
2009-05-12 20:38:03 +00:00
Gonzalo Paniagua Javier 3d4ef534d3 2009-05-11 Gonzalo Paniagua Javier <[email protected]>
* TcpClient.cs:
	* Socket.cs:
	* UdpClient.cs: use GetHostAddresses() instead of Resolve or
	GetHostEntry.


svn path=/branches/mono-2-4/mcs/; revision=133952
2009-05-12 03:56:07 +00:00
Gonzalo Paniagua Javier ea13af4c15 2009-05-11 Gonzalo Paniagua Javier <[email protected]>
* Dns.cs: made GetHostAddresses and friends internal for 1.x
	* EndpointPermission.cs: use GetHostAddresses.


svn path=/branches/mono-2-4/mcs/; revision=133950
2009-05-12 03:49:40 +00:00
Gonzalo Paniagua Javier dad8256567 2009-05-11 Gonzalo Paniagua Javier <[email protected]>
* UdpClient.cs: if possible, avoid DNS lookups when the host name is
	an IP address. Related to bug #502866.


svn path=/branches/mono-2-4/mcs/; revision=133945
2009-05-12 03:14:47 +00:00
Marek Habersack 0846bfde9c Backport of r133904
svn path=/branches/mono-2-4/mcs/; revision=133906
2009-05-11 17:12:33 +00:00
Gonzalo Paniagua Javier 1353d2bd9d fix prev patch
svn path=/branches/mono-2-4/mcs/; revision=133875
2009-05-11 04:14:07 +00:00
Gonzalo Paniagua Javier 04f27881b2 2009-05-10 Gonzalo Paniagua Javier <[email protected]>
* CookieContainer.cs: matching hosts to domain names like MS does.
	Bug #421827 fixed.


svn path=/branches/mono-2-4/mcs/; revision=133873
2009-05-11 03:58:26 +00:00
Gonzalo Paniagua Javier de95f52a19 2009-05-10 Gonzalo Paniagua Javier <[email protected]>
* CustomizableFileSettingsProvider.cs: make sure 'values' is
	initialized in Reset(). Fixes bug #436592.


svn path=/branches/mono-2-4/mcs/; revision=133867
2009-05-11 02:06:11 +00:00
Marek Habersack 766fa75d4e Backport of r133861
svn path=/branches/mono-2-4/mcs/; revision=133862
2009-05-10 20:29:36 +00:00
Marek Habersack 4ed3bd43af Backport of r129198
svn path=/branches/mono-2-4/mcs/; revision=133822
2009-05-08 22:21:10 +00:00
Andrés G. Aragoneses 12f967afbb Backport from trunk (r133814)
svn path=/branches/mono-2-4/mcs/; revision=133819
2009-05-08 21:19:07 +00:00
Brad Taylor dd219fbf4a 2009-05-08 Brad Taylor <[email protected]>
* DateTimePicker.cs: Add a UIA-specific property to ensure that if
	is_checkbox_checked is changed, we won't break.


svn path=/branches/mono-2-4/mcs/; revision=133816
2009-05-08 20:29:31 +00:00
Gonzalo Paniagua Javier 2b0da97307 2009-05-08 Gonzalo Paniagua Javier <[email protected]>
* Convert.cs: backport from HEAD.


svn path=/branches/mono-2-4/mcs/; revision=133813
2009-05-08 19:35:53 +00:00
Marek Safar ed03a4b616 Updated after some trunk runtime changes went to 2.4
svn path=/branches/mono-2-4/mcs/; revision=133795
2009-05-08 17:06:48 +00:00
Miguel de Icaza 990c2886cc Fix another
svn path=/branches/mono-2-4/mcs/; revision=133791
2009-05-08 16:36:33 +00:00
Miguel de Icaza e153058144 backport fix
svn path=/branches/mono-2-4/mcs/; revision=133790
2009-05-08 16:29:08 +00:00
Brad Taylor d3d4619649 2009-05-08 Brad Taylor <[email protected]>
* DateTimePicker.cs: Wrap UIA specific code in NET_2_0 wrappers.  Send
	OnUIASelectionChanged when ShowCheckbox is true and the checkbox
	recieves focus.  Part of fix for #502029.


svn path=/branches/mono-2-4/mcs/; revision=133782
2009-05-08 15:58:01 +00:00
Veerapuram Varadhan 7f83ae1ecb backport of r133769
svn path=/branches/mono-2-4/mcs/; revision=133771
2009-05-08 14:26:00 +00:00
Miguel de Icaza 0d61dc371a Backport pain removal
svn path=/branches/mono-2-4/mono/; revision=133753
2009-05-08 02:11:27 +00:00
Gonzalo Paniagua Javier 5a565524f2 2009-05-07 Gonzalo Paniagua Javier <[email protected]>
* MimeTypes.cs: add silverlight related types.


svn path=/branches/mono-2-4/mcs/; revision=133750
2009-05-07 21:42:04 +00:00
Gonzalo Paniagua Javier beb06f5ba3 2009-05-07 Gonzalo Paniagua Javier <[email protected]>
* Connection.cs: if the socket is already disconnected, Shutdown will
	fail with a SocketException... Also, catch *all* the possible
	exceptions since the socket.Close method could also throw
	ObjectDisposedException.
	Fixes bug #449092.


svn path=/branches/mono-2-4/mcs/; revision=133735
2009-05-07 18:14:37 +00:00
Jeffrey Stedfast 03879114a5 2009-04-22 Jeffrey Stedfast <[email protected]>
* src/gtimer-win32.c (g_timer_elapsed): Avoid re-querying freq by
	just saving it in a static variable. Also modified microseconds
	calculation to avoid overflow.


svn path=/branches/mono-2-4/mono/; revision=133723
2009-05-07 15:40:41 +00:00
Jb Evain 2c7c1705fb 2009-05-07 Jb Evain <[email protected]>
backport of r133710.

	* XElement.cs (Load (XmlReader,LoadOptions)): prevent a NRE if
	the provided XmlReader doesn't have existing settings.
	Fixes #501589.

svn path=/branches/mono-2-4/mcs/; revision=133712
2009-05-07 07:27:36 +00:00
Miguel de Icaza ee8b6bcbfb Backport changes
svn path=/branches/mono-2-4/mcs/; revision=133701
2009-05-07 00:44:22 +00:00
Mike Gorse 1b4d05a818 * FileDialog.cs: Add UIAFocusedItemChanged to PopupButtonPanel.
Add PerformClick and PerformDoubleClick to PopupButton.
Fixes #499851.

svn path=/branches/mono-2-4/mcs/; revision=133666
2009-05-06 15:16:00 +00:00
Miguel de Icaza 454bed799a Backport fixes from trunk to 2-4 for eglib
svn path=/branches/mono-2-4/mono/; revision=133661
2009-05-06 15:06:25 +00:00
Zoltan Varga 46e970f78a 2009-05-06 Zoltan Varga <[email protected]>
Backport of r133651.

	* aot-compiler.c aot-runtime.c: Use our own hash function instead of
	g_str_hash () which can change.

svn path=/branches/mono-2-4/mono/; revision=133654
2009-05-06 13:32:07 +00:00
Zoltan Varga 0fce1b7b6c 2009-05-06 Zoltan Varga <[email protected]>
* driver.c (mini_regression): Disable optimizations not supported by
	the cpu. Fixes #500019.

svn path=/branches/mono-2-4/mono/; revision=133647
2009-05-06 10:47:16 +00:00
Gonzalo Paniagua Javier 56369a2b24 2009-05-05 Gonzalo Paniagua Javier <[email protected]>
* io-layer/events.c: fix event_signal and namedevent_signal to actually signal
	the handle.

	* metadata/icall-def.h:
	* metadata/threads-types.h:
	* metadata/threads.c: added internal call for WaitHandle.SignalAndWait.

svn path=/branches/mono-2-4/mono/; revision=133631
2009-05-06 01:15:01 +00:00
Lluis Sanchez fc78b62d49 2009-05-06 Lluis Sanchez Gual <[email protected]>
* Lease.cs: Don't use ArrayList.Remove() to remove sponsors because
	it will end calling Equals, which may crash if the sponsor is not
	available anymore. Just compare references.


svn path=/branches/mono-2-4/mcs/; revision=133623
2009-05-05 23:21:13 +00:00
Lluis Sanchez 16f49ea247 2009-05-06 Lluis Sanchez Gual <[email protected]>
* RealProxy.cs: If async dispatch crashes, don't propagate the
	exception. The exception will be raised when calling EndInvoke.


svn path=/branches/mono-2-4/mcs/; revision=133622
2009-05-05 23:21:00 +00:00
Miguel de Icaza 26635baa7d 2009-05-05 Miguel de Icaza <[email protected]>
* Contribution from David Uvalle <[email protected]> that
	implements FileInfo.Replace.

svn path=/branches/mono-2-4/mcs/; revision=133618
2009-05-05 22:58:54 +00:00
Marek Habersack 28bef0dc2c Backport of r133606
svn path=/branches/mono-2-4/mcs/; revision=133607
2009-05-05 20:47:23 +00:00
Zoltan Varga 9212e1ffd0 2009-05-05 Zoltan Varga <[email protected]>
* genmdesc.pl (load_opcodes): Fix this after the TARGET_... changes.

svn path=/branches/mono-2-4/mono/; revision=133602
2009-05-05 19:31:11 +00:00
Miguel de Icaza ebffe8d0dc Do not build docs if cross compiling or the mcs build is disabled
svn path=/branches/mono-2-4/mono/; revision=133593
2009-05-05 17:42:26 +00:00
Miguel de Icaza 734c7df34b There was a missing \
svn path=/branches/mono-2-4/mono/; revision=133589
2009-05-05 17:21:30 +00:00
Marek Habersack 4807150835 Backport of r133577
svn path=/branches/mono-2-4/mcs/; revision=133578
2009-05-05 13:17:50 +00:00
Marek Habersack f5a339a061 Backport r133574
svn path=/branches/mono-2-4/mcs/; revision=133575
2009-05-05 12:30:55 +00:00
Marek Habersack 1e9b516492 Backport of r133568
svn path=/branches/mono-2-4/mcs/; revision=133569
2009-05-05 09:03:49 +00:00
Carlos Alberto Cortez 6dd8581aa1 2009-05-04 Carlos Alberto Cortez <[email protected]>
* ToolStripDropDown.cs: In OnVisibleChanged, if we have an OwnerItem,
	fire OnDropDownOpened/OnDropDownClosed depending on the new
	visibility. This also ensures that any direct access to this instance
	will fire the mentioned events for the OwnerItem.
	* ToolStripDropDownItem.cs: Remove the invocations to
	OnDropDownOpened/OnDropDownClosed, since they are handled in
	ToolStripDropDown, as well as updating the
	OnDropDownHide/OnDropDownShow calls to be in the right order.
	Fixes #496139.


svn path=/branches/mono-2-4/mcs/; revision=133554
2009-05-05 01:49:02 +00:00
Carlos Alberto Cortez f96863c0c0 2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: If Insert is pressed, change the internal
	overwrite mode for our default value.
	Fixes some bits of #477395.


svn path=/branches/mono-2-4/mcs/; revision=133552
2009-05-05 01:45:40 +00:00
Carlos Alberto Cortez 65f53a293d 2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: When setting Text use the very precise algorithm
	that .net uses: iterate over every char of the new value, trying to
	use every char, and use a normal call to MaskedTextProvider.Replace
	call if RejectInputOnFirstFailure is true. Fire OnMaskInputRejected 
	in case of error in both cases, as well.
	Fixes #477408.


svn path=/branches/mono-2-4/mcs/; revision=133551
2009-05-05 01:42:19 +00:00
Carlos Alberto Cortez 54983f1c97 2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: Handle OnKeyDown to properly process the Delete
	key. Also create a new method to avoid code duplication between
	OnKeyDown and OnKeyPress.
	Fixes #477388.


svn path=/branches/mono-2-4/mcs/; revision=133550
2009-05-05 01:40:10 +00:00
Carlos Alberto Cortez a750705f64 2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: In OnKeyPress the IsOverwriteMode check is
	actually inversed, so put it the right way. Also, don't automatically
	look for the next editable item after adding a new one, but way for
	the next insertion (this is what .net does) - this is not needed when
	MaskedTextProvider.InsertAt is called however, since it already looks for the
	next editable position.
	Fixes the remaining bits of #477383.


svn path=/branches/mono-2-4/mcs/; revision=133549
2009-05-05 01:35:56 +00:00
Carlos Alberto Cortez 6f5aeb8948 2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: In OnKeyPress handle backspace by calling
	MaskedTextProvider.RemoveAt method. Also for setting the SelectionStart
	property after the text was modified, adjust the testPosition value
	depending on what method was called.
	Fixes part of #477383.


svn path=/branches/mono-2-4/mcs/; revision=133548
2009-05-05 01:33:47 +00:00
Andrés G. Aragoneses 7569f306e1 Backport from trunk (r133510)
svn path=/branches/mono-2-4/mcs/; revision=133512
2009-05-04 16:30:43 +00:00
Marek Habersack 3d96aa17e4 Backport of r133500
svn path=/branches/mono-2-4/mcs/; revision=133501
2009-05-04 13:30:12 +00:00
Gonzalo Paniagua Javier 13ae2a4d50 2009-05-03 Gonzalo Paniagua Javier <[email protected]>
* TermInfoDriver.cs: replace Peek with DataAvailable.


svn path=/branches/mono-2-4/mcs/; revision=133462
2009-05-04 03:40:12 +00:00
Gonzalo Paniagua Javier 37158959c3 2009-05-03 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: we just need the address(es), not a host entry. This avoids
	querying the DNS server(s) when the target is an IP address.


svn path=/branches/mono-2-4/mcs/; revision=133460
2009-05-04 03:14:44 +00:00
Sebastien Pouliot 951c613a76 2009-05-03 Sebastien Pouliot <[email protected]>
* MethodInfoTest.cs: Add test cases from Joachim Ante for bug
	#500385.
	[Backport of r133428]


svn path=/branches/mono-2-4/mcs/; revision=133430
2009-05-03 16:27:06 +00:00
Martin Baulig 70da744115 2009-05-03 Martin Baulig <[email protected]>
* debug-debugger.c (debugger_insert_source_breakpoint): Don't call
	mono_debugger_insert_method_breakpoint() since the class init
	handler we're inserting at the top of the method already gives us
	a notification.

svn path=/branches/mono-2-4/mono/; revision=133424
2009-05-03 12:44:37 +00:00
Veerapuram Varadhan 85e63d2cd5 ChangeLog conflict changes
svn path=/branches/mono-2-4/mcs/; revision=133363
2009-05-02 05:03:40 +00:00
Veerapuram Varadhan f249a2c1db 2009-04-19 Veerapuram Varadhan <[email protected]>
* Tds.cs (InitExec): Move initialization of state variables here.  Useful
	in case of asynchronous queries.

svn path=/branches/mono-2-4/mcs/; revision=133362
2009-05-02 05:03:20 +00:00
Veerapuram Varadhan 43bd6f2f86 2009-04-16 Veerapuram Varadhan <[email protected]>
* Tds.cs (ExecuteQuery): Reset all the variables related to LoadData when
	performing queries with SequentialAccess set to true.  Fixes incorrect
	handling of data retrieval when consecutive queries are run with
	SequentialAccess set to true.

svn path=/branches/mono-2-4/mcs/; revision=133361
2009-05-02 05:02:56 +00:00
Veerapuram Varadhan 4bc5df32e1 2009-04-14 Veerapuram Varadhan <[email protected]>
* Tds.cs (ExecuteQuery): Reset SequentialAccess read state variables
	in order to avoid blocking forever when two consecutive queries are
	executed with SequetialAccess set to true.

svn path=/branches/mono-2-4/mcs/; revision=133360
2009-05-02 05:02:33 +00:00
Veerapuram Varadhan e6367cc7d6 backport of r129377
svn path=/branches/mono-2-4/mcs/; revision=133359
2009-05-02 05:02:03 +00:00
Gonzalo Paniagua Javier a9e450aa11 2009-05-01 Gonzalo Paniagua Javier <[email protected]>
* SqliteConnection.cs: implement Dispose for 2.0. It was leaking an fd
	in using().
	Bug #499864 fixed.


svn path=/branches/mono-2-4/mcs/; revision=133255
2009-05-01 04:28:58 +00:00
Gonzalo Paniagua Javier cfcea6721d 2009-04-30 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: return the last error if a connect to multiple addresses
	fails.


svn path=/branches/mono-2-4/mcs/; revision=133253
2009-05-01 03:29:25 +00:00
Marek Habersack c452847c6e Backport of r133169
svn path=/branches/mono-2-4/mcs/; revision=133170
2009-04-30 10:54:01 +00:00
Zoltan Varga b5a9fcd4d3 2009-04-30 Zoltan Varga <[email protected]>
* appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid
	returning refonly assemblies if refonly is FALSE. Fixes #499013.

svn path=/branches/mono-2-4/mono/; revision=133165
2009-04-30 07:37:56 +00:00
Zoltan Varga 212a86bd9d 2009-04-30 Zoltan Varga <[email protected]>
* aot-compiler.c (asm_writer_emit_writeout): Strip 'mapping symbols'
	when compiling for ARM.

svn path=/branches/mono-2-4/mono/; revision=133085
2009-04-29 22:41:19 +00:00
Gonzalo Paniagua Javier 4106ae8724 2009-04-29 Gonzalo Paniagua Javier <[email protected]>
* sockets.c: don't display a warning when connect() fails because the
	socket was closed in another thread.


svn path=/branches/mono-2-4/mono/; revision=133032
2009-04-29 16:01:18 +00:00
Zoltan Varga f7a6b3c10d 2009-04-29 Zoltan Varga <[email protected]>
* method-to-ir.c (inline_method): Save/Restore cfg->ret_var_set too.

svn path=/branches/mono-2-4/mono/; revision=133022
2009-04-29 15:05:24 +00:00
Marek Habersack 68fbdb13ff Backport of r132962
svn path=/branches/mono-2-4/mcs/; revision=133004
2009-04-29 13:27:49 +00:00
Zoltan Varga 378ea0e69a 2009-04-29 Zoltan Varga <[email protected]>
* mini.c (mini_method_compile): Use TARGET_<ARCH> defines instead of
	__<arch>__ defines in the JIT code.

svn path=/branches/mono-2-4/mono/; revision=132980
2009-04-29 10:00:32 +00:00
Zoltan Varga 2d66b2d667 2009-04-29 Zoltan Varga <[email protected]>
* *.h *.c: Use TARGET_<ARCH> defines instead of __<arch>__ defines in the
	JIT code.

svn path=/branches/mono-2-4/mono/; revision=132979
2009-04-29 09:43:51 +00:00
Zoltan Varga 1c8136a644 2009-04-28 Zoltan Varga <[email protected]>
* configure.in: Define a TARGET_<ARCH> preprocessor symbol for some
	architectures.

svn path=/branches/mono-2-4/mono/; revision=132978
2009-04-29 09:43:41 +00:00
Gonzalo Paniagua Javier c19e82d15a fix test
svn path=/branches/mono-2-4/mcs/; revision=132957
2009-04-29 05:42:16 +00:00
Gonzalo Paniagua Javier 4c4ea4bc09 2009-04-29 Gonzalo Paniagua Javier <[email protected]>
* Enum.cs: return the value as an enum of the right type.


svn path=/branches/mono-2-4/mcs/; revision=132954
2009-04-29 05:29:15 +00:00
Gonzalo Paniagua Javier 11da3ab5e4 fix changelog
svn path=/branches/mono-2-4/mcs/; revision=132948
2009-04-29 03:21:27 +00:00
Gonzalo Paniagua Javier 0ad99d28da 2009-04-13 Gonzalo Paniagua Javier <[email protected]>
* HttpUtility.cs: the collection returned from ParseQueryString knows
	how to convert the key/value pairs to a string.


svn path=/branches/mono-2-4/mcs/; revision=132947
2009-04-29 03:19:22 +00:00
Gonzalo Paniagua Javier 588cb965ee 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* Enum.cs: avoid exceptions from ToObject and use Try* instead.


svn path=/branches/mono-2-4/mcs/; revision=132945
2009-04-29 03:00:32 +00:00
Gonzalo Paniagua Javier 65b57eb6ac 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* SqlConnection.cs: if the error causes a disconnection from the
	server, close the data stream.


svn path=/branches/mono-2-4/mcs/; revision=132943
2009-04-29 02:55:23 +00:00
Gonzalo Paniagua Javier 4e7ab67563 changelog
svn path=/branches/mono-2-4/mcs/; revision=132941
2009-04-29 02:53:31 +00:00
Gonzalo Paniagua Javier 61602b310d 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* TdsConnectionPool.cs: if GetConnection() fails to create a
	connection, try again several times and then throw. Improved
	ResetConnectionPool() so that it does not immediately close
	connections in use. Don't re-add connections that have been closed.

	* Tds.cs: Connected tests the socket connection too. Made Disconnect()
	not throw.

	* TdsComm.cs: set more socket options (timeout and NoDelay) and have a
	single entry point for reading from the stream.


svn path=/branches/mono-2-4/mcs/; revision=132940
2009-04-29 02:53:11 +00:00
Zoltan Varga 510d3ffb5a 2009-04-29 Zoltan Varga <[email protected]>
* gc_wrapper.h: Disable thread-local alloc for arm too.

svn path=/branches/mono-2-4/mono/; revision=132913
2009-04-28 23:16:34 +00:00
Zoltan Varga ee0244dfc5 2009-01-25 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Handle ARM as well.

svn path=/branches/mono-2-4/mono/; revision=132904
2009-04-28 22:44:50 +00:00
Zoltan Varga 3eb001da36 2009-04-28 Zoltan Varga <[email protected]>
* configure.in: Add an option to disable the solaris tar check.

svn path=/branches/mono-2-4/mono/; revision=132900
2009-04-28 22:32:41 +00:00
Martin Baulig 29035caddf **** Backport of r130659 ****
2009-03-31  Martin Baulig  <[email protected]>

	* mono-debug-debugger.h (MonoDebuggerEvent): Add
	`MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
	`MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
	(mono_debugger_event_create_appdomain): New function.
	(mono_debugger_event_unload_appdomain): New function.

	* appdomain.c (mono_domain_create_appdomain_internal): Call
	mono_debugger_event_create_appdomain().

svn path=/branches/mono-2-4/mono/; revision=132892
2009-04-28 21:11:23 +00:00
Martin Baulig 77754c9b71 **** Backport of r130658 ****
2009-03-31  Martin Baulig  <[email protected]>

	* debug-debugger.c (debugger_remove_breakpoint): Call
	mono_debugger_remove_class_init_callback ().

2009-03-31  Martin Baulig  <[email protected]>

	* mono-debug-debugger.c
	(mono_debugger_register_class_init_callback): Also register the
	class init callback if the class is already initialized to make
	things work with shadow copied assemblies.

svn path=/branches/mono-2-4/mono/; revision=132891
2009-04-28 21:11:07 +00:00
Zoltan Varga 70a3b232fd 2009-04-28 Zoltan Varga <[email protected]>
* image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes
	part of #498692.

svn path=/branches/mono-2-4/mono/; revision=132877
2009-04-28 18:12:40 +00:00
Zoltan Varga 6203a2757a 2009-04-28 Zoltan Varga <[email protected]>
* misc.c (GC_init): Avoid casting an lvalue. Fixes part of #498692.

svn path=/branches/mono-2-4/mono/; revision=132876
2009-04-28 18:12:32 +00:00
Zoltan Varga c294459c83 2009-04-23 Tom Hindle <[email protected]>
* cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
	changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.

svn path=/branches/mono-2-4/mono/; revision=132873
2009-04-28 18:02:13 +00:00
Gonzalo Paniagua Javier f639f4a183 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* ConsoleTraceListener.cs: add an internal constructor that takes a
	string argument. Used when 'initializeData' is set.
	* DiagnosticsConfigurationHandler.cs: try internal constructors when
	the assembly is System.
	Fixes bug #498853.


svn path=/branches/mono-2-4/mcs/; revision=132869
2009-04-28 17:47:49 +00:00
Miguel de Icaza 04470304fc Update: +EXPR was never supported, just EXPR
svn path=/branches/mono-2-4/mono/; revision=132849
2009-04-28 14:53:51 +00:00
Marek Habersack 8010c932da Backport of r132812
svn path=/branches/mono-2-4/mcs/; revision=132813
2009-04-28 08:40:04 +00:00
Andrés G. Aragoneses 864052686a backport r132782
svn path=/branches/mono-2-4/mcs/; revision=132783
2009-04-27 20:35:41 +00:00
Brad Taylor 95f681ad07 2009-04-27 Brad Taylor <[email protected]>
* ToolStripButton.cs: Emit an internal event when CheckOnClick is
	changed.


svn path=/branches/mono-2-4/mcs/; revision=132780
2009-04-27 20:14:01 +00:00
Gonzalo Paniagua Javier f983adfba7 2009-04-27 Gonzalo Paniagua Javier <[email protected]>
* assembly.c: assemblies in the GAC should never be shadow-copied.


svn path=/branches/mono-2-4/mono/; revision=132765
2009-04-27 16:34:37 +00:00
Marek Habersack ad2ff59c4e Backport of r130971
svn path=/branches/mono-2-4/mcs/; revision=132708
2009-04-27 07:06:49 +00:00
Miguel de Icaza 353e721243 Backport:
2009-04-25  Miguel de Icaza  <[email protected]>

	* StreamReader.cs (DataAvailable): New internal function to work
	around the fact that StreamReaders are now blocking on Peek(), and
	that our own Console.TermInfoDriver used Peek() as a way of
	probing if there was data on a stream before to avoid blocking. o

2009-04-25  Miguel de Icaza  <[email protected]>

	* TermInfoDriver.cs: Use the new StreamReader.DataAvailable to
	load all the data that was added into the `stdin' stream when we
	did the `Read'.


svn path=/branches/mono-2-4/mcs/; revision=132671
2009-04-25 19:33:31 +00:00
Miguel de Icaza 6d8d1190c8 Reapply the fix from Gonzalo for 496905 and apply his patch to TermInfodriver that fixes csharp usage
svn path=/branches/mono-2-4/mcs/; revision=132669
2009-04-25 19:04:47 +00:00
Miguel de Icaza 9f8610512d 2009-04-25 Miguel de Icaza <[email protected]>
Backport of r129367
	
        * Convert.cs (ToType): Control whether this internal function will
        call an IConvertible.ToType method or not.

        Classes and structs implementing IConvertible in mscorlib (the
        only callers that can access Convert.ToType) must pass false to
        avoid a infinite recursion problem and callers from the public
        Convert API must call it with true.

        This fixes the regression reported in #485377 that was introduced
        by the fix for #481687.

        * Int16.cs, UInt64.cs, Double.cs, Enum.cs, SByte.cs, UInt16.cs,
        Byte.cs, Decimal.cs, Int32.cs, String.cs, Int64.cs, Char.cs,
        Boolean.cs, Single.cs, UInt32.cs: Update the call sites.

svn path=/branches/mono-2-4/mcs/; revision=132668
2009-04-25 19:03:52 +00:00
Miguel de Icaza 82183bbfbd Revert 132603, 132604 as it made the csharp console stop working
svn path=/branches/mono-2-4/mcs/; revision=132639
2009-04-24 23:47:29 +00:00
Marek Habersack aeb9042fbf Backport of r132619
svn path=/branches/mono-2-4/mcs/; revision=132620
2009-04-24 20:56:02 +00:00
Marek Habersack e4a8ce3b6c Backport of r132617
svn path=/branches/mono-2-4/mcs/; revision=132618
2009-04-24 20:44:48 +00:00
Marek Habersack 669895404a Backport of r132607
svn path=/branches/mono-2-4/mcs/; revision=132608
2009-04-24 18:54:59 +00:00
Gonzalo Paniagua Javier 0cbba93484 2009-04-24 Gonzalo Paniagua Javier <[email protected]>
* StreamReader.cs: if Peek() needs to block, do it.
	Fixes bug #496905.


svn path=/branches/mono-2-4/mcs/; revision=132604
2009-04-24 16:46:47 +00:00
Gonzalo Paniagua Javier 85abf75e04 2009-04-24 Gonzalo Paniagua Javier <[email protected]>
* StreamReaderTest.cs: new test. Using Peek() when we did a short read
	should block if needed.


svn path=/branches/mono-2-4/mcs/; revision=132603
2009-04-24 16:46:37 +00:00
Zoltan Varga 5ae581bcdd 2009-02-22 Zoltan Varga <[email protected]>
* threads.c (mono_thread_suspend_all_other_threads): Handle the case when
	the a thread does not suspend within 100ms.

	* monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
	in addition to StopRequested as well.

svn path=/branches/mono-2-4/mono/; revision=132494
2009-04-23 17:47:52 +00:00
Marek Habersack ff03387d96 Backport of r132482
svn path=/branches/mono-2-4/mcs/; revision=132483
2009-04-23 16:48:13 +00:00
Gonzalo Paniagua Javier ea3901feb9 2009-04-22 Gonzalo Paniagua Javier <[email protected]>
* Win32Exception.cs: made W32ErrorMessage internal.


svn path=/branches/mono-2-4/mcs/; revision=132395
2009-04-22 19:01:36 +00:00
Gonzalo Paniagua Javier 53e2b831d2 2009-04-22 Gonzalo Paniagua Javier <[email protected]>
* Microsoft.CSharp/CSharpCodeCompiler.cs:
	* Microsoft.VisualBasic/VBCodeCompiler.cs: better error when there's a
	problem running the specified exec.


svn path=/branches/mono-2-4/mcs/; revision=132391
2009-04-22 18:37:47 +00:00
Marek Habersack 13ff6c52c4 Backport of r132366
svn path=/branches/mono-2-4/mcs/; revision=132367
2009-04-22 14:56:22 +00:00
Zoltan Varga 5027d8438f 2009-04-22 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Force init_locals to be TRUE
	to prevent asserts in various passes. Fixes #497220.

svn path=/branches/mono-2-4/mono/; revision=132365
2009-04-22 13:06:14 +00:00
Gonzalo Paniagua Javier e14429066c 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* HttpSoapWebServiceHandler.cs: provide the full stack trace instead
	of just the Message to aid in debugging web service problems.
	Bug #496758 fixed.


svn path=/branches/mono-2-4/mcs/; revision=132336
2009-04-21 22:42:06 +00:00
Marek Habersack 0ec0584d37 Backport of r132312
svn path=/branches/mono-2-4/mcs/; revision=132313
2009-04-21 19:57:28 +00:00
Marek Habersack a62741d0f9 Backport of r132300
svn path=/branches/mono-2-4/mcs/; revision=132302
2009-04-21 17:54:52 +00:00
Zoltan Varga 86eb24ad8c 2009-04-21 Zoltan Varga <[email protected]>
* mini-trampolines.c (mono_generic_class_init_trampoline): Remove
	a racy assert.

svn path=/branches/mono-2-4/mono/; revision=132301
2009-04-21 17:54:46 +00:00
Gonzalo Paniagua Javier 2ffdbbf908 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* DnsTest.cs: new IP for go-mono and fix AsyncResolve test.


svn path=/branches/mono-2-4/mcs/; revision=132295
2009-04-21 17:03:35 +00:00
Gonzalo Paniagua Javier 26c6c53f56 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: End* methods can only be called once per IAsyncResult.
	Bug #466031 fixed.


svn path=/branches/mono-2-4/mcs/; revision=132222
2009-04-21 04:54:48 +00:00
Miguel de Icaza 6af6410175 backport
svn path=/branches/mono-2-4/mono/; revision=132219
2009-04-21 00:41:05 +00:00
Miguel de Icaza b577be87cf Backport
svn path=/branches/mono-2-4/mcs/; revision=132020
2009-04-17 16:31:45 +00:00
Marek Habersack c40b89e6fc Backport of r131983
svn path=/branches/mono-2-4/mcs/; revision=131984
2009-04-17 09:39:27 +00:00
Marek Habersack 976e225e29 Backport of r131977
svn path=/branches/mono-2-4/mcs/; revision=131978
2009-04-17 07:41:56 +00:00
Zoltan Varga 2c0ab98242 2009-04-16 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_xdebug_init): Fix the DISABLE_AOT build.

svn path=/branches/mono-2-4/mono/; revision=131940
2009-04-16 20:44:28 +00:00
Sebastien Pouliot 55430eba96 2009-04-16 Sebastien Pouliot <[email protected]>
* IsolatedStorageFile.cs: Fix thread-safety issue at creation time.
	[Fix bug #431039]
	* IsolatedStorageFileStream.cs: Fix missing path check in Verify.
	[Fix bug #487659]
	[Backport of SVN r131886]


svn path=/branches/mono-2-4/mcs/; revision=131890
2009-04-16 12:29:43 +00:00
Marek Habersack 48bf31774c Backport of r131888
svn path=/branches/mono-2-4/mcs/; revision=131889
2009-04-16 12:27:27 +00:00
Marek Habersack e7c3dc6d6d Backport of r131874
svn path=/branches/mono-2-4/mcs/; revision=131875
2009-04-16 09:52:32 +00:00
Martin Baulig efbba49bb6 2009-04-15 Martin Baulig <[email protected]>
**** Backport of r131819 ****

	* MonoSymbolWriter.cs: Move `ISourceFile', `ICompileUnit' and
	`IMethodDef' into MonoSymbolFile.cs.  This allows us to use the
	symbol reader part without MonoSymbolWriter.cs.


svn path=/branches/mono-2-4/mcs/; revision=131820
2009-04-15 19:45:25 +00:00
Martin Baulig 0418900afe 2009-04-15 Martin Baulig <[email protected]>
**** Backport of r131801 ****

	* MonoSymbolTable.cs
	(LineNumberTable.DW_LNE_MONO__extensions_start): New const.
	(LineNumberTable.DW_LNE_MONO__extensions_end): New const.
	(LineNumberTable.DoRead): Ignore unknown extended opcodes if
	they're within the Mono extension range.


svn path=/branches/mono-2-4/mcs/; revision=131806
2009-04-15 18:07:19 +00:00
Martin Baulig 177033b01d 2009-04-15 Martin Baulig <[email protected]>
**** Backport of r131800 ****

	* debug-mono-symfile.c
	(mono_debug_symfile_lookup_location): Don't print a warning for
	unknown extended opcodes if they're within 0x40 and 0x7f.


svn path=/branches/mono-2-4/mono/; revision=131803
2009-04-15 18:02:31 +00:00
Marek Habersack 3868815d93 Backport of r131768
svn path=/branches/mono-2-4/mcs/; revision=131769
2009-04-15 13:33:25 +00:00
Marek Habersack a8f6747a1d Backport of r131752
svn path=/branches/mono-2-4/mcs/; revision=131753
2009-04-15 11:11:58 +00:00
Marek Habersack 95094b546f Backport of r131734
svn path=/branches/mono-2-4/mcs/; revision=131735
2009-04-15 07:25:34 +00:00
Gonzalo Paniagua Javier 42adc1fadf 2009-04-15 Gonzalo Paniagua Javier <[email protected]>
* HtmlInputText.cs: make sure we're inside a Page before dereferencing
	it.


svn path=/branches/mono-2-4/mcs/; revision=131731
2009-04-15 05:42:00 +00:00
Gonzalo Paniagua Javier fbb0a1d700 2009-04-13 Gonzalo Paniagua Javier <[email protected]>
* HttpUtility.cs: the collection returned from ParseQueryString knows
	how to convert the key/value pairs to a string.


svn path=/branches/mono-2-4/mcs/; revision=131600
2009-04-13 16:28:42 +00:00
Marek Safar dba6b90691 Updated.
svn path=/branches/mono-2-4/mcs/; revision=131591
2009-04-13 13:41:29 +00:00
Marek Safar 359ff00cea 2009-04-13 Marek Safar <[email protected]>
A fix for bug #493887
	* statement.cs: Don't skip string multi-section with default or
	null label when populating string hashtable.


svn path=/branches/mono-2-4/mcs/; revision=131590
2009-04-13 13:40:55 +00:00
Marek Safar 0da086728d Updated.
svn path=/branches/mono-2-4/mcs/; revision=131523
2009-04-11 16:57:08 +00:00
Marek Safar f3762672ee 2009-04-11 Marek Safar <[email protected]>
A fix for bug #492329
	* expression.cs (New): Workaround broken TypeManager.IsValueType.


svn path=/branches/mono-2-4/mcs/; revision=131522
2009-04-11 16:56:55 +00:00
Marek Habersack 8fab207e32 Backport of r131511
svn path=/branches/mono-2-4/mcs/; revision=131512
2009-04-11 13:37:11 +00:00
Zoltan Varga 3add210d9b 2009-04-10 Zoltan Varga <[email protected]>
* include/private/gc_locks.h (GC_test_and_set): Merge a change from libgc
	7.1's libatomic-ops to fix the ppc build with gcc 4.4.

svn path=/branches/mono-2-4/mono/; revision=131472
2009-04-10 14:34:27 +00:00
Marek Habersack ff746e27dc 2009-04-10 Marek Habersack <[email protected]>
* BuildManager.cs: enabled recursion checking for page
	targets. Also, if a built item is skipped because it has been
	compiled recursively, add its assembly to the list of referenced
	assemblies for the batch being currently compiled.

svn path=/branches/mono-2-4/mcs/; revision=131466
2009-04-10 10:10:04 +00:00
Gonzalo Paniagua Javier d92ce85174 2009-03-25 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: ClearHeaders() also resets cacheability.
	Bug #485557 fixed.


svn path=/branches/mono-2-4/mcs/; revision=131452
2009-04-10 04:48:30 +00:00
Jonathan Pryor c4d730fecd * mdoc-update.1: Document -L, -r options.
svn path=/branches/mono-2-4/mono/; revision=131448
2009-04-10 02:05:25 +00:00
Jonathan Pryor f3af0d49c9 * Mono.Documentation/monodocer.cs: Using a single IAssemblyResolver is
an improvement, but doesn't fix all problems.  In particular, some
	  assemblies will depend upon other assemblies to load (e.g. 3rd party
	  assemblies) but these dependent assemblies shouldn't be documented.
	  Add support for -r:ASSEMBLY and -L:DIRECTORY arguments to allow the
	  user to manually add to the assembly search path so that assemblies
	  can be found.  Assemblies added via -r will NOT be documented.

svn path=/branches/mono-2-4/mcs/; revision=131446
2009-04-10 01:45:54 +00:00
Zoltan Varga 5e58dfc8f1 2009-04-09 Zoltan Varga <[email protected]>
* mini-arm.h: Error out if VFP support is requested, since its not
	complete in 2.4.

svn path=/branches/mono-2-4/mono/; revision=131425
2009-04-09 20:52:11 +00:00
Jonathan Pryor 56fb74913a * Mono.Documentation/monodocer.cs: Use a single IAssemblyResolver
shared amongst all AssemblyDefinitions to resolve assembly/type
	  references with Cecil.  Otherwise, if we have deeply nested
	  directories with cross-directory assembly dependencies, then Cecil
	  won't find the necessary assemblies (e.g. b/bin/Debug/b.dll has a
	  type which inherits from a/bin/Debug/a.dll -- here, we'll have two
	  separate AssemblyDefinitions, and when b.dll's AssemblyDefinition
	  tries to resolve types from a.dll, it fails).
	  See: http://lists.ximian.com/pipermail/mono-devel-list/2009-April/031646.html

svn path=/branches/mono-2-4/mcs/; revision=131366
2009-04-08 21:39:48 +00:00
Marek Habersack 977f185512 Backport of r131314
svn path=/branches/mono-2-4/mcs/; revision=131316
2009-04-08 11:32:54 +00:00
Marek Habersack 0fd7dba26a Backport of r131225
svn path=/branches/mono-2-4/mcs/; revision=131226
2009-04-07 13:06:19 +00:00
Marek Habersack 04b1406fa8 Backport of r131214
svn path=/branches/mono-2-4/mcs/; revision=131215
2009-04-07 10:56:57 +00:00
Marek Habersack 1e4e6fbc02 Backport of r131210
svn path=/branches/mono-2-4/mcs/; revision=131211
2009-04-07 10:45:26 +00:00
Gonzalo Paniagua Javier f001027f81 2009-04-06 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: send REST after PASV to avoid some servers
	forgetting aboout it.
	Bug #491590 fixed.


svn path=/branches/mono-2-4/mcs/; revision=131181
2009-04-07 00:05:40 +00:00
Marek Habersack 8f7f035288 Fix the build
svn path=/branches/mono-2-4/mcs/; revision=131106
2009-04-06 11:00:27 +00:00
Marek Safar f44d422aef 2009-04-06 Marek Safar <[email protected]>
A fix for bug #492329
	* expression.cs (New): Load variable when assigning type parameter
	to ref variable.


svn path=/branches/mono-2-4/mcs/; revision=131103
2009-04-06 10:35:58 +00:00
Marek Safar 8d8ae6a36a 2009-04-06 Marek Safar <[email protected]>
A fix for bug #488960
	* decl.cs: Compare MVAR types using non-null values.


svn path=/branches/mono-2-4/mcs/; revision=131099
2009-04-06 09:04:36 +00:00
Veerapuram Varadhan c77179d098 New: IntervalDescriptor implementation file
Implements  basic OciInterval types handling


Conflicts:

svn path=/branches/mono-2-4/mcs/; revision=131092
2009-04-06 05:36:47 +00:00
Veerapuram Varadhan 6e1812bf0c backport of r130709
svn path=/branches/mono-2-4/mcs/; revision=131091
2009-04-06 05:32:01 +00:00
Veerapuram Varadhan 66cf3e30bd backport or r130490
svn path=/branches/mono-2-4/mcs/; revision=131090
2009-04-06 05:31:43 +00:00
Veerapuram Varadhan 2c16e09089 backport of r129864
svn path=/branches/mono-2-4/mcs/; revision=131089
2009-04-06 05:31:22 +00:00
Gonzalo Paniagua Javier 397c889bbb fix the 1.1 build
svn path=/branches/mono-2-4/mcs/; revision=131057
2009-04-04 20:30:36 +00:00
Gonzalo Paniagua Javier 4384904433 2009-04-04 Gonzalo Paniagua Javier <[email protected]>
* AssemblyResourceLoader.cs: MS sets cacheability to public. Add
	Last-Modified header and return 304 if validating max-age=0 or
	If-Modified-Since succeeds.


svn path=/branches/mono-2-4/mcs/; revision=131054
2009-04-04 19:53:38 +00:00
Marek Habersack 4b303da408 Backport of r130982
svn path=/branches/mono-2-4/mcs/; revision=130983
2009-04-03 16:38:45 +00:00
Marek Habersack 1e7ab5d674 Backport of r130979
svn path=/branches/mono-2-4/mcs/; revision=130980
2009-04-03 16:02:31 +00:00
Marek Habersack 2cb87f749f Backport of r130972
svn path=/branches/mono-2-4/mcs/; revision=130973
2009-04-03 14:49:42 +00:00
Jb Evain cc67b3f262 2009-04-03 Jb Evain <[email protected]>
backport of 130961.

	* Enumerable.cs (Cast): fix for when casted enumerator is already
	of the appropriate type.


svn path=/branches/mono-2-4/mcs/; revision=130962
2009-04-03 10:50:01 +00:00
Jb Evain b9a774091e 2009-04-02 Jb Evain <[email protected]>
backport of r130884 and r130886.

	* Dictionary.cs (ValueCollection.CopyTo): fix for copying to
	an object array. Based on a patch by Tobias Grimm <[email protected]>.
	Fixes bug #328036.


svn path=/branches/mono-2-4/mcs/; revision=130887
2009-04-02 17:45:23 +00:00
Gonzalo Paniagua Javier 2139bcdf86 Backport from HEAD. Fixes bug #491343
svn path=/branches/mono-2-4/mcs/; revision=130838
2009-04-02 06:56:51 +00:00
Marek Habersack 3c0ad436fb Backport of r130763
svn path=/branches/mono-2-4/mcs/; revision=130793
2009-04-01 19:40:58 +00:00
Marek Habersack 2236b4015f Backport of r130755
svn path=/branches/mono-2-4/mcs/; revision=130792
2009-04-01 19:40:22 +00:00
Marek Habersack 157df7b1ec Backport of r130720
svn path=/branches/mono-2-4/mcs/; revision=130791
2009-04-01 19:39:43 +00:00
Marek Habersack fea6fcdd64 Backport of r130694
svn path=/branches/mono-2-4/mcs/; revision=130790
2009-04-01 19:39:08 +00:00
Marek Habersack 4ec4514bb4 Backport of r130683
svn path=/branches/mono-2-4/mcs/; revision=130789
2009-04-01 19:38:38 +00:00
Marek Habersack 20a17e606b Backport of r130682
svn path=/branches/mono-2-4/mcs/; revision=130788
2009-04-01 19:37:59 +00:00
Marek Habersack 91a8d0b50e Backport of r130667
svn path=/branches/mono-2-4/mono/; revision=130787
2009-04-01 19:36:49 +00:00
Marek Habersack 098c748a2f Backport of r130666
svn path=/branches/mono-2-4/mcs/; revision=130786
2009-04-01 19:35:38 +00:00
Marek Habersack 04bcffdc88 Backport of r130665
svn path=/branches/mono-2-4/mcs/; revision=130785
2009-04-01 19:34:55 +00:00
Marek Habersack c27009892d Patch applied incorrectly, compilation fix
svn path=/branches/mono-2-4/mcs/; revision=130782
2009-04-01 18:58:48 +00:00
Marek Habersack dd8e821949 Compilation fix
svn path=/branches/mono-2-4/mcs/; revision=130781
2009-04-01 18:33:04 +00:00
Marek Habersack ceffc7cd26 Backport of r130664
svn path=/branches/mono-2-4/mcs/; revision=130777
2009-04-01 18:14:01 +00:00
Marek Habersack 4ed410f2d4 Backport of r130566
svn path=/branches/mono-2-4/mcs/; revision=130776
2009-04-01 18:12:20 +00:00
Marek Habersack 72e57f5e4a Backport of r130245
svn path=/branches/mono-2-4/mcs/; revision=130773
2009-04-01 17:54:58 +00:00
Marek Habersack 2ea525d40d Backport of r130244
svn path=/branches/mono-2-4/mcs/; revision=130772
2009-04-01 17:54:23 +00:00
Marek Habersack 9b4bd2ba33 Partial backport of r130082
svn path=/branches/mono-2-4/mcs/; revision=130771
2009-04-01 17:44:25 +00:00
Gonzalo Paniagua Javier 1bc76374a8 2009-03-31 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: don't fail if the SocketOptionsFlag has Partial or
	* MaxIOVectorLength enabled, just ignore them.
	Fixes bug #349688.


svn path=/branches/mono-2-4/mono/; revision=130614
2009-03-31 06:25:33 +00:00
Zoltan Varga 6e0124eebd 2009-03-29 Zoltan Varga <[email protected]>
* CodeGenerator.cs: Add synchronization as SRE is not thread safe.

svn path=/branches/mono-2-4/mcs/; revision=130485
2009-03-29 02:31:28 +00:00
Jb Evain 501b6c8951 2009-03-28 Jb Evain <[email protected]>
backport of r130478.

	* Enumerable.cs: fix Intersect.


svn path=/branches/mono-2-4/mcs/; revision=130480
2009-03-28 22:00:55 +00:00
Zoltan Varga d319651008 2009-03-17 Zoltan Varga <[email protected]>
* mini-exceptions.c (get_generic_info_from_stack_frame): Avoid returning
	a managed object which is later put into a GList. Return its class instead.

	* mini.c (mono_allocate_stack_slots_full): Avoid sharing ref and non-ref
	stack slots when using sgen.

svn path=/branches/mono-2-4/mono/; revision=130475
2009-03-28 19:04:58 +00:00
Zoltan Varga a9a9b35b65 2009-01-26 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
	(mono_class_native_size): Use klass->marshal_info->min_align instead of
	klass->min_align, since klass->min_align contains the managed alignment,
	while the native alignment can be different, like for longs on x86.
	Fixes #469135.

	* class-internals.h (MonoMarshalType): Add a min_align field.

svn path=/branches/mono-2-4/mono/; revision=130473
2009-03-28 17:58:41 +00:00
Gonzalo Paniagua Javier 8d94c7d98a 2009-03-27 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c:
	* console-io.[ch]: added new mono_console_init() to make sure that
	file descriptors 0, 1 and 2 are opened.
	Bug #489019 fixed.


svn path=/branches/mono-2-4/mono/; revision=130425
2009-03-27 20:07:48 +00:00
Gonzalo Paniagua Javier 3072976517 2009-03-27 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: disable the test form
	when only Soap is supported.
	Bug #342073 fixed.


svn path=/branches/mono-2-4/mono/; revision=130401
2009-03-27 15:52:17 +00:00
Zoltan Varga 2d0fb10dc2 2009-03-27 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Disable tail calls for calls which
	return a valuetype. Fixes #487518.

	* iltests.il: Add a test.

svn path=/branches/mono-2-4/mono/; revision=130391
2009-03-27 14:08:27 +00:00
Zoltan Varga c02e3ec1b5 2009-03-26 Zoltan Varga <[email protected]>
* pinvoke2.cs: Add a test for #488670.

svn path=/branches/mono-2-4/mono/; revision=130260
2009-03-25 23:49:10 +00:00
Zoltan Varga 32f261dbd1 2009-03-26 Zoltan Varga <[email protected]>
* marshal.c (emit_marshal_object): Generate code to throw an exception
	instead of throwing it. Fixes #488670.


Conflicts:

	mono/metadata/ChangeLog

svn path=/branches/mono-2-4/mono/; revision=130259
2009-03-25 23:49:03 +00:00
Gonzalo Paniagua Javier 7b22ebc970 2009-03-25 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: ClearHeaders() also resets cacheability.
	Bug #485557 fixed.


svn path=/branches/mono-2-4/mcs/; revision=130189
2009-03-25 05:20:20 +00:00
Gonzalo Paniagua Javier d58ae94cd3 2009-03-24 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: we were sending CWD instead of PWD.
	Bug #486703 fixed.


svn path=/branches/mono-2-4/mcs/; revision=130158
2009-03-24 21:09:03 +00:00
Gonzalo Paniagua Javier cba68a1e89 2009-03-24 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: MacOS has different arguments for ping.
	Bug #486904 fixed.


svn path=/branches/mono-2-4/mcs/; revision=130155
2009-03-24 21:00:26 +00:00
Zoltan Varga 3f6c9d13ed In metadata/
2009-03-23  Zoltan Varga  <[email protected]>

	* marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
	methods, return the native function address itself. Fixes
	#487758.

In tests/

2009-03-23  Zoltan Varga  <[email protected]>

	* pinvoke-2.2.cs libtest.c: Add a test for #487758.


Conflicts:

	mono/mini/unwind.c

svn path=/branches/mono-2-4/mono/; revision=130067
2009-03-23 15:32:19 +00:00
Marek Safar ca87eff2fb Removed for now.
svn path=/branches/mono-2-4/mcs/; revision=130064
2009-03-23 15:28:22 +00:00
Marek Safar 77cfabcfa2 2009-03-23 Marek Safar <[email protected]>
A fix for bug #487625
	* namespace.cs: Use a warning for all predefined type conflicts.


svn path=/branches/mono-2-4/mcs/; revision=130063
2009-03-23 15:23:32 +00:00
Jonathan Pryor 295b492fe0 * UnixDriveInfo.cs: UnixDriveInfo.AvailableFreeSpace needs to return
stat.f_bavail * stat.f_frsize, NOT f_bavail*f_bsize, as on some
	  platforms (Solaris) bsize is the preferred block I/O size, while
	  f_frsize is the *actual* filesystem block size.  Thus, to get proper
	  disk under Solaris, we need to s/f_bsize/f_frsize/g.

svn path=/branches/mono-2-4/mcs/; revision=130056
2009-03-23 14:36:04 +00:00
Zoltan Varga aae1be1d3d 2009-03-23 Zoltan Varga <[email protected]>
* String.cs (LastIndexOf): Handle empty strings correctly. Fixes #486234.

svn path=/branches/mono-2-4/mcs/; revision=130039
2009-03-23 11:24:05 +00:00
Jonathan Pryor 735ddc4f5b * x-struct-str.c: It's possible for struct members to be NULL, so make
sure we don't pass NULL to strlen(3).

svn path=/branches/mono-2-4/mono/; revision=129890
2009-03-20 17:18:14 +00:00
Zoltan Varga 0e1476a47a 2009-03-19 Zoltan Varga <[email protected]>
Backport of r129824.

	* mini-amd64.c (mono_arch_compute_omit_fp): Add another check to avoid hitting
	the stack_alloc_size < (1 << 16) assertion in emit_prolog ().

svn path=/branches/mono-2-4/mono/; revision=129825
2009-03-19 21:09:53 +00:00
Zoltan Varga 80a900730c 2009-03-19 Zoltan Varga <[email protected]>
Backport of r129798.

	* locales.c (get_current_locale_name): Use g_malloc instead of malloc.

svn path=/branches/mono-2-4/mono/; revision=129799
2009-03-19 17:44:11 +00:00
Marek Habersack f14dfcc563 Backport of r129774
svn path=/branches/mono-2-4/mcs/; revision=129775
2009-03-19 13:44:41 +00:00
Zoltan Varga 9a01f64dc1 2009-03-18 Zoltan Varga <[email protected]>
Backport of r129689.

	* icall.c: Handle user types in many Type icalls. Fixes #486303.


svn path=/branches/mono-2-4/mono/; revision=129690
2009-03-18 14:12:29 +00:00
Marek Habersack fd4ff987ae Backport of r129676
svn path=/branches/mono-2-4/mcs/; revision=129677
2009-03-18 08:08:47 +00:00
Marek Habersack 4a4861af27 Backport of r129620
svn path=/branches/mono-2-4/mcs/; revision=129621
2009-03-17 19:02:28 +00:00
Marek Habersack 1d60c868a4 Backport of r129580
svn path=/branches/mono-2-4/mcs/; revision=129581
2009-03-17 13:22:30 +00:00
Marek Habersack 21815cee75 Backport of r129491
svn path=/branches/mono-2-4/mcs/; revision=129492
2009-03-16 18:54:55 +00:00
Zoltan Varga 05d3217e67 2009-03-15 Steven Munroe <[email protected]>
Backport of r129461.
	
	This patch is contributed under the terms of the MIT/X11 license

	* Makefile.am (test_platform): Enable testbundle for ppc.

svn path=/branches/mono-2-4/mono/; revision=129463
2009-03-16 15:50:06 +00:00
Zoltan Varga def436d728 2009-03-15 Steven Munroe <[email protected]>
Backport of r129460.

	This patch is contributed under the terms of the MIT/X11 license

	* mkbundle.cs (WriteSymbol): Use .p2align 5 instead of .align 32
	to get consistent results on all platforms.

svn path=/branches/mono-2-4/mcs/; revision=129462
2009-03-16 15:49:16 +00:00
Marek Habersack 15e1e19285 Backport r129449
svn path=/branches/mono-2-4/mcs/; revision=129450
2009-03-16 14:55:40 +00:00
Massimiliano Mantione be59d72e0d * mono-profiler-logging.c: Backport from trunk, make it like
r129416:
        - When checking if an elf file is valid, avoid mapping it in
        memory until we know it's usable (avoids virtual memory
        fragmentation issues).
        - Correctly handle duplicated entries in /proc/self/maps.


svn path=/branches/mono-2-4/mono/; revision=129418
2009-03-16 10:50:34 +00:00
Marek Habersack ca19241224 Backport of r129412
svn path=/branches/mono-2-4/mcs/; revision=129413
2009-03-16 09:55:19 +00:00
Marek Habersack 449e45b071 Backport of r129234
svn path=/branches/mono-2-4/mcs/; revision=129235
2009-03-13 00:49:23 +00:00
Gonzalo Paniagua Javier 87366f4649 2009-03-12 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: if the assembly name is a shadow-copied file, return
	TRUE from mono_is_shadow_copy_enabled but don't actually do anything
	in mono_make_shadow_copy.
	* icall.c: if the assembly name is a shadow-copied file, replace it
	with the original assembly path.

	Bug #484244 fixed. NUnit tests for corlib can be run without
	--noshadow now.


svn path=/branches/mono-2-4/mono/; revision=129214
2009-03-12 22:38:44 +00:00
Gonzalo Paniagua Javier 2c28fda055 accidental commit
svn path=/branches/mono-2-4/mono/; revision=129213
2009-03-12 22:37:57 +00:00
Gonzalo Paniagua Javier 64be0aa4d1 2009-03-12 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: if the assembly name is a shadow-copied file, return
	TRUE from mono_is_shadow_copy_enabled but don't actually do anything
	in mono_make_shadow_copy.
	* icall.c: if the assembly name is a shadow-copied file, replace it
	with the original assembly path.

	Bug #484244 fixed. NUnit tests for corlib can be run without
	--noshadow now.


svn path=/branches/mono-2-4/mono/; revision=129212
2009-03-12 22:37:18 +00:00
Dean Brettle b92f0d6e2d Commit approved by Gonzalo via private email.
2009-03-12  Dean Brettle  <[email protected]>

	* nBrowser/Build.cs: made Browser() method thread-safe and moved the
	actual tree creation to a private InitializeTree() method for clarity.


svn path=/branches/mono-2-4/mcs/; revision=129179
2009-03-12 19:11:54 +00:00
Gonzalo Paniagua Javier cfa5ba3ed7 2009-03-11 Gonzalo Paniagua Javier <[email protected]>
* InotifyWatcher.cs: don't send events when a directory is created
	unless it matches the pattern.  Fixes bug #484082.


svn path=/branches/mono-2-4/mcs/; revision=129113
2009-03-12 00:21:43 +00:00
Zoltan Varga 174cbf6460 2009-03-08 Zoltan Varga <[email protected]>
Backport of r128849 + r128490.

	* domain-internals.h (struct _MonoDomain): Add new hash tables mapping
	between GCHandles of type WeakTrackResurrection and the objects they
	point to.

	* gc.c: Partly implement the sematics of GCHandles of type 
	WeakTrackResurrection: these handles should only be cleared after the
	finalizer of the object they are pointing to has ran.

	* domain-internals.h (struct _MonoDomain): Add a separate lock for the
	finalize_objects_hash.

	* gc.c: Use the separate lock to access the finalize_objects_hash field.

svn path=/branches/mono-2-4/mono/; revision=129104
2009-03-11 23:12:06 +00:00
Zoltan Varga d90dfb6b92 2009-03-11 Zoltan Varga <[email protected]>
Backport of r129069.

	* Binder.cs: Allow conversions from T to T?. Fixes #484294.

svn path=/branches/mono-2-4/mcs/; revision=129102
2009-03-11 23:02:25 +00:00
Zoltan Varga 8f4c7c9e1a 2009-03-11 Zoltan Varga <[email protected]>
* mini-amd64.c (mono_arch_output_basic_block): Fix % 1. Fixes #484323.

	* basic.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=129066
2009-03-11 14:29:38 +00:00
Mark Probst 950b5dc41b 2009-03-11 Mark Probst <[email protected]>
* mini-x86.c (mono_arch_output_basic_block): Use different
	registers in case the ones we want to overwrite are used by the
	other operand.  Fixes regression in #480807.

	Backport of r129058.

svn path=/branches/mono-2-4/mono/; revision=129064
2009-03-11 14:27:20 +00:00
Zoltan Varga 5901f1de17 2009-03-10 Zoltan Varga <[email protected]>
Backport of r129009.

	* reflection.c (ensure_complete_type): New helper function to call
	type resolve handlers for unfinished dynamic types.
	(resolve_object): Call it for MonoClassFields. Fixes #483852.

svn path=/branches/mono-2-4/mono/; revision=129010
2009-03-10 19:48:57 +00:00
Marek Habersack 84c1469a25 Backport of r128972
svn path=/branches/mono-2-4/mcs/; revision=128973
2009-03-10 14:23:03 +00:00
Zoltan Varga e08028625d 2009-03-10 Zoltan Varga <[email protected]>
Backport of r128924.
	
	* mini-s390x.c: Fix support for vtypes whose addresses are passed on the
	stack.

svn path=/branches/mono-2-4/mono/; revision=128926
2009-03-10 00:21:40 +00:00
Miguel de Icaza acbaa50498 Backport from 128830
svn path=/branches/mono-2-4/mcs/; revision=128925
2009-03-10 00:20:25 +00:00
Mark Probst b92652fb0c 2009-03-09 Mark Probst <[email protected]>
Contributed under the terms of the MIT/X11 license by Steven
        Munroe <[email protected]>.

        * mini-ppc.c: Correct handling of OP_LOADI4_MEMINDEX for ppc64.
        Fixes #483462.

        Backport of r128904.

svn path=/branches/mono-2-4/mono/; revision=128905
2009-03-09 20:03:44 +00:00
Mark Probst b400a612a4 2009-03-09 Mark Probst <[email protected]>
* mini-trampolines.c (mono_create_jump_trampoline): If the method
	is shared generic code, return the trampoline, even if the method
	has already been compiled.  Fixes #479763.

	* mini.c, mini.h: New function
	mono_jit_find_compiled_method_with_jit_info() which is the same as
	mono_jit_find_compiled_method() but also returns the jit info.

	Backport of r128723.

2009-03-09  Mark Probst  <[email protected]>

	* generic-sharing.c (instantiate_other_info): Always return a jump
	trampoline for method code.

	Backport of r128723.

2009-03-09  Mark Probst  <[email protected]>

	* bug-479763.2.cs: New test.

	* Makefile.am: Test added.

	Backport of r128723.

svn path=/branches/mono-2-4/mono/; revision=128903
2009-03-09 19:57:22 +00:00
Rodrigo Kumpera f75dddbe61 2009-03-08 Rodrigo Kumpera <[email protected]>
Backport of r128853.

	* appdomain.c (get_shadow_assembly_location): Fix memleak.


svn path=/branches/mono-2-4/mono/; revision=128882
2009-03-09 14:24:35 +00:00
Marek Safar ce5c0e651e 2009-03-08 Marek Safar <[email protected]>
* class.cs: Use correct common base type for unmanaged delayed
	check.

	* rootcontext.cs: Wrap unhandled exception.


svn path=/branches/mono-2-4/mcs/; revision=128854
2009-03-08 19:15:50 +00:00
Gonzalo Paniagua Javier 11cd4f09ed 2009-03-06 Gonzalo Paniagua Javier <[email protected]>
* ResourceSet.cs: for custom resource sets without a reader, pretende
	that's we've already read the stream.


svn path=/branches/mono-2-4/mcs/; revision=128815
2009-03-07 00:06:31 +00:00
Miguel de Icaza 15c1fae0ea 2009-03-05 Tom Hindle <[email protected]>
* Marshal.cs: Implemented GenerateGuidForType

svn path=/branches/mono-2-4/mcs/; revision=128809
2009-03-06 23:31:51 +00:00
Miguel de Icaza b712e0ae63 Backport
svn path=/branches/mono-2-4/mcs/; revision=128808
2009-03-06 23:30:19 +00:00
Marek Habersack 7304ee6ef0 Backport of r128801
svn path=/branches/mono-2-4/mcs/; revision=128802
2009-03-06 22:17:10 +00:00
Marek Habersack ef23c9aaeb Backport of r128799
svn path=/branches/mono-2-4/mcs/; revision=128800
2009-03-06 21:30:17 +00:00
Marek Habersack 5eecf6b197 Backport of r128796
svn path=/branches/mono-2-4/mcs/; revision=128797
2009-03-06 20:55:33 +00:00
Marek Habersack 74dcf0f4e7 Backport of r128793
svn path=/branches/mono-2-4/mcs/; revision=128794
2009-03-06 20:05:35 +00:00
Zoltan Varga 2a21dbb533 2009-03-06 Zoltan Varga <[email protected]>
* arm/tramp.c: Include a change from the debian patches. Avoid #include-ing
	a file in the middle of a function.

svn path=/branches/mono-2-4/mono/; revision=128784
2009-03-06 15:56:44 +00:00
Zoltan Varga fdf4913561 2009-03-06 Zoltan Varga <[email protected]>
Backport of r128749.
	
	* method-to-ir.c (mini_emit_memset): Fix the handling of size '3'. Fixes
	#481458.

	* iltests.il.in: Add a test.

svn path=/branches/mono-2-4/mono/; revision=128751
2009-03-06 02:43:14 +00:00
Mark Probst a1ea9b3ab8 2009-03-05 Mark Probst <[email protected]>
* method-to-ir.c (mono_method_to_ir): Only force the vtable var
	for methods which actually have one.  For all other methods, make
	sure the this argument var is live the whole method.

	* mini.c (mini_method_compile): Every shared method has a
	this/vtable/mrgctx info.  Fixes #480807.

	Backport of r128720.

svn path=/branches/mono-2-4/mono/; revision=128724
2009-03-05 21:17:28 +00:00
Marek Habersack d22d581784 Backport of r128714
svn path=/branches/mono-2-4/mono/; revision=128715
2009-03-05 18:06:35 +00:00
Bill Holmes 7ff68d17a2 2009-03-05 Bill Holmes <[email protected]>
* mono.def : Removing missing methods to remove link errors for
	  MSVC build.  

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=128712
2009-03-05 17:50:48 +00:00
Mark Probst ebbca31e3c 2009-03-05 Mark Probst <[email protected]>
Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c, mini-ppc.h: Implement TLS for PPC64.

	Backport of r127060.

2009-03-05  Mark Probst  <[email protected]>

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mono-compiler.h: MONO_THREAD_VAR_OFFSET for PPC(64).

	Backport of r127060.

svn path=/branches/mono-2-4/mono/; revision=128711
2009-03-05 17:49:49 +00:00
Marek Safar fbe5f68924 2009-03-05 Marek Safar <[email protected]>
A fix for bug #480100
	* parameter.cs: A parameter is not hoisted when used directly as ET.


svn path=/branches/mono-2-4/mcs/; revision=128680
2009-03-05 11:41:25 +00:00
Martin Baulig aca813ba8d ***** Backport of r128549 *****
svn path=/branches/mono-2-4/mono/; revision=128622
2009-03-04 20:46:47 +00:00
Martin Baulig d4955be897 ***** Backport of r128556 *****
2009-03-04  Martin Baulig  <[email protected]>

	* debug-mini.c: Clean up the exception API and add documentation.
	(mono_debugger_handle_exception): New public method; this is
	called when throwing an exception or encountering an unhandled one.
	(mono_debugger_call_exception_handler): Formerly known as
	mono_debugger_handle_exception(); this is used to tell the
	debugger that we're about to invoke an exception handler.


svn path=/branches/mono-2-4/mono/; revision=128614
2009-03-04 20:24:02 +00:00
Martin Baulig 84ada866ad ***** Backport of r128544 *****
2009-03-04  Martin Baulig  <[email protected]>

	* debug-mini.c (mono_debugger_runtime_invoke): Moved here from
	../metadata/mono-debug-debugger.c; save and reset exception state.

2009-03-02  Martin Baulig  <[email protected]>

	* debug-mini.c: Moved the debugger exception handling here from
	../metadata/mono-debug-debugger.c.

	* debug-mini.h
	(MonoDebuggerExceptionAction): New exception typedef.

	* debug-mini.c
	(MonoDebuggerThreadInfo): Added `MonoObject *last_exception'.

	* exceptions-amd64.c
	(mono_amd64_throw_exception): Use the new debugger exception
	handling code.

	* mini-exceptions.c
	(mono_handle_exception_internal): Don't call
	mono_debugger_unhandled_exception() here.

2009-03-04  Martin Baulig  <[email protected]>

	* mono-debug.h
	(mono_debugger_runtime_invoke): Removed.

	* mono-debug-debugger.c
	(mono_runtime_invoke): Moved into ../mini/debug-mini.c.

2009-03-02  Martin Baulig  <[email protected]>

	* mono-debug.h
	(mono_debugger_unhandled_exception): Removed.
	(mono_debugger_handle_exception): Removed.
	(mono_debugger_throw_exception): Removed.

	* mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 1.

	* mono-debug.c
	(mono_debug_debugger_version): Bump to 5.

	* mono-debug-debugger.c: Moved the exception handling code to
	../mini/debug-mini.c


svn path=/branches/mono-2-4/mono/; revision=128613
2009-03-04 20:19:14 +00:00
Marek Habersack d7e563dd87 Backport of r128602
svn path=/branches/mono-2-4/mcs/; revision=128603
2009-03-04 19:06:26 +00:00
Mark Probst 2085fa219c 2009-03-04 Mark Probst <[email protected]>
* method-to-ir.c: Don't inline methods that use JMP.  Fixes
	#481403.

	Backport of r128552.

2009-03-04  Mark Probst  <[email protected]>

	* bug-481403.il: New test.

	* Makefile.am: Test added.

	Backport of r128552.

svn path=/branches/mono-2-4/mono/; revision=128560
2009-03-04 15:58:15 +00:00
Marek Safar 8d34f01dfc 2009-03-03 Marek Safar <[email protected]>
A fix for bug #481258
	* class.cs: Set extension method flag in partial container.


svn path=/branches/mono-2-4/mcs/; revision=128434
2009-03-03 12:58:09 +00:00
Marek Habersack ac1aa9d309 Backport of r128407 and r128408
svn path=/branches/mono-2-4/mcs/; revision=128409
2009-03-03 01:34:29 +00:00
Gonzalo Paniagua Javier 97434a0a9b 2009-03-01 Gonzalo Paniagua Javier <[email protected]>
* WebEncoding.cs: another GetWebApplication here.


svn path=/branches/mono-2-4/mcs/; revision=128294
2009-03-01 07:43:09 +00:00
Gonzalo Paniagua Javier 1c03c661b4 patch from Marek in trunk
svn path=/branches/mono-2-4/mcs/; revision=128280
2009-02-28 23:45:29 +00:00
Gonzalo Paniagua Javier 7e204d02b5 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* AppResourcesAssemblyBuilder.cs:
	* AspComponentFoundry.cs:
	* AssemblyBuilder.cs:
	* CachingCompiler.cs:
	* AspGenerator.cs:
	* WsdlBuildProvider.cs:
	* BaseCompiler.cs:
	* BuildProvider.cs:
	* AppWebReferencesCompiler.cs:
	* TemplateControlCompiler.cs:
	* BuildManager.cs:
	* AppCodeCompiler.cs: settings that have to be in
	machine.config or the root level web.config now call
	GetWebApplicationSection.


svn path=/branches/mono-2-4/mcs/; revision=128277
2009-02-28 20:41:32 +00:00
Gonzalo Paniagua Javier 34d0ee8c95 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* BaseParser.cs:
	* PageParser.cs:
	* ControlBuilder.cs:
	* TemplateParser.cs:
	* Page.cs:
	* SimpleWebHandlerParser.cs: settings that have to be in
	machine.config or the root level web.config now call
	GetWebApplicationSection.


svn path=/branches/mono-2-4/mcs/; revision=128274
2009-02-28 20:05:24 +00:00
Gonzalo Paniagua Javier 05442e11d7 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpResponseHeader.cs:
	* System.Web/HttpResponse.cs:
	* System.Web/QueueManager.cs:
	* System.Web/HttpRequest.cs:
	* System.Web/TraceManager.cs:
	* System.Web/HttpServerUtility.cs:
	* System.Web/HttpApplication.cs:
	* System.Web.UI/ObjectStateFormatter.cs:
	* System.Web.Security/FormsAuthentication.cs: use GetWebApplication
	instead of GetSection for application level configuration.


svn path=/branches/mono-2-4/mcs/; revision=128271
2009-02-28 19:00:51 +00:00
Zoltan Varga 42f06c7663 2009-02-28 Zoltan Varga <[email protected]>
* Enum.cs (FindName): Use a hash table for looking up names instead of
	a linear search for enums with a lot of values.

svn path=/branches/mono-2-4/mcs/; revision=128268
2009-02-28 16:23:19 +00:00
Rodrigo Kumpera 8c002790f7 2008-02-28 Rodrigo Kumpera <[email protected]>
* MonoProperty.cs (GetValue): Don't use the delegate optimization for valuetypes.


svn path=/branches/mono-2-4/mcs/; revision=128263
2009-02-28 06:26:39 +00:00
Gonzalo Paniagua Javier 7172bcccf8 2009-02-17 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: instead of clearing the sockets form the output and then
	adding them back, we just remove the ones that have not been signaled.
	Fixes bug #354090 and bug #476138.



svn path=/branches/mono-2-4/mcs/; revision=128260
2009-02-28 05:59:06 +00:00
Marek Habersack 4ff65f3ac1 Backport of r128249
svn path=/branches/mono-2-4/mcs/; revision=128250
2009-02-28 02:05:10 +00:00
Gonzalo Paniagua Javier de4d2ec78b 2009-02-27 Gonzalo Paniagua Javier <[email protected]>
* ResourceSet.cs: populating the resource should be locked because the
	resourceset could be shared.


svn path=/branches/mono-2-4/mcs/; revision=128216
2009-02-27 17:32:57 +00:00
Rodrigo Kumpera 6e6489d471 2008-02-26 Rodrigo Kumpera <[email protected]>
* MonoProperty.cs (GetValue): Optimize getters for properties without arguments.

2008-02-26  Rodrigo Kumpera  <[email protected]>

	* MonoProperty.cs (GetValue): Optimize getters for properties without arguments.
	The optimization is to create a pair of chained delegates that duplicate the workings
	on MethodBase::Invoke without all the aditional overhead and without doing two
	managed/native transitions.

	Simple Getter performance is up to 17x faster.

	This patch reduces contention on domain and domain jit code hash locks, which
	can be very hot on asp.net applications.


svn path=/branches/mono-2-4/mcs/; revision=128174
2009-02-27 01:53:16 +00:00
Zoltan Varga 986524c0bb 2009-02-27 Zoltan Varga <[email protected]>
* BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
	appropriate initial length.

svn path=/branches/mono-2-4/mcs/; revision=128159
2009-02-26 23:28:25 +00:00
Gonzalo Paniagua Javier ffe099d2fc 2009-02-26 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: make the check to avoid copying when the assembly is
	already shadow copied actually work.


svn path=/branches/mono-2-4/mono/; revision=128126
2009-02-26 17:42:12 +00:00
Gonzalo Paniagua Javier a317249bec 2009-02-26 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationManager.cs: generate a hash from the string hsah
	codes instead of concatenating them.


svn path=/branches/mono-2-4/mcs/; revision=128122
2009-02-26 17:24:40 +00:00
Jonathan Pryor fc98dcc51c * Makefile:
- s/TEST_FILES/MAN_TEST_FILES/g: $(TEST_FILES) is used by the normal
	    build process, so the local definition is lost (and thus ignored).
	    Result: Test/* isn't actually copied.  Oops.  Changing to
	    MAN_TEST_FILES allows things to be copied.
	  - Fix the filenames within $(MAN_TEST_FILES) so `make dist-local'
	    works without error.
	  - Fixes #479753.

svn path=/branches/mono-2-4/mcs/; revision=128120
2009-02-26 17:08:58 +00:00
Zoltan Varga 48ee1b70a0 2009-02-26 Zoltan Varga <[email protected]>
* String.cs (FormatHelper): If all the arguments are strings, compute an
	initial length for the stringbuilder to avoid reallocations.

svn path=/branches/mono-2-4/mcs/; revision=128116
2009-02-26 16:38:34 +00:00
Zoltan Varga ab154c2bdb 2009-02-26 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_get_this_arg_from_call): Avoid expensive calls
	to  get_generic_context_from_code () + get_call_info () if possible.

svn path=/branches/mono-2-4/mono/; revision=128113
2009-02-26 16:26:23 +00:00
Zoltan Varga e2bde717f8 2009-02-25 Zoltan Varga <[email protected]>
* object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
	slower search in metadata.

svn path=/branches/mono-2-4/mono/; revision=128095
2009-02-26 14:20:50 +00:00
Marek Habersack e34e7f2de8 Backport of r128091
svn path=/branches/mono-2-4/mcs/; revision=128092
2009-02-26 14:16:55 +00:00
Gonzalo Paniagua Javier 1e30039a0a fix the build
svn path=/branches/mono-2-4/mono/; revision=128063
2009-02-26 07:30:06 +00:00
Marek Habersack 4881df3014 Backport of r128040
svn path=/branches/mono-2-4/mono/; revision=128041
2009-02-26 02:03:10 +00:00
Marek Safar 38af1d1400 2009-02-25 Marek Safar <[email protected]>
A fix for bug #479532
	* expression.cs: Implement NewInitialize::AddressOf.


svn path=/branches/mono-2-4/mcs/; revision=128016
2009-02-25 16:46:27 +00:00
Marek Habersack 6a50c9ec35 Backport of: r124779, r124780, r124783, r124784, r126769, r126855, r126856, r126891, r127259, r127333, r127334 and r127343
svn path=/branches/mono-2-4/mcs/; revision=128005
2009-02-25 14:16:21 +00:00
Marek Safar 5e0f8cda9a 2009-02-25 Marek Safar <[email protected]>
A fix for bug #413633
	* expression.cs: Iterate all base class-constraint types.


svn path=/branches/mono-2-4/mcs/; revision=127990
2009-02-25 11:39:30 +00:00
Marek Habersack a094e9a735 Backport of r127935
svn path=/branches/mono-2-4/mcs/; revision=127936
2009-02-25 02:50:15 +00:00
Zoltan Varga 816e0e8fdd 2009-02-25 Zoltan Varga <[email protected]>
Backport of r127929.
	
	* Enum.cs (GetInfo): Add a global cache in addition to the thread-local
	caches to accomodate short living threads like threadpool threads.

svn path=/branches/mono-2-4/mcs/; revision=127930
2009-02-25 02:16:00 +00:00
Gonzalo Paniagua Javier 47e1dbf970 2009-02-24 Gonzalo Paniagua Javier <[email protected]>
* StringReader.cs: LF followed by CR is 2 lines.


svn path=/branches/mono-2-4/mcs/; revision=127917
2009-02-24 23:51:00 +00:00
Gonzalo Paniagua Javier aa19449ebb 2009-02-24 Gonzalo Paniagua Javier <[email protected]>
* StringReaderTest.cs: new test for ReadLine.


svn path=/branches/mono-2-4/mcs/; revision=127916
2009-02-24 23:50:24 +00:00
Andrew Jorgensen 90041dc378 Backport of r127907, bnc#479237
svn path=/branches/mono-2-4/mcs/; revision=127908
2009-02-24 22:15:56 +00:00
Zoltan Varga 922912292b 2009-02-24 Zoltan Varga <[email protected]>
* CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
	up ignorecase matching.

svn path=/branches/mono-2-4/mcs/; revision=127902
2009-02-24 20:51:30 +00:00
Ivan Zlatev c92fff7043 2009-02-24 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Invalidate the datagrid when the cell is selected
	or deselected.
	[Fixes bug #479124]

svn path=/branches/mono-2-4/mcs/; revision=127893
2009-02-24 20:10:30 +00:00
Jb Evain e3931f38b6 2009-02-24 Jb Evain <[email protected]>
backport of 127871.

	* Expression.cs (BinaryCoreCheck): fix comparison of enums.


svn path=/branches/mono-2-4/mcs/; revision=127872
2009-02-24 17:11:47 +00:00
Veerapuram Varadhan 493e003258 backport of r127849
svn path=/branches/mono-2-4/mcs/; revision=127850
2009-02-24 09:34:15 +00:00
Veerapuram Varadhan 32bf6cac04 * OracleException: 2.0 changes - patch submitted by
Jay Wren <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127840
2009-02-24 05:21:40 +00:00
Veerapuram Varadhan 0c8aa2ee8b * Fixes #476523
* DbType.cs: Add DateTime2 and DateTimeOffset - 3.5 additions
        Patch by Jay Wren <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127838
2009-02-24 05:10:23 +00:00
Jb Evain 0ee8a2414d 2009-02-23 Jb Evain <[email protected]>
backport of 127784.

	* XUtil.cs (ToString): properly stringify datetimes.

svn path=/branches/mono-2-4/mcs/; revision=127787
2009-02-23 19:20:54 +00:00
Jb Evain eb08b06215 2009-02-23 Jb Evain <[email protected]>
backport of 127772.

	* Enumerable.cs (IterateNullable): fix initial value
	for nullables.


svn path=/branches/mono-2-4/mcs/; revision=127774
2009-02-23 18:16:14 +00:00
Jb Evain 88b7acff98 2009-02-23 Jb Evain <[email protected]>
backport of 127755.

	* Expression.cs (IsNumber): actually decimal is rather a special
	case, and not a primitive number.


svn path=/branches/mono-2-4/mcs/; revision=127756
2009-02-23 17:06:08 +00:00
Jb Evain 84fd92865b 2009-02-23 Jb Evain <[email protected]>
backport of 127746.

	* Expression.cs (BinaryCoreCheck): add decimal operations
	are provided by custom operators.

svn path=/branches/mono-2-4/mcs/; revision=127748
2009-02-23 16:44:42 +00:00
Ivan Zlatev 400afe1a8f 2009-02-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Make the ScrollBars property work properly.

svn path=/branches/mono-2-4/mcs/; revision=127718
2009-02-23 09:43:23 +00:00
Gonzalo Paniagua Javier d9755b89e6 2009-02-23 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: append the QueryString in DownloadData.
	Fixes bug #323788.


svn path=/branches/mono-2-4/mcs/; revision=127700
2009-02-23 05:10:24 +00:00
Gonzalo Paniagua Javier 8c8593fd96 2009-02-22 Gonzalo Paniagua Javier <[email protected]>
* HttpServerUtility.cs: allow Transfer to static files too.


svn path=/branches/mono-2-4/mcs/; revision=127678
2009-02-23 00:22:39 +00:00
Mark Probst 200118c485 2009-02-22 Mark Probst <[email protected]>
Backport of r127665.

	* tramp-ppc.c (mono_arch_create_trampoline_code): Store the
	correct frame pointer in the LMF.  Should fix #478394.

svn path=/branches/mono-2-4/mono/; revision=127666
2009-02-22 21:08:04 +00:00
Gonzalo Paniagua Javier 8575b3983a 2009-02-22 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
	SO_EXLUSIVEADDRUSE where available.


svn path=/branches/mono-2-4/mono/; revision=127651
2009-02-22 06:42:55 +00:00
Gonzalo Paniagua Javier d99e8f21af fix
svn path=/branches/mono-2-4/mcs/; revision=127646
2009-02-22 03:08:15 +00:00
Ivan Zlatev df53237ac6 2009-02-22 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix row removal in the data-bound scenario.

svn path=/branches/mono-2-4/mcs/; revision=127643
2009-02-22 00:54:39 +00:00
Gonzalo Paniagua Javier 24ad061817 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* FtpWebResponse.cs: return a Null stream when there's no response to
	be read.
	* FtpWebRequest.cs: provide the error returned by the server in the
	exception.
	* WebClient.cs: set the correct method when doing a FTP upload.
	Fixes bug #478451.


svn path=/branches/mono-2-4/mcs/; revision=127641
2009-02-21 23:30:33 +00:00
Zoltan Varga 76ffb82a48 2009-02-21 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
	runtime invoke wrappers, this time it is string ctor wrappers, which
	pass a dummy string as 'this' instead of their obj argument. Fixes
	#478473.

svn path=/branches/mono-2-4/mono/; revision=127638
2009-02-21 21:27:35 +00:00
Zoltan Varga 53cc1f8d6d 2009-02-21 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Don't assert if string ctors
	are called from runtime invoke wrappers.

svn path=/branches/mono-2-4/mono/; revision=127636
2009-02-21 21:24:16 +00:00
Jb Evain 0489b56686 backport of r127631.
in System.Reflection:
2008-02-21  Jb Evain  <[email protected]>

	* Module.cs: add a new virtual GetModuleVersionId method,
	and make the properties .MvId and ModuleVersionId call it.
	This way, we can override it in ModuleBuilder.
	Part of the fix for #471302.

in System.Reflection.Emit:
2008-02-21  Jb Evain  <[email protected]>

	* ModuleBuilder.cs: override GetModuleVersionId
	so that we can get the module guid from Module.ModuleVersionId.
	Part of the fix for #471302.

svn path=/branches/mono-2-4/mcs/; revision=127632
2009-02-21 16:20:07 +00:00
Jb Evain 4f856e94a3 2009-02-21 Jb Evain <[email protected]>
backport of r127628.

	* MonoType.cs (InvokeMember): don't pass a null args to
	Binder.BindToMethod. Fix for #471275.

svn path=/branches/mono-2-4/mcs/; revision=127629
2009-02-21 15:36:47 +00:00
Jb Evain a927203608 2009-02-21 Jb Evain <[email protected]>
* EventHandlerList.cs: fix the 1.1 profile.


svn path=/branches/mono-2-4/mcs/; revision=127625
2009-02-21 12:51:59 +00:00
Gonzalo Paniagua Javier 4313c50b3d oops
svn path=/branches/mono-2-4/mcs/; revision=127618
2009-02-21 07:35:31 +00:00
Gonzalo Paniagua Javier 09a2a27d27 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* EventHandlerList.cs: there's no need for HandlerEntry here.
	Just store the delegate.


svn path=/branches/mono-2-4/mcs/; revision=127616
2009-02-21 07:33:08 +00:00
Gonzalo Paniagua Javier c6c5c7c8b6 this was checked in by mistake
svn path=/branches/mono-2-4/mcs/; revision=127598
2009-02-20 23:35:18 +00:00
Gonzalo Paniagua Javier 8a19ec3273 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* TemplateControl.cs: implement the other ReadStringResource method.
	Patch from Kornel Pal.


svn path=/branches/mono-2-4/mcs/; revision=127597
2009-02-20 23:34:35 +00:00
Gonzalo Paniagua Javier 32d603eda4 fix the 1.x build
svn path=/branches/mono-2-4/mcs/; revision=127589
2009-02-20 22:57:08 +00:00
Gonzalo Paniagua Javier 11b4aef454 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpWriter.cs: new Response property and WriteUTF8Ptr
	method.
	* System.Web/HttpResponseStream.cs: added support for writing from an
	IntPtr. copied the memcpy method from String.cs.

	* System.Web.Compilation/BuildManager.cs: updated comment.

	* System.Web.UI/ResourceBasedLiteralControl.cs: new Control. It's just
	like a LiteralControl but will render itself from the bytes pointed to
	by an IntPtr and not create any string from the underlying data unless
	needed.

	* System.Web.UI/TemplateControl.cs: implemented a bunch of methods
	that are used from the precompiled assemblies for a web project. The
	most notable change needed is to be able to read a win32 resource from
	the dll of the control. The resource is a concatenation of literals
	with plain text for the control and a specialized LiteralControl is
	generated from different chunks of the resource.

	* System.Web.UI/HtmlTextWriter.cs: new method that returns the
	HttpWriter in use.

	* System.Web.dll.sources: added new file.

	* System.Web.Util/ICalls.cs: new internal call to get a pointer to the
	win32 resource associated with the control's assembly.


svn path=/branches/mono-2-4/mcs/; revision=127580
2009-02-20 21:32:50 +00:00
Gonzalo Paniagua Javier b1b4f52b34 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* cil-coff.h:
	* icall-def.h:
	* icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
	win32 resource loaded from a PE file.

	* image.c: fix mono_image_lookup_resource.


svn path=/branches/mono-2-4/mono/; revision=127575
2009-02-20 21:07:43 +00:00
Gonzalo Paniagua Javier bff28446a2 changelog
svn path=/branches/mono-2-4/mcs/; revision=127572
2009-02-20 20:46:03 +00:00
Gonzalo Paniagua Javier 08df38ca1b .
svn path=/branches/mono-2-4/mcs/; revision=127571
2009-02-20 20:37:44 +00:00
Gonzalo Paniagua Javier 21eef2e77e ChangeLog
svn path=/branches/mono-2-4/mcs/; revision=127570
2009-02-20 20:36:31 +00:00
Gonzalo Paniagua Javier cff463913d 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* WaitHandle.cs: implemented SignalAndWait.

svn path=/branches/mono-2-4/mcs/; revision=127568
2009-02-20 20:33:23 +00:00
Zoltan Varga e040c39674 2009-02-20 Zoltan Varga <[email protected]>
* cpu-ppc.md (store_memindex): Increase the size of this.

svn path=/branches/mono-2-4/mono/; revision=127567
2009-02-20 20:30:39 +00:00
Veerapuram Varadhan eeca83c94d Test for Bug#419224
svn path=/branches/mono-2-4/mcs/; revision=127543
2009-02-20 15:47:16 +00:00
Veerapuram Varadhan 1a66d85f3b backport of r127530
svn path=/branches/mono-2-4/mcs/; revision=127532
2009-02-20 11:50:35 +00:00
Marek Safar 8508387f81 2009-02-20 Marek Safar <[email protected]>
A fix for bug #477447
	* statement.cs: Add reference to correct parent storey when this
	is accessible from deep children storey (more than 1 level).


svn path=/branches/mono-2-4/mcs/; revision=127528
2009-02-20 11:16:43 +00:00
Veerapuram Varadhan cd41807bcb * TdsDataReader.cs: Access TdsDataColumn correctly for NET_2_0.
Fixes #466199. Patch by Tom Hindle <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127493
2009-02-20 02:30:12 +00:00
Ivan Zlatev fff850ae00 2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Use strict equality comparison in order to
	prevent superfluous CellValueChanged events.

svn path=/branches/mono-2-4/mcs/; revision=127452
2009-02-19 20:16:25 +00:00
Gonzalo Paniagua Javier c4af40f5cf 2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: avoid errors when creating a temporary Uri to get
	the local path.
	* WebClient.cs: when setting up the request for downloading, use the
	default method. Fixes bug #477611.


svn path=/branches/mono-2-4/mcs/; revision=127451
2009-02-19 20:14:31 +00:00
Ivan Zlatev ace3196c2b 2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not reset the columns when the data list changes,
	but only the rows. Fixes multiple bugs related to sorting, custom
	column styles being reset and more.

svn path=/branches/mono-2-4/mcs/; revision=127435
2009-02-19 18:25:02 +00:00
Veerapuram Varadhan 890a4f46f5 backport of r127379
svn path=/branches/mono-2-4/mcs/; revision=127424
2009-02-19 17:11:14 +00:00
Gonzalo Paniagua Javier fd89397e70 2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* OleDbFactory.cs: New file.


svn path=/branches/mono-2-4/mcs/; revision=127376
2009-02-19 06:50:42 +00:00
Gonzalo Paniagua Javier 50c7e593cb 2009-02-18 Gonzalo Paniagua Javier <[email protected]>
* TemplateControl.cs: ReadStringResource returns null now.


svn path=/branches/mono-2-4/mcs/; revision=127359
2009-02-19 02:43:33 +00:00
Gonzalo Paniagua Javier c06c09bd60 svn path=/branches/mono-2-4/mcs/; revision=127354 2009-02-18 23:52:50 +00:00
Gonzalo Paniagua Javier 4a3bf3d995 2009-02-18 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplicationFactory.cs: check of global.asax was precompiled.
	* System.Web.UI/MasterPage.cs: the items in ContentPlaceHolders are lowercase.
	* System.Web.Compilation/TemplateControlCompiler.cs: lowercase place holder names
	* System.Web.Compilation/BuildManager.cs: initial support for
	precompilation. No 'updatable', please.



svn path=/branches/mono-2-4/mcs/; revision=127353
2009-02-18 23:51:15 +00:00
Zoltan Varga f59cfce9df 2009-02-19 Zoltan Varga <[email protected]>
Backport of r127347.

	* marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
	delegate. Fixes #477396.

svn path=/branches/mono-2-4/mono/; revision=127349
2009-02-18 23:14:25 +00:00
Marek Safar b73876a464 Fixes build.
svn path=/branches/mono-2-4/mcs/; revision=127341
2009-02-18 23:02:17 +00:00
Bill Holmes 836e73df60 2009-02-18 Bill Holmes <[email protected]>
backport of r127338

	* mono.def : Adding mono_jit_set_trace_options

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=127339
2009-02-18 23:01:08 +00:00
Marek Safar c524bc933b 2009-02-18 Marek Safar <[email protected]>
A fix for bug #472805
	* typemanager.cs, namespace.cs: Import only visible extension method
	types.


svn path=/branches/mono-2-4/mcs/; revision=127311
2009-02-18 19:54:14 +00:00
Marek Safar 9d136bfc7c 2009-02-18 Marek Safar <[email protected]>
A fix for bug #476266
	* anonymous.cs: Mutate multi-dimensional arrays.


svn path=/branches/mono-2-4/mcs/; revision=127294
2009-02-18 17:05:03 +00:00
Bill Holmes ac220e9c0e 2009-02-18 Bill Holmes <[email protected]>
backport of r127279.

	* marshal.c (cominterop_get_managed_wrapper_adjusted) :
	  Adding exception handling for all CCW calls.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=127280
2009-02-18 15:31:07 +00:00
Zoltan Varga ee8370eb8d 2009-02-18 Zoltan Varga <[email protected]>
Backport of r127232.
	
	* marshal.c (emit_marshal_boolean): Add null checks to the new 
	native->managed marshalling code. Fixes #476247.

svn path=/branches/mono-2-4/mono/; revision=127233
2009-02-17 23:51:25 +00:00
Zoltan Varga bdffeb6712 2009-02-02 Zoltan Varga <[email protected]>
Backport of r125348.

	* marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
	methods taking vtype/byref arguments, to fix yet another bug caused by
	the sharing of runtime invoke wrappers. Partly fixes #471259.

svn path=/branches/mono-2-4/mono/; revision=127080
2009-02-16 23:23:52 +00:00
Zoltan Varga eb24cb0d59 2009-02-15 Zoltan Varga <[email protected]>
Backport of r125349.

	* marshal.c (mono_marshal_free_dynamic_wrappers): New function for
	freeing wrappers of dynamic methods.

	* loader.c (mono_free_method): Call it. Fixes #463323.

svn path=/branches/mono-2-4/mono/; revision=127076
2009-02-16 22:08:08 +00:00
Zoltan Varga 034798235b 2009-02-15 Zoltan Varga <[email protected]>
Backport of r125349.

	* marshal.c (mono_marshal_free_dynamic_wrappers): New function for
	freeing wrappers of dynamic methods.

	* loader.c (mono_free_method): Call it. Fixes #463323.

svn path=/branches/mono-2-4/mono/; revision=127075
2009-02-16 22:07:04 +00:00
Zoltan Varga f049ca86f7 2009-02-15 Zoltan Varga <[email protected]>
Backport of r126958.
	
	* reflection.c (clear_cached_object): New helper function.
	(mono_method_clear_object): New function to clear the cached reflection
	objects for a dynamic method.

	* object.c (mono_runtime_free_method): Call mono_method_clear_object ().
	Partly fixes # 463323.

svn path=/branches/mono-2-4/mono/; revision=127074
2009-02-16 21:59:09 +00:00
Rodrigo Kumpera bcd05ee327 In .:
* loader.c (method_from_memberref): Properly fix #474271 and
	don't break the runtime bad.

2009-02-16 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=127073
2009-02-16 21:51:24 +00:00
Zoltan Varga 4ed001307d 2009-02-16 Zoltan Varga <[email protected]>
Backport of r126983 + r127069.

	* ssa.c (visit_inst): Fix a crash if the instruction following a switch
	was optimized away.

	Backport of r126980.

	* mini-x86.c (mono_arch_get_vcall_slot): Handle yet another
	code sequence which matches a non-virtual call. Fixes #472654.

	Backport of r124419.

	* mini-amd64.c (mono_arch_get_vcall_slot): Handle yet another
	code sequence which matches a non-virtual call.

svn path=/branches/mono-2-4/mono/; revision=127071
2009-02-16 21:49:34 +00:00
Rodrigo Kumpera 4b4f5466cd In .:
2009-02-16 Rodrigo Kumpera  <[email protected]>

	Backport of r127032.

	* loader.c (method_from_memberref): Don't abort if the array
	method is not found. A regular loader failure is more informative
	and correct.

	Fixes #474271.
	

svn path=/branches/mono-2-4/mono/; revision=127061
2009-02-16 18:12:54 +00:00
Mark Probst 914d38a33e 2009-02-16 Mark Probst <[email protected]>
Backport of r125679.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c (mono_arch_output_basic_block): Generate better code
	for LOADI4_MEMBASE.  Use addi instead of addic if it's not
	necessary.

svn path=/branches/mono-2-4/mono/; revision=127059
2009-02-16 17:12:39 +00:00
Mark Probst 8e677f9921 2009-02-16 Mark Probst <[email protected]>
Backport of r125676.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* exceptions-ppc.c (mono_arch_get_restore_context): Code size
	comparison fix.

	* tramp-ppc.c (mono_arch_create_generic_class_init_trampoline):
	The trampoline can be longer on PPC64.

svn path=/branches/mono-2-4/mono/; revision=127056
2009-02-16 17:07:03 +00:00
Mark Probst 12815c0c7e 2009-02-16 Mark Probst <[email protected]>
Backport of r125672.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c: Compiler warning fixes and trivial code
	simplifications.

svn path=/branches/mono-2-4/mono/; revision=127055
2009-02-16 17:06:12 +00:00
Mark Probst b535b7d4c0 2009-02-16 Mark Probst <[email protected]>
Backport of r125443.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* ppc/ppc-codegen.h: Make operand order and case consistent
	(assembler order) for ppc_load_reg_update, ppc_load_multiple_regs,
	ppc_store_multiple_regs, ppc_lwz, ppc_lhz, ppc_lbz,
	ppc_stw,ppc_sth, ppc_stb, ppc_stwu, ppc_lbzu, ppc_lfdu, ppc_lfsu,
	ppc_lfsux, ppc_lfsx, ppc_lha, ppc_lhau, ppc_lhzu, ppc_lmw,
	ppc_lwzu, ppc_stbu, ppc_stfdu, ppc_stfsu, ppc_sthu, ppc_stmw.  Use
	"i" or "ui" instead of "d" for immediated operands to immediate
	arthimetic and logical instructions in macros ppc_addi, ppc_addis,
	ppc_ori, ppc_addic, ppc_addicd, ppc_andid, ppc_andisd.
	[__mono_ppc64__]: Make operand order and case consistent
	(assembler order) for ppc_load_multiple_regs,
	ppc_store_multiple_regs.  Simplify the DS form and make them
	consistent with D forms for ppc_load_reg, ppc_load_reg_update,
	ppc_store_reg, ppc_store_reg_update. ppc_ld, ppc_lwa, ppc_ldu,
	ppc_std, ppc_stdu.  Define ppc_lwax and ppc_lwaux.

2009-02-16  Mark Probst  <[email protected]>

	Backport of r125443.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* exceptions-ppc.c (restore_regs_from_context): Correct operand
	order (offset then base reg) for ppc_load_multiple_regs.
	(emit_save_saved_regs) Correct operand order for
	ppc_store_multiple_regs.
	(mono_arch_get_call_filter): Correct operand order for
	ppc_load_multiple_regs.

	* mini-ppc.c (emit_memcpy): Fix operand order for
	ppc_load_reg_update and ppc_store_reg_update.
	(mono_arch_output_basic_block): Correct operand order for ppc_lha.
	(mono_arch_emit_epilog): Correct operand order for
	ppc_load_multiple_regs.

	* tramp-ppc.c (mono_arch_create_trampoline_code): Correct operand
	order for ppc_store_multiple_regs and ppc_load_multiple_regs.

svn path=/branches/mono-2-4/mono/; revision=127054
2009-02-16 17:04:06 +00:00
Mark Probst 3f1a1dbdfe 2009-02-16 Mark Probst <[email protected]>
Backport of r125430.

	* cpu-ppc64.md: Fixed storer4_memindex length.

svn path=/branches/mono-2-4/mono/; revision=127053
2009-02-16 17:01:59 +00:00
Marek Safar eceec54500 2009-02-16 Marek Safar <[email protected]>
A fix for bug #475965
	* generics.cs: Check generic parameter type after extracting from
	Expression<T>.


svn path=/branches/mono-2-4/mcs/; revision=127041
2009-02-16 15:33:42 +00:00
Atsushi Eno c3335e6f62 branch is broken too.
svn path=/branches/mono-2-4/mcs/; revision=127000
2009-02-16 08:07:02 +00:00
Zoltan Varga d8feb83640 2009-02-14 Zoltan Varga <[email protected]>
Backport of r126897.
	
	* method-to-ir.c (mini_emit_ldelema_1_ins): If the array index is a long,
	convert it to an in32. Fixes #475859.

	* arrays.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126900
2009-02-14 00:07:00 +00:00
Gonzalo Paniagua Javier 3a520d36c4 2009-02-13 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: implemente (Read|Write)Timeout.
	Fixes bug #348159.


svn path=/branches/mono-2-4/mcs/; revision=126841
2009-02-13 15:08:53 +00:00
Marek Safar 3fe2bf4538 2009-02-13 Marek Safar <[email protected]>
A fix for bug #475327
	* expression.cs (ArrayCreation): Don't mutate values optimized away.


svn path=/branches/mono-2-4/mcs/; revision=126826
2009-02-13 12:08:57 +00:00
Zoltan Varga 00f2704267 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126717.

	* mini-amd64.c (mono_arch_build_imt_thunk): Fix size calculation after
	the fail_tramp changes. Hopefully fixes #475132.

svn path=/branches/mono-2-4/mono/; revision=126811
2009-02-13 09:39:00 +00:00
Gonzalo Paniagua Javier 150b04b1b9 2009-02-05 Miguel De Icaza <[email protected]>
* sockets.c (_wapi_setsockopt): SO_REUSEPORT is needed also on
	MacOS X.  Fixes bug #471292


svn path=/branches/mono-2-4/mono/; revision=126772
2009-02-12 23:44:05 +00:00
Lluis Sanchez 098fc0b907 2009-02-12 Lluis Sanchez Gual <[email protected]>
* MarshalByRefObject.cs: Implemented MemberwiseClone(bool).


svn path=/branches/mono-2-4/mcs/; revision=126750
2009-02-12 19:46:11 +00:00
Zoltan Varga 1b5cea04fc 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126737.

	* mini-s390x.c (mono_arch_output_basic_block): Fix the shift amounts in 
	OP_LCONV_TO_U2.

	* basic-long.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126742
2009-02-12 18:46:42 +00:00
Bill Holmes e61b2cd43d 2009-02-12 Bill Holmes <[email protected]>
Backport of r126738.  This is a safer variant of the
	  trunk for the 2.4 branch. The default in emit_marshal_boolean
	  for this version is I1.

	* object-internals.h : Fixing a typo in the
	  MonoReflectionComVisibleAttribute struct.

	* marshal.c (cominterop_com_visible): Check the implemented
	  interfaces for ComImport.

	* marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls
	  assume that bools should be treated as VARIANTBOOLs.

	* marshal.c (emit_marshal_boolean): Adding cases for
	  MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.

	* marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to
	  emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.

	* marshal.c (cominterop_get_ccw): For COM calls assume that bools
	  should be treated as VARIANTBOOLs.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mono/; revision=126740
2009-02-12 18:40:22 +00:00
Zoltan Varga 69b329a4a5 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126737.

	* mini-s390x.c (mono_arch_output_basic_block): Fix the shift amounts in 
	OP_LCONV_TO_U2.

	* basic-long.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126739
2009-02-12 18:40:13 +00:00
Marek Safar 8cc06e5e77 2009-02-12 Marek Safar <[email protected]>
A fix for bug ##475246
	* expression.cs: More broken flowanalysis hacking needed.


svn path=/branches/mono-2-4/mcs/; revision=126729
2009-02-12 17:47:59 +00:00
Mark Probst 4fd91bf1c0 2009-02-12 Mark Probst <[email protected]>
* generic-sharing.c: Fixed a locking bug: The loader lock has to
	be taken before the templates lock.  Fixes part of #473150.

svn path=/branches/mono-2-4/mono/; revision=126715
2009-02-12 14:08:07 +00:00
Gonzalo Paniagua Javier 6b9376a9bf 2009-02-12 Gonzalo Paniagua Javier <[email protected]>
* io.c: EXDEV when moving directories fails now without creating a
	file in the destination.
	Fixes bug #326983.


svn path=/branches/mono-2-4/mono/; revision=126691
2009-02-12 07:44:10 +00:00
Gonzalo Paniagua Javier c457bcfa42 2009-02-12 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs:
	* MonoIOError.cs: enable ERROR_NOT_SAME_DEVICE.


svn path=/branches/mono-2-4/mcs/; revision=126689
2009-02-12 07:43:36 +00:00
Zoltan Varga 63d82ffc3c 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126668.
	
	* ssa.c (fold_ins): Use MONO_IS_JUMP_TABLE () and MONO_JUMP_TABLE_FROM_INS ()
	for processing jump tables. Fixes #473787.

svn path=/branches/mono-2-4/mono/; revision=126669
2009-02-12 00:23:23 +00:00
Mark Probst 2bdd7e92d3 2009-02-11 Mark Probst <[email protected]>
Backport of r126631.

	* class.c, class-internals.h: mono_method_get_context_general()
	combines the functionality of mono_method_get_context() and
	mini_method_get_context().

	* generic-sharing.c, domain-internals.h:
	mono_method_construct_object_context() and
	mono_domain_lookup_shared_generic() moved from mini.

	* icall.c (ves_icall_InternalInvoke): Handle the case where the
	method doesn't have the correct instantiation because it's shared
	generic code.  Fixes #473999.

2009-02-11  Mark Probst  <[email protected]>

	Backport of r126631.

	* mini-generic-sharing.c: mini_method_get_context() just calls
	mono_method_get_context_general() now.

	* mini.c, mini.h: Moved get_object_generic_inst(),
	construct_object_context_for_method() and
	mono_domain_lookup_shared_generic() to metadata/generic-sharing.c.

2009-02-11  Mark Probst  <[email protected]>

	Backport of r126631.

	* bug-473999.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=126635
2009-02-11 19:23:28 +00:00
Andrew Jorgensen 5bb5d1d407 Missed part of the merge (not sure how that happened... I used svn diff
and patch.  Oh well, easy enough to fix.

svn path=/branches/mono-2-4/mono/; revision=126624
2009-02-11 17:23:13 +00:00
Zoltan Varga ca426640a8 2009-02-11 Zoltan Varga <[email protected]>
Backport of 126604.

	* branch-opts.c (mono_if_conversion): Handle the case where the merged 
	basic block fell through to its successor bblock without a branch. Fixes
	#474718.

	* iltests.il.in: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126606
2009-02-11 14:36:29 +00:00
Bill Holmes 718382bad7 2009-02-11 Bill Holmes <[email protected]>
Backport of r126596.

	* socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
	  For Win32, add additional break conditions for accept.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mono/; revision=126598
2009-02-11 13:50:55 +00:00
Gonzalo Paniagua Javier 32bf4798e3 2009-02-10 Gonzalo Paniagua Javier <[email protected]>
* CookieContainer.cs: separate cookies with "; " instead of just ';'.
	Fixes bug #386727.


svn path=/branches/mono-2-4/mcs/; revision=126531
2009-02-10 23:35:16 +00:00
Gonzalo Paniagua Javier dcff2f2285 Fix the windows build in the branch too
svn path=/branches/mono-2-4/mono/; revision=126513
2009-02-10 21:04:58 +00:00
Marek Habersack 17c171a0f9 Backport of r126482
svn path=/branches/mono-2-4/mcs/; revision=126483
2009-02-10 18:12:48 +00:00
Mark Probst 2debaf6612 2009-02-10 Mark Probst <[email protected]>
Backport of r126467.

	* mini-x86.c (mono_arch_context_get_int_reg): Handle all registers
	individually.  Fixes #473482.

2009-02-10  Mark Probst  <[email protected]>

	Backport of r126467.

	* bug-473482.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=126469
2009-02-10 15:22:00 +00:00
Gonzalo Paniagua Javier 42d8948ea3 2009-02-10 Gonzalo Paniagua Javier <[email protected]>
* AppDomain.cs: this fixes the remoting tests.
	Zoltan found out that there was a domain improperly using shadow
	copy.


svn path=/branches/mono-2-4/mcs/; revision=126431
2009-02-10 07:37:33 +00:00
Andrew Jorgensen 6b01c59030 Backport of r126400
svn path=/branches/mono-2-4/mono/; revision=126402
2009-02-10 00:38:41 +00:00
Marek Habersack 00acd5fd49 Backport of r126371.
svn path=/branches/mono-2-4/mcs/; revision=126372
2009-02-09 21:09:25 +00:00
Andrew Jorgensen f434ba459c Fix Bug 472021 - Windows installation sqlsharp.bat (etc) broken
svn path=/branches/mono-2-4/mono/; revision=126349
2009-02-09 16:52:28 +00:00
Gonzalo Paniagua Javier 34c5d71769 2009-02-08 Gert Driesen <[email protected]>
* Dns.cs: BeginGetHostAddresses - renamed argument to match MS,
	reject "any" IP addresses. BeginGetHostEntry - renamed argument
	to match MS, reject "any" IP addresses. GetHostEntry - reject
	"any" IP addresses. GetHostAddresses - reject "any" IP addresses.
	GetHostByName - use "hostName" as paramname in ANE.


svn path=/branches/mono-2-4/mcs/; revision=126295
2009-02-08 23:20:27 +00:00
Gonzalo Paniagua Javier 53acf05e01 2009-02-08 Gert Driesen <[email protected]>
* DnsTest.cs: Use Assert syntax, and spaces to tabs. Added tests
	for argument checks.

svn path=/branches/mono-2-4/mcs/; revision=126294
2009-02-08 23:18:43 +00:00
Gonzalo Paniagua Javier be859b75ff 2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: lock SetResponseError.


svn path=/branches/mono-2-4/mcs/; revision=126293
2009-02-08 23:11:33 +00:00
Zoltan Varga f958258d28 2009-02-09 Zoltan Varga <[email protected]>
Backport of r126290.

	* wait.c (WaitForMultipleObjectsEx): Initialize poll variable.

svn path=/branches/mono-2-4/mono/; revision=126291
2009-02-08 23:08:59 +00:00
Gonzalo Paniagua Javier a5d0787137 2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpClientTransportSink.cs: if we get an WebException that does not
	have a response, dispatch it to the sink.



svn path=/branches/mono-2-4/mcs/; revision=126289
2009-02-08 22:51:35 +00:00
Ivan Zlatev fc990b1fdc 2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: End or if end fails then cancel the current edit
	operation before clearing the data source.

svn path=/branches/mono-2-4/mcs/; revision=126215
2009-02-07 23:27:17 +00:00
Ivan Zlatev f97835553c 2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Data-bind only after the handle is created.
	[Fixes bug #473680]

svn path=/branches/mono-2-4/mcs/; revision=126214
2009-02-07 23:27:12 +00:00
Gonzalo Paniagua Javier 9dd4b35d13 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: when requesting all the local ips, if there are no
	interfaces up and running, MS returns 127.0.0.1.


svn path=/branches/mono-2-4/mono/; revision=126204
2009-02-07 19:57:55 +00:00
Gonzalo Paniagua Javier 5a440ac217 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* mono-perfcounters-def.h: processor time is an inverse time.
	Fixes bug #468625.


svn path=/branches/mono-2-4/mono/; revision=126194
2009-02-07 18:57:36 +00:00
Gonzalo Paniagua Javier 67cbfb1f5c 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: include stdio so that NULL is defined when checking
	for ifreq.


svn path=/branches/mono-2-4/mono/; revision=126165
2009-02-07 05:25:30 +00:00
Gonzalo Paniagua Javier 90a94a6b8b 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* Dns.cs: empty string for host (also 0.0.0.0) is just passed to the
	runtime, which will then retrieve the local IP addresses. Fixes bug
	#386637 part 2/2.


svn path=/branches/mono-2-4/mcs/; revision=126163
2009-02-07 05:22:36 +00:00
Gonzalo Paniagua Javier f6479e150f 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: an empty host name returns the list of local IPs.
	Fixes bug #386637 part 1/2.


svn path=/branches/mono-2-4/mono/; revision=126161
2009-02-07 05:21:42 +00:00
Gonzalo Paniagua Javier 1208b12f69 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* StreamReader.cs: when a LF ends a decoded buffer and is not followed
	by a CR in the next decoded buffer, we didn't flush the string.
	Fixes bug #445326.


svn path=/branches/mono-2-4/mcs/; revision=126132
2009-02-06 23:02:06 +00:00
Gonzalo Paniagua Javier d3d80927e1 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: some servers have a comment after the directory
	name. Fixes bugs #471149 and #471216.


svn path=/branches/mono-2-4/mcs/; revision=126102
2009-02-06 20:19:30 +00:00
Gonzalo Paniagua Javier 73146ea69a 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: set the content length to 0 when the
	response is not supposed to have any content.


svn path=/branches/mono-2-4/mcs/; revision=126091
2009-02-06 19:33:54 +00:00
Zoltan Varga f7d427a360 2009-02-06 Zoltan Varga <[email protected]>
Backport of r126054.

	* marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
	need to be boxed.

svn path=/branches/mono-2-4/mono/; revision=126055
2009-02-06 15:18:43 +00:00
Marek Habersack 2b8f2bd2eb Backport of r126051
svn path=/branches/mono-2-4/mcs/; revision=126052
2009-02-06 15:06:58 +00:00
Marek Habersack 11d0202305 Reverting 126038
svn path=/branches/mono-2-4/mcs/; revision=126046
2009-02-06 14:11:25 +00:00
Marek Habersack a755dfc8ab Backport of r126037
svn path=/branches/mono-2-4/mcs/; revision=126038
2009-02-06 13:09:51 +00:00
Marek Habersack 2c9a79735d Backport of r126025
svn path=/branches/mono-2-4/mcs/; revision=126030
2009-02-06 12:26:30 +00:00
Marek Habersack abc43192bf Backport of r125945
svn path=/branches/mono-2-4/mcs/; revision=125946
2009-02-05 22:09:11 +00:00
Mark Probst 791e158847 2009-02-05 Mark Probst <[email protected]>
Backport of r125887.

	* object.c (mono_object_get_virtual_method): Properly inflate
	generic methods.  Fixes #472692.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125887.

	* jit-icalls.c (mono_helper_compile_generic_method): Don't inflate
	the method we get from mono_object_get_virtual_method() because
	that function does it properly, now.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125887.

	* bug-472692.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=125910
2009-02-05 18:46:12 +00:00
Ivan Zlatev 35022b4629 2009-02-05 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation:
	   - Use ArrayList.Insert instead of the Item property so that the item
	   is actually inserted and not an existing item replaced.
	   - Call DataGridView.OnRowsAddedInternal and drop internal from
	   OnRowsAdded for binary compitability. This also fixes several
	   redrawing issues.
	[Fixes bug #472968]

svn path=/branches/mono-2-4/mcs/; revision=125901
2009-02-05 18:26:32 +00:00
Andrés G. Aragoneses 13e7da0b12 (Backport typo fix in r125894.)
System.Windows.Forms/ToolBarButton.cs: Doh, fire OnUIATextChanged
  *after* setting the value.

svn path=/branches/mono-2-4/mcs/; revision=125896
2009-02-05 18:07:46 +00:00
Marek Habersack 31d1906af8 Backport of r125885
svn path=/branches/mono-2-4/mcs/; revision=125888
2009-02-05 17:06:35 +00:00
Andrés G. Aragoneses e8030a1270 oops, fix build
svn path=/branches/mono-2-4/mcs/; revision=125877
2009-02-05 16:15:30 +00:00
Andrés G. Aragoneses 81732363f2 * ToolBarButton.cs: OnTextChanged added.
(Backport of r125802.) r: jpobst

svn path=/branches/mono-2-4/mcs/; revision=125876
2009-02-05 16:10:56 +00:00
Miguel de Icaza e47086ae2c Backport the fix for the nullref on WebConnectionStream
svn path=/branches/mono-2-4/mcs/; revision=125875
2009-02-05 16:09:10 +00:00
Marek Habersack adb5812097 Backport of r125857
svn path=/branches/mono-2-4/mcs/; revision=125858
2009-02-05 13:15:31 +00:00
Rodrigo Kumpera a629d14e14 2009-02-05 Rodrigo Kumpera <[email protected]>
Backport of r125849.

	* class.c (mono_class_create_from_typedef): The CLR supports SystemF
	recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
	for the parent type, the created type must be ready to be used on a generic
	instantiation.
	We fill this_arg/byval_arg if the parent is a generic instance to make sure
	we won't have duplicated entries in generic_inst_cache.

	Fixes #469553.



svn path=/branches/mono-2-4/mono/; revision=125851
2009-02-05 11:52:52 +00:00
Mark Probst 455afec78e 2009-02-05 Mark Probst <[email protected]>
Backport of r125839.

	* mini-exceptions.c (ves_icall_get_frame_info): Account for the
	fact that mono_find_jit_info() sometimes returns the context
	corresponding to the jit info in new_ctx.  Fixes #472600.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125839.

	* bug-472600.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=125850
2009-02-05 11:45:58 +00:00
Marek Habersack cee2f48565 Backport of r125798
svn path=/branches/mono-2-4/mcs/; revision=125799
2009-02-05 00:58:02 +00:00
Gonzalo Paniagua Javier 3a1003365a new tests for empty string
svn path=/branches/mono-2-4/mcs/; revision=125796
2009-02-05 00:22:18 +00:00
Gonzalo Paniagua Javier d8f224fa77 2009-02-04 Gonzalo Paniagua Javier <[email protected]>
* DateTime.cs: check for null and empty strings before anything else
	in CoreParse.


svn path=/branches/mono-2-4/mcs/; revision=125794
2009-02-05 00:21:03 +00:00
Miguel de Icaza 22492c37cc Remove public
svn path=/branches/mono-2-4/mcs/; revision=125749
2009-02-04 20:58:29 +00:00
Zoltan Varga a9e7fb0abd 2009-02-04 Zoltan Varga <[email protected]>
Backport of 125697.

	* mini-exceptions.c (mono_setup_altstack): Use a more reasonable altstack
	size on systems with 64k pages. Fixes #471389.

svn path=/branches/mono-2-4/mono/; revision=125698
2009-02-04 16:34:19 +00:00
Marek Safar 02284d8008 Fixed typo.
svn path=/branches/mono-2-4/mcs/; revision=125684
2009-02-04 14:08:30 +00:00
Marek Habersack 0b4c366520 Backport of r125663
svn path=/branches/mono-2-4/mcs/; revision=125664
2009-02-04 10:45:22 +00:00
Marek Habersack f5c7491d79 Backport of r125659
svn path=/branches/mono-2-4/mcs/; revision=125660
2009-02-04 09:04:05 +00:00
Zoltan Varga 4dd31c484d 2009-02-04 Zoltan Varga <[email protected]>
Backport of 125637.
	
	* Regex.cs: Disable the new regex engine for now.

svn path=/branches/mono-2-4/mcs/; revision=125638
2009-02-04 02:21:16 +00:00
Gonzalo Paniagua Javier 48c4359548 2009-02-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs: calling Abort is safe now if the request has been
	read entirely.


svn path=/branches/mono-2-4/mcs/; revision=125635
2009-02-04 01:50:26 +00:00
Rodrigo Kumpera 3d48548a24 In metadata:
Backport of r125603.

	* verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
	valuetype is compatible with target type, check by inheritance as a
	VT is not really compatible with System.ValueType, for example.

	* verify.c (do_invoke_method): Improve error message.

	* verify.c (do_box_value): If boxing a nullable, use the type argument
	on stack instead.

	* verify.c (do_newobj): Improve error message.	

	Fixes #469549.

2009-02-03 Rodrigo Kumpera  <[email protected]>

In tests/verifier:
	Backport of r125604.

	* valid_boxed_vt_compatible_with_sys_vt_or_sys_enum.il:
	Regression test for #469549.

2009-02-03 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=125606
2009-02-03 22:05:30 +00:00
Ivan Zlatev bfb47f0422 2009-02-03 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Move row completion
	code in the row collection code, so that the completion happens before
	the CollectionChanged event, also better encapsulation.
	[Fixes bug #471987]

svn path=/branches/mono-2-4/mcs/; revision=125587
2009-02-03 19:43:40 +00:00
Rodrigo Kumpera c5e9df9a7d In metadata:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125581.

	* verify.c (mono_delegate_signature_equal): Make it possible to check
	first-arg-bound delegates to static method.

	* verify.c (verify_delegate_compatibility): Correctly verify delegates to
	static methods with the first arg bound.

	Fixes #469529.


In tests/verifier:
	Backport of r125582.

	* unverifiable_delegate_with_bad_bound_first_arg_to_static_method.il:
	* mono/tests/verifier/valid_ldfnt_delegates_of_static_methods.il:
	Regression test for #469529.

2009-02-03 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=125586
2009-02-03 19:41:23 +00:00
Mark Probst 4bfa3b8cb4 2009-02-03 Mark Probst <[email protected]>
Backport of r125565.

	* generic-sharing.c: Don't hold domain lock when calling
	instantiate_other_info().  Fixes #471958.

	* domain-internals.h, loader.c: Describe locking policy of domain
	lock vs loader lock.

svn path=/branches/mono-2-4/mono/; revision=125570
2009-02-03 18:41:15 +00:00
Rodrigo Kumpera d0cfd383a1 In metadata:
Backport of r125539.

	* verify.c: Added stack_slot_full_name to provide decent and more meanfull
	errors.

	* verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
	under strict mode. Any type, when boxed can be seen as a reference type.

	Fixes #469528.

2009-02-03 Rodrigo Kumpera  <[email protected]>

In tests/verifier:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125540.

	* valid_valuetype_boxed_types_are_merge_compatible.il:
	Regression test for #469528.


svn path=/branches/mono-2-4/mono/; revision=125561
2009-02-03 17:54:42 +00:00
Marek Safar 236f5b982c Fixes build.
svn path=/branches/mono-2-4/mcs/; revision=125550
2009-02-03 16:50:46 +00:00
Marek Safar 082abf401a 2009-02-03 Marek Safar <[email protected]>
* class.cs, generic.cs: Emit type parameter constraints for nested
	types.


svn path=/branches/mono-2-4/mcs/; revision=125508
2009-02-03 12:08:02 +00:00
Gonzalo Paniagua Javier bc2585699c 2009-02-03 Gonzalo Paniagua Javier <[email protected]>
* WebProxy.cs: use TryParse when checking for a localhost IP.


svn path=/branches/mono-2-4/mcs/; revision=125500
2009-02-03 10:08:56 +00:00
Gonzalo Paniagua Javier 6dad7702ea 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: avoid throwing an exception when
	Content-Length is not present.

svn path=/branches/mono-2-4/mcs/; revision=125493
2009-02-03 08:18:25 +00:00
Raja R Harinath 84031f8584 Fix #463999
* CommittableTransaction.cs (CommitCallback): Handle the case
where the callback is invoked before BeginCommit ends due to the
async call ending synchronously.

svn path=/branches/mono-2-4/mcs/; revision=125490
2009-02-03 07:20:32 +00:00
Rodrigo Kumpera 243a027520 In metadata:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125458.

	* object.h: The lower bound of an array is a signed integer value.
	Introduce mono_array_lower_bound_t typedef. It should be used instead of
	gint32 as under MONO_BIG_ARRAYS it will be a gint64.

	* icall.c: Cast MonoArrayBounds::length to a signed value so correctly
	calculate the upper bound.
	
	Fixes #471252.

In mini:
2009-02-03  Rodrigo Kumpera  <[email protected]>

	Backport of r125459.

	* arrays.cs: Test for Get/SetValue of array with negate lower bounds.
	

svn path=/branches/mono-2-4/mono/; revision=125461
2009-02-03 03:06:01 +00:00
Rodrigo Kumpera 5b78093eef 2008-02-03 Rodrigo Kumpera <[email protected]>
* MonoMethod.cs (ToString): Fix the 1.1 build.


svn path=/branches/mono-2-4/mcs/; revision=125457
2009-02-03 02:53:00 +00:00
Ivan Zlatev 4b6d5edc78 2009-02-02 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: When editing is finished do not remove the editing
	row, because it has already become a real one. Instead add a new one.
	[Fixes bug #471754]

svn path=/branches/mono-2-4/mcs/; revision=125445
2009-02-02 23:36:15 +00:00
Rodrigo Kumpera b9d3e3262c Backport of r125415.
* MonoMethod.cs (ToString): Fix the representation of non primitive structs.

2008-02-02  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=125417
2009-02-02 22:01:46 +00:00
Rodrigo Kumpera 77c4302bdf In Test/System.Reflection:
2008-02-02  Rodrigo Kumpera  <[email protected]>

	Backport of r125410.

	* MethodInfoTest.cs: Test for #409583.

In System.Reflection:
2008-02-02  Rodrigo Kumpera  <[email protected]>

	Backport of r125409.

	* MonoMethod.cs (ToString): Fix representation of pointer types.

	Fixes #409583.


svn path=/branches/mono-2-4/mcs/; revision=125411
2009-02-02 21:11:19 +00:00
Rodrigo Kumpera 7f13ce00ce 2009-02-02 Rodrigo Kumpera <[email protected]>
Backport of r125402.

	* icall.c (type_from_name): Ignore reflection frames to find out the real caller.

	Fixes #471255.


svn path=/branches/mono-2-4/mono/; revision=125404
2009-02-02 20:40:08 +00:00
Mark Probst 643a83b9a0 2009-02-02 Mark Probst <[email protected]>
Backport of r125388.

	* generic-sharing.c (lookup_or_register_other_info): Make sure the
	loader lock is not taken while the templates lock is held.  Fixes
	#471089.

svn path=/branches/mono-2-4/mono/; revision=125391
2009-02-02 18:48:15 +00:00
Mark Probst 25b50b1c80 2009-02-02 Mark Probst <[email protected]>
Backport or r125371.

	* metadata.c (type_in_image): Added a check to fix a monodis
	crash.

svn path=/branches/mono-2-4/mono/; revision=125377
2009-02-02 17:07:07 +00:00
Andrés G. Aragoneses 2e3f003f5f 2009-02-02 Andrés G. Aragoneses <[email protected]>
* ToolBar.cs: Add new UIAPerformClick method to be called by
        UIAutomationWinforms when someone calls Invoke() on the
        ToolBarButtonProvider. (Backport of r125354.) r: jpobst


svn path=/branches/mono-2-4/mcs/; revision=125358
2009-02-02 16:02:09 +00:00
Marek Safar b8a1e12c73 2009-02-02 Marek Safar <[email protected]>
A fix for bug #471213
	* class.cs: Avoid emitting backing field for abstract event fields.


svn path=/branches/mono-2-4/mcs/; revision=125335
2009-02-02 11:33:07 +00:00
Ivan Zlatev 95ca868476 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Complete incomplete rows when they are added to
	the grid.
	[Fixes bug #471068]

svn path=/branches/mono-2-4/mcs/; revision=125278
2009-02-01 20:00:30 +00:00
Ivan Zlatev 58c2baf6a6 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewColumnCollection.cs: Ensure that the
	binding is cleared prior to setting it to null. Fixes a regression
	causing exceptions when the DataSource is set to null and then set
	again to a data source.

svn path=/branches/mono-2-4/mcs/; revision=125272
2009-02-01 18:33:43 +00:00
Marek Safar 3fc405788c 2009-02-01 Marek Safar <[email protected]>
A fix for bug #359731
	* cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
	expressions.


svn path=/branches/mono-2-4/mcs/; revision=125270
2009-02-01 18:23:45 +00:00
Ivan Zlatev 79d7ad5921 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewImageColumn.cs, DataGridViewCell.cs:
	   - Make Image/Bitmap cells work.
	   - Handle images with size greater than the cell.
	   - Default to MiddleCenter alignment for image cells.
	[Fixes bug #471101]

svn path=/branches/mono-2-4/mcs/; revision=125260
2009-02-01 16:31:21 +00:00
Rodrigo Kumpera 4809f77419 2009-01-31 Rodrigo Kumpera <[email protected]>
Backport of r125172, r125205 and r125206 

	* basic-calls.cs: Test for the weird crash found on arm.
	
	* cpu-arm.md: Increase the size of storer8_membase_reg and
	loadr8_membase_reg to 24 bytes to accomodate the extra add.

	* mini-arm.c (mono_arch_output_basic_block): Under FPA, when emitting
	OP_STORER8_MEMBASE_REG and OP_LOADR8_MEMBASE_REG, add the original
	reg to LR otherwise we'll be loading/storing from just the offset.

	* cpu-arm.md: Increase the size of storer8_membase_reg to 20 bytes
	as it might use decomposed ops.


svn path=/branches/mono-2-4/mono/; revision=125207
2009-01-31 03:55:25 +00:00
Rodrigo Kumpera 71b8786ee9 2009-01-30 Rodrigo Kumpera <[email protected]>
Backport of r125077-79
	* exceptions-arm.c (mono_arch_find_jit_info): The frame layout on arm have
	separate frame and stack pointers, so we must use FP to find the register
	spill area.
	The FP reg is retrieved from the MonoContext::regs array.


	* mini-arm.c (mono_arch_output_basic_block): Emit two cond ops for OP_FBGE
	as FPA requires it.

	* mini-arm.c (mono_arch_emit_setret): Emit OP_FMOVE for methods that
	return R4 and R8 when not running under softfloat.

	Fixes basic-calls.exe


svn path=/branches/mono-2-4/mono/; revision=125116
2009-01-30 17:12:46 +00:00
Marek Habersack 0c0fa5ec89 Backport of r125111.
svn path=/branches/mono-2-4/mcs/; revision=125112
2009-01-30 16:53:05 +00:00
Marek Safar 57e29afeaf 2009-01-30 Marek Safar <[email protected]>
A fix for bug #470767
	* statement.cs: Introduced BlockScopeExpression, needed when 
	expression tree conversion has to emit scope variables.


svn path=/branches/mono-2-4/mcs/; revision=125096
2009-01-30 14:51:17 +00:00
Gonzalo Paniagua Javier c1577730af revert changes that should not be here yet
svn path=/branches/mono-2-4/mcs/; revision=124989
2009-01-29 19:00:13 +00:00
Gonzalo Paniagua Javier e22310c6b8 fix the 1.x build. Patch from Marek Safar
svn path=/branches/mono-2-4/mcs/; revision=124986
2009-01-29 18:57:41 +00:00
Gonzalo Paniagua Javier dc34921ff7 fix changelog
svn path=/branches/mono-2-4/mcs/; revision=124960
2009-01-29 17:18:54 +00:00
Gonzalo Paniagua Javier c4c2071766 2009-01-29 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: fix for output parameters and '@'.
	Fixes bug #470120.


svn path=/branches/mono-2-4/mcs/; revision=124959
2009-01-29 17:16:46 +00:00
Gonzalo Paniagua Javier 16e7814ee4 2009-01-29 Gonzalo Paniagua Javier <[email protected]>
* HttpApplicationFactory.cs: fix check that avoids lock. Keep one
	HttpApplication instance ready to be returned in an instance variable
	to avoid a few locks.


svn path=/branches/mono-2-4/mcs/; revision=124949
2009-01-29 16:41:12 +00:00
Carlos Alberto Cortez 568d44fd06 2009-01-29 Carlos Alberto Cortez <[email protected]>
* XplatUIX11.cs: We should use utf8 handling clipboard transference
        with other x11 applications, and use utf16 when handling clipboard
        data in the class library. Update the related points as well.
        Fixes #468683.


svn path=/branches/mono-2-4/mcs/; revision=124920
2009-01-29 14:15:30 +00:00
Ivan Zlatev bcdc624995 2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Format strings according to the supplied
	CellStyle.Format.
	[Fixes bug #470384]

svn path=/branches/mono-2-4/mcs/; revision=124878
2009-01-28 23:34:19 +00:00
Marek Habersack f2b360fc5d Backport of r124872
svn path=/branches/mono-2-4/mcs/; revision=124874
2009-01-28 23:29:31 +00:00
Bill Holmes f913aabf5c 2009-01-28 Bill Holmes <[email protected]>
Backport of r124869.

	* Uri.cs (IsWellFormedUriString):  Changing IsWellFormedUriString
	  to not throw an exception but return false instead.

	Contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mcs/; revision=124870
2009-01-28 23:24:09 +00:00
Ivan Zlatev 3cd16ddbdb 2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Reset the hover cell if it gets moved due to row(s)
	addition or removal. Fixes multiple crashes in OnMouseMove.

svn path=/branches/mono-2-4/mcs/; revision=124868
2009-01-28 22:48:56 +00:00
Carlos Alberto Cortez 8edff05440 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeNode.cs: NextVisibleNode and PrevVisibleNode properties don't
	take into account the fact that OpenTreeNodeEnumerator needs to call
	MoveNext/MovePrevious to actually put the passed node as the one
	retrieved in Current. This way this property should work as really
	expected in .net.
	Fixes part of #467225.


svn path=/branches/mono-2-4/mcs/; revision=124802
2009-01-28 17:14:50 +00:00
Carlos Alberto Cortez bd3a3e1ec5 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When calculating the scrollbars, don't use
	TreeNode.Bounds, since it still can have the values of the previous
	-and now invalid- layout -which depends on TreeView.skipped_nodes, and
	could not have been updated as well-, and use the actual number of
	visible number of nodes to compute the height needed to contain all
	the nodes. Also reset the value of vbar to 0 when disabled - this way
	we make sure that, when re-enabled, it will update the visible area of
	the treeview, even if the previous value before disabling it is the
	same as now. Finally don't do anything for the vbar.ValueChanged
	handler - for the case wheer we manually set the value but don't the
	vbar is disabled already.
	Fixes part of #467225.


svn path=/branches/mono-2-4/mcs/; revision=124801
2009-01-28 17:12:51 +00:00
Carlos Alberto Cortez 330dee9522 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: In CollapseAll, set vbar to the maximum value, instead 
	of trying to set as top node the highest parent of the previous
	top node. Moving to the bottom of the TreeView after a call
	to CollapseAll is exactly what .net does. This should avoid some
	nasty issue when CollapseAll is called and we don't need the
	vertical scroll bar.
	

svn path=/branches/mono-2-4/mcs/; revision=124800
2009-01-28 17:09:34 +00:00
Marek Safar e65b5f396b 2009-01-28 Marek Safar <[email protected]>
A fix for bug #470227
	* cs-tokenizer.cs: Remove too agressive parser optimization.


svn path=/branches/mono-2-4/mcs/; revision=124787
2009-01-28 16:13:16 +00:00
Marek Safar 5c4721c3d5 2009-01-28 Marek Safar <[email protected]>
A fix for bug #324319
	* class.cs: Remove too early base type resolve.


svn path=/branches/mono-2-4/mcs/; revision=124770
2009-01-28 12:29:20 +00:00
Mark Probst 3f7fdcc82d 2009-01-27 Mark Probst <[email protected]>
Backport of r124712.

	* method-to-ir.c (emit_stloc_ir): Only apply the reg-reg move
	optimization if the top of stack is the last instruction in the
	bblock.  Otherwise it might have been used after its definition.
	Fixes #469742.

2009-01-27  Mark Probst  <[email protected]>

	Backport of r124712.

	* bug469742.2.il: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124715
2009-01-27 21:49:44 +00:00
Zoltan Varga a3d384dbbf 2009-01-27 Zoltan Varga <[email protected]>
* Backport of r123987.

	* method-to-ir.c (method-to-ir.c): Add support for the constrained prefix
	on type variables in AOTed code.

svn path=/branches/mono-2-4/mono/; revision=124691
2009-01-27 18:31:49 +00:00
Ivan Zlatev 699f408478 2009-01-27 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix a NRE when setting the CurrentCell to null.

svn path=/branches/mono-2-4/mcs/; revision=124671
2009-01-27 16:48:12 +00:00
Ivan Zlatev 332943e496 2009-01-27 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Fire Timer.Tick even if there is no MainForm for the
	current context.
	[Fixes bug #469239]

svn path=/branches/mono-2-4/mcs/; revision=124669
2009-01-27 16:41:05 +00:00
Marek Habersack 204dc4ea04 Backport of r124659
svn path=/branches/mono-2-4/mcs/; revision=124660
2009-01-27 14:25:33 +00:00
Gonzalo Paniagua Javier 49bbf1f4c3 2009-01-26 Christian Prochnow <[email protected]>
* Ping.cs: ignore ICMP echo request packet in case we ping
	  localhost.


svn path=/branches/mono-2-4/mcs/; revision=124625
2009-01-27 04:23:18 +00:00
Andreia Gaita 401cabfc6a 2009-01-26 Andreia Gaita <[email protected]>
* WebBrowser.cs: fix initial value of ScrollbarsEnabled, so they
	won't be disabled by default.
	[Backported from r124596, fixes #468690]

svn path=/branches/mono-2-4/mcs/; revision=124615
2009-01-27 00:44:14 +00:00
Marek Safar a2e8d38fa6 2009-01-27 Marek Safar <[email protected]>
* anonymous.cs: Fixed recent regression when initializing captured 
	this.


svn path=/branches/mono-2-4/mcs/; revision=124608
2009-01-27 00:01:40 +00:00
Zoltan Varga 099b6e3c26 2009-01-26 Zoltan Varga <[email protected]>
Backport of r124582.

	* mini-s390x.c: Remove a stray declaration of emit_sig_cookie () to fix
	the s390x build.

svn path=/branches/mono-2-4/mono/; revision=124583
2009-01-26 22:12:45 +00:00
Ivan Zlatev 9979ab1f91 2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not clear the rows if we are not databound.

svn path=/branches/mono-2-4/mcs/; revision=124570
2009-01-26 21:58:17 +00:00
Ivan Zlatev f11abca644 2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not be too smart about selecting the first cell
	when the first row is added as this is not what MS does. Fixes the
	failing unit tests.

svn path=/branches/mono-2-4/mcs/; revision=124566
2009-01-26 21:45:47 +00:00
Marek Habersack c12233306a Backport of r124547
svn path=/branches/mono-2-4/mcs/; revision=124548
2009-01-26 18:58:39 +00:00
Marek Safar 5995136419 2009-01-26 Marek Safar <[email protected]>
A fix for bug #469019
	* anonymous.cs: Use all parent type parameters when instantiating
	nested generic storey.


svn path=/branches/mono-2-4/mcs/; revision=124533
2009-01-26 16:49:46 +00:00
Marek Safar 2441d1f521 2009-01-26 Marek Safar <[email protected]>
* expression.cs: Check for null instance methodgroup expression.


svn path=/branches/mono-2-4/mcs/; revision=124506
2009-01-26 15:28:26 +00:00
Marek Habersack 410a27b2bf Backport of r124491
svn path=/branches/mono-2-4/mcs/; revision=124492
2009-01-26 13:27:30 +00:00
Marek Safar a05f9f8b5e 2009-01-26 Marek Safar <[email protected]>
A fix for bug #469244
	* cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
	instance inside a conditional expression.


svn path=/branches/mono-2-4/mcs/; revision=124489
2009-01-26 13:20:16 +00:00
Marek Habersack 6e5c11cd30 Backport of r124479
svn path=/branches/mono-2-4/mcs/; revision=124481
2009-01-26 11:39:43 +00:00
Marek Habersack b1c0dfa135 Backport of r124475
svn path=/branches/mono-2-4/mcs/; revision=124476
2009-01-26 10:47:02 +00:00
Gonzalo Paniagua Javier 3653a83b39 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs:
	(TestSelect1) avoid RST by reading the bytes from the client.

svn path=/branches/mono-2-4/mcs/; revision=124464
2009-01-26 07:02:18 +00:00
Zoltan Varga cb0c6ba813 2009-01-26 Zoltan Varga <[email protected]>
Backport of r124456.

	* exceptions-amd64.c (mono_arch_exceptions_init): Call 
	get_throw_pending_exception () to avoid initialization races.

	* mini-exceptions.c (mono_exceptions_init): Call an arch specific
	mono_arch_exceptions_init () function.

svn path=/branches/mono-2-4/mono/; revision=124462
2009-01-26 06:52:10 +00:00
Gonzalo Paniagua Javier 16eaf2a641 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: added locking in SetResponseData for the case
	when we get an error response before BeginGetResponse has been
	called.


svn path=/branches/mono-2-4/mcs/; revision=124453
2009-01-26 05:03:35 +00:00
Gonzalo Paniagua Javier 516a0835f0 fix ChangeLog
svn path=/branches/mono-2-4/mcs/; revision=124413
2009-01-24 08:16:23 +00:00
Gonzalo Paniagua Javier 7ff67aa81a Improved TDS connection pooling and synched with HEAD
svn path=/branches/mono-2-4/mcs/; revision=124409
2009-01-24 05:56:39 +00:00
Gonzalo Paniagua Javier 6f0d5440ce Do not throw exceptions when attempting to load satellite assemblies
svn path=/branches/mono-2-4/mcs/; revision=124407
2009-01-24 05:35:35 +00:00
Gonzalo Paniagua Javier 06c1a5f74c 2009-01-24 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: return NULL instead of throwing FileNotFoundException
	when LoadAssembly() fails.


svn path=/branches/mono-2-4/mono/; revision=124406
2009-01-24 05:35:23 +00:00
Gonzalo Paniagua Javier 572fa90350 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* AspComponentFoundry.cs: no need to throw. Caller handles a null
	return value.


svn path=/branches/mono-2-4/mcs/; revision=124398
2009-01-24 03:28:19 +00:00
Gonzalo Paniagua Javier 9a7ac8152c 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: make sure config is not null here.
	* HttpApplication.cs: add a timer (-d:PIPELINE_TIMER) for the pipeline.
	Handle timeouts for OutputPage() too.


svn path=/branches/mono-2-4/mcs/; revision=124396
2009-01-24 03:20:13 +00:00
Gonzalo Paniagua Javier 9468c9429f 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* HttpApplicationFactory.cs: set/reset the context for the application
	when creating/disposing. Dispose() out of the lock.


svn path=/branches/mono-2-4/mcs/; revision=124394
2009-01-24 03:04:12 +00:00
Marek Habersack 0c702ece52 Backport of r124385
svn path=/branches/mono-2-4/mcs/; revision=124386
2009-01-24 00:38:33 +00:00
Marek Habersack 8b2e70be67 Backport of r124377
svn path=/branches/mono-2-4/mcs/; revision=124378
2009-01-23 21:50:04 +00:00
Mark Probst 8ee63bd04a 2009-01-23 Mark Probst <[email protected]>
Backport of r124339.

	* mini-ppc.c (mono_arch_context_get_int_reg): Allow access to the
	stack pointer (r1).

svn path=/branches/mono-2-4/mono/; revision=124340
2009-01-23 16:48:19 +00:00
Marek Habersack 30f6ae193f 2009-01-23 Marek Habersack <[email protected]>
* BuildManager.cs: if dependencyCache already contains the virtual
	path, replace its corresponding file set (in AddToCache). This can
	happen only if the requested virtual path compilation resulted in
	errors and the compilation has been retried. Fixes bug #46268


svn path=/branches/mono-2-4/mcs/; revision=124326
2009-01-23 14:07:17 +00:00
Mark Probst 6d52bd6446 2009-01-23 Mark Probst <[email protected]>
Backport of r124022 and r124301.

	* metadata.c (mono_metadata_generic_param_equal): Owner as well as
	image must match.  Only compare the image if the owner is NULL.
	Fixes the AOT failures.

svn path=/branches/mono-2-4/mono/; revision=124305
2009-01-23 09:40:04 +00:00
Ivan Zlatev 85b4874919 2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewCell.cs: Fix crashes when there is no
	editing control.

svn path=/branches/mono-2-4/mcs/; revision=124281
2009-01-23 01:35:31 +00:00
Ivan Zlatev ab52d70383 2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix new row adding/editing in the non-databound
	scenario.

svn path=/branches/mono-2-4/mcs/; revision=124280
2009-01-23 01:35:26 +00:00
Zoltan Varga 64d093c92a 2009-01-23 Zoltan Varga <[email protected]>
Backport of r124266.
	
	* metadata.c (mono_metadata_load_generic_params): Initialize the 
	MonoGenericParam structure using memset so the image field is initialized
	as well.

svn path=/branches/mono-2-4/mono/; revision=124268
2009-01-22 23:43:26 +00:00
Zoltan Varga b0af86bfc2 2009-01-22 Zoltan Varga <[email protected]>
Backport of r124260.
	
	* Stopwatch.cs: Reorder the calculations in Elapsed and ElapsedMilliseconds
	to avoid overflow. Fixes #468570. Patch by Yoni Shalom <[email protected]>.

svn path=/branches/mono-2-4/mcs/; revision=124262
2009-01-22 22:19:55 +00:00
Mark Probst 655579cbb1 2009-01-22 Mark Probst <[email protected]>
Backport of r124246.

	* mini-exceptions.c (ves_icall_get_frame_info): Fetch the generic
	info from the (correct) context.

2009-01-22  Mark Probst  <[email protected]>

	Backport of r124246.

	* generic-stack-traces2.2.cs: Another generic sharing test for
	stack traces.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124249
2009-01-22 21:15:17 +00:00
Jb Evain 2809fe1936 idiotic test NotWorking
svn path=/branches/mono-2-4/mcs/; revision=124242
2009-01-22 20:10:33 +00:00
Jb Evain e5590d4ff5 backport the linq fixes that happened in 124200:124231
svn path=/branches/mono-2-4/mcs/; revision=124232
2009-01-22 17:43:38 +00:00
Neville Gao 4d259921aa Backported r124045: Control enabled to support accessibility. Added
UIACollectionChangedEvent.

svn path=/branches/mono-2-4/mcs/; revision=124172
2009-01-22 06:01:24 +00:00
Mike Gorse 0043b1fd2b * TrackBar.cs: Backported R124116: Make LargeIncrement/Decrement
internal so that UIA can use them.
  Added UIAValueParamChangedEvent.

svn path=/branches/mono-2-4/mcs/; revision=124129
2009-01-21 23:32:53 +00:00
Atsushi Eno 8b50ed4dbb backport r124126.
svn path=/branches/mono-2-4/mcs/; revision=124127
2009-01-21 23:21:22 +00:00
Marek Habersack 7727921d34 Backport of r124121 and r124122
svn path=/branches/mono-2-4/mcs/; revision=124123
2009-01-21 22:53:22 +00:00
Zoltan Varga 56c1d33ae4 Revert r124022 as it is breaking AOT.
svn path=/branches/mono-2-4/mono/; revision=124102
2009-01-21 20:16:59 +00:00
Zoltan Varga cad348bcb2 2009-01-21 Zoltan Varga <[email protected]>
Backport of r124092.
	
	* method-to-ir.c (handle_alloc): Avoid generic instances in the
	out_of_line optimization.

svn path=/branches/mono-2-4/mono/; revision=124095
2009-01-21 19:34:51 +00:00
Mario Carrion c643703e79 2009-01-21 Mario Carrion <[email protected]>
* Form.cs: Backported r124064: UIA Support: Internal events
        added: UIAWindowStateChanged and UIATopMostChanged.

svn path=/branches/mono-2-4/mcs/; revision=124082
2009-01-21 18:54:38 +00:00
Zoltan Varga 9c234e78b1 Fix the 1.1 build.
svn path=/branches/mono-2-4/mcs/; revision=124077
2009-01-21 18:13:20 +00:00
Rodrigo Kumpera 85c63ecffe 2009-01-21 Rodrigo Kumpera <[email protected]>
Backport of r124059.

	* appdomain-unload-callback.cs: New test for the AppDomain::DomainUnload
	deadlock.

	* Makefile.am: Test added.


svn path=/branches/mono-2-4/mono/; revision=124072
2009-01-21 18:00:02 +00:00
Rodrigo Kumpera 86877ecd25 2009-01-21 Rodrigo Kumpera <[email protected]>
Backport of r124068.

	* appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
	a plain store.

2009-01-21 Rodrigo Kumpera  <[email protected]>

	Backport of r124058.

	* domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
	which signals that the unloading has started but all appdomain services must
	remain operational.

	* appdomain.c (mono_domain_unload): The initial state for unloading now
	is unloading_start and we switch to unloading after the managed call to
	AppDomain::DomainUnload has finished.

	The new unloading state has to be created because managed code in the
	DomainUnload event can depend on things like the threadpool still working.
	The domain must remain fully functional while the event executes.

	This shown as an issue due to Process::WaitForExit, which waits for
	async reads of stdout and stderr to complete. Since those are processed
	in the threadpool the code deadlocks because the DomainUnload callback 
	waits for the async read finished event, which should have been set by a
	threadpool job but has been discarded due to the domain been in unload
	state.


svn path=/branches/mono-2-4/mono/; revision=124071
2009-01-21 17:58:36 +00:00
Zoltan Varga a228d05aec 2009-01-21 Zoltan Varga <[email protected]>
Backport of r124065.
	
	* class.c (mono_class_setup_vtable_general): In the generic instance
	optimization, set method->slot for abstract virtual methods. Fixes part of
	#467834.

svn path=/branches/mono-2-4/mono/; revision=124067
2009-01-21 17:42:11 +00:00
Martin Baulig 19503869ca 2009-01-21 Martin Baulig <[email protected]>
Backport or r124060.

	* mini.h
	(MonoCompile): Added `disable_deadce_vars' to disable removing
	unused variables.

	* mini.c
	(mini_method_compile): Set `cfg->disable_deadce_vars' when running
	inside the debugger.

	* liveness.c (mono_analyze_liveness): Don't remove any unused
	variables if `cfg->disable_deadce_vars' is set.


svn path=/branches/mono-2-4/mono/; revision=124061
2009-01-21 17:00:39 +00:00
Sandy Armstrong 9e91c826fd * Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs: Add
UIACheckChanged, UIARadioCheckChanged, UIAEnabledChanged, and
  UIATextChanged events.

* Managed.Windows.Forms/System.Windows.Forms/Form.cs: Add UIAMenuChanged
  event.

* Managed.Windows.Forms/System.Windows.Forms/Menu.cs:
* Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs: Note which
  internal APIs are being used by UIA.

svn path=/branches/mono-2-4/mcs/; revision=124055
2009-01-21 16:31:22 +00:00
Mark Probst ebb82987f6 2009-01-21 Mark Probst <[email protected]>
Backport of r124028.

	* method-to-ir.c: Only apply exception constructor optimization if
	the the method actually belongs to an exception class.  Fixes
	#467456.

2009-01-21  Mark Probst  <[email protected]>

	Backport of r124028.

	* bug-467456.cs: New test case.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124031
2009-01-21 12:36:49 +00:00
Mark Probst e311191ef7 2009-01-21 Mark Probst <[email protected]>
Backport of r124022.

	* metadata.c (mono_metadata_generic_param_equal): Owner as well as
	image must match.

2009-01-21  Mark Probst  <[email protected]>

	Backport of r124022.

	* generic-unloading.2.cs, generic-unloading-sub.2.cs: Test case
	for unloading images whose MonoGenericInst's are still in use.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124025
2009-01-21 11:11:54 +00:00
Zoltan Varga ab819e4118 2009-01-21 Zoltan Varga <[email protected]>
Backport of r123989.
	
	* mini-trampolines.c (mono_delegate_trampoline): Put back the previous
	change inside a #ifdef __mono_ppc64__.

svn path=/branches/mono-2-4/mono/; revision=123990
2009-01-21 04:33:07 +00:00
Zoltan Varga dc3f9d3f6d Fix the windows build.
svn path=/branches/mono-2-4/mono/; revision=123981
2009-01-21 01:55:25 +00:00
Mark Probst 451bc2a8a8 2009-01-21 Mark Probst <[email protected]>
Backport of r123959.

	* TypeBuilderTest.cs: Add test for fields in dynamic generic
	classes.

svn path=/branches/mono-2-4/mcs/; revision=123965
2009-01-21 00:03:59 +00:00
Mark Probst 84b2d6bfec 2009-01-21 Mark Probst <[email protected]>
Backport of r123958.

	* reflection.c (resolve_object): For fields, inflate the class and
	then get the field in the inflated class.

svn path=/branches/mono-2-4/mono/; revision=123964
2009-01-21 00:03:38 +00:00
Mark Probst a498cddad7 2009-01-20 Mark Probst <[email protected]>
Backport of r123917.

	* method-to-ir.c: Force the vtable variable in shared generic code
	for the case that they might show up on a stack trace where they
	are needed.

	* mini-exceptions.c: Save and use generic sharing info as well as
	IP in stack traces to resolve shared generic instantiations.

2009-01-20  Mark Probst  <[email protected]>

	Backport of r123917.

	* object-internals.h (struct _MonoException): Added a comment
	explaining the new use of trace_ips.

2009-01-20  Mark Probst  <[email protected]>

	Backport of r123917.

	* generic-stack-traces.2.cs: Generic sharing test for stack
	traces.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=123946
2009-01-20 22:14:33 +00:00
Zoltan Varga 03c6b6918b 2009-01-20 Zoltan Varga <[email protected]>
Backport of r123914.
	
	* mini-trampolines.c (mono_delegate_trampoline): Revert the change which
	added a mono_get_addr_from_ftnptr () as it breaks the ia64 build.

svn path=/branches/mono-2-4/mono/; revision=123927
2009-01-20 21:22:20 +00:00
Andrew Jorgensen dc279e74dc update version numbers to 2.4
svn path=/branches/mono-2-4/mono/; revision=123902
2009-01-20 18:21:18 +00:00
817 changed files with 40866 additions and 32210 deletions

No files matched your search

+43
View File
@@ -1,3 +1,46 @@
2009-06-18 Marek Habersack <[email protected]>
* data/browscap.ini: applied Mono modifications to the upstream
version. Fixes three tests failing in System.Web. Fixes bug #513965
Added ecmascriptversion, msdomversion and w3cdomversion to the IE
8.0 entry. Fixes bug #513965
2009-06-15 Andreia Gaita <[email protected]>
* data/config.in: add libcups dllmap entry
[Fixes #511414, backported from r136039]
2009-05-27 Zoltan Varga <[email protected]>
* configure.in: Disable USE_MUNMAP on ppc to work around #504411.
2009-04-28 Zoltan Varga <[email protected]>
* configure.in: Define a TARGET_<ARCH> preprocessor symbol for some
architectures.
2009-01-25 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Handle ARM as well.
2009-04-28 Zoltan Varga <[email protected]>
* configure.in: Add an option to disable the solaris tar check.
* configure.in: Define a TARGET_<ARCH> preprocessor symbol for some
architectures.
2009-02-26 Marek Habersack <[email protected]>
* data/mono.web.pc.in: added. Fixes bug #479760
* data/Makefile.am: added mono.pc{.in} wherever necessary
2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: include stdio so that NULL is defined when checking
for ifreq.
2009-01-17 Zoltan Varga <[email protected]>
* configure.in: Complete the OPROFILE checks.
+1 -1
View File
@@ -23,7 +23,7 @@ if test x$GCC != xyes; then
fi
case $host in
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*)
pic_options='-fPIC'
;;
i?86-apple-darwin*)
+60 -16
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.3)
AM_INIT_AUTOMAKE(mono,2.4.2)
AM_MAINTAINER_MODE
API_VER=1.0
@@ -64,6 +64,14 @@ need_link_unlink=no
AC_MSG_CHECKING([host platform characteristics])
libgc_threads=no
has_dtrace=no
case "$host" in
powerpc*-*-linux*)
# https://bugzilla.novell.com/show_bug.cgi?id=504411
disable_munmap=yes
;;
esac
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
@@ -139,7 +147,10 @@ case "$host" in
;;
*-*-linux*)
platform_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP"
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libmono_ldflags="-lpthread"
libdl="-ldl"
@@ -360,13 +371,19 @@ fi
# A sanity check to catch cases where the package was unpacked
# with an ancient tar program (Solaris)
#
AC_MSG_CHECKING(integrity of package)
if test -f $srcdir/$mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
then
AC_MSG_RESULT(ok)
else
errorm="Your mono distribution is incomplete; if unpacking from a tar file, make sure you use GNU tar; see http://www.mono-project.com/IncompletePackage for more details"
AC_MSG_ERROR([$errorm])
AC_ARG_ENABLE(solaris-tar-check,
[ --disable-solaris-tar-check disable solaris tar check],
do_solaris_tar_check=no, do_solaris_tar_check=yes)
if test x"$do_solaris_tar_check" = xyes; then
AC_MSG_CHECKING(integrity of package)
if test -f $srcdir/$mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
then
AC_MSG_RESULT(ok)
else
errorm="Your mono distribution is incomplete; if unpacking from a tar file, make sure you use GNU tar; see http://www.mono-project.com/IncompletePackage for more details"
AC_MSG_ERROR([$errorm])
fi
fi
mcs_topdir='$(top_srcdir)/'$mcsdir
@@ -462,13 +479,18 @@ system)
## Versions of dependencies
GLIB_REQUIRED_VERSION=1.3.11
PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
dnl
dnl No, you will not replace this check with a pkg.m4 check
dnl
if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
else
AC_MSG_ERROR([You need at least glib-2.0 $GLIB_REQUIRED_VERSION])
fi
;;
*)
AC_MSG_ERROR([Invalid argument to --with-glib.])
@@ -1361,6 +1383,7 @@ if test x$platform_win32 = xno; then
AC_CHECK_HEADERS(net/if.h)
AC_MSG_CHECKING(for ifreq)
AC_TRY_COMPILE([
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
], [
@@ -1945,6 +1968,19 @@ case "$host" in
;;
esac
# FIXME: Define the others as well
case "$TARGET" in
X86)
AC_DEFINE(TARGET_X86, 1, [...])
;;
AMD64)
AC_DEFINE(TARGET_AMD64, 1, [...])
;;
ARM)
AC_DEFINE(TARGET_ARM, 1, [...])
;;
esac
if test "x$sizeof_register" = "x4"; then
AC_DEFINE(SIZEOF_REGISTER,4,[size of machine integer registers])
elif test "x$sizeof_register" = "x8"; then
@@ -2367,6 +2403,7 @@ data/mono-nunit.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/mono.web.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
@@ -2393,6 +2430,13 @@ if test x$platform_win32 = xyes; then
sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
fi
dnl
dnl Consistency settings
dnl
if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS=yes
fi
(
case $prefix in
NONE) prefix=$ac_default_prefix ;;
+4 -4
View File
@@ -8,24 +8,24 @@ EXTRA_DIST = \
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh
dtrace-prelink.sh mono.web.pc.in
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
else
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
mono_DATA = config \
browscap.ini
+6020 -7649
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -17,6 +17,7 @@
<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
<dllmap dll="libX11" target="@X11@" os="!windows" />
<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
<dllmap dll="i:kernel32.dll">
<dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
<dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
+4
View File
@@ -0,0 +1,4 @@
Name: Mono.Web
Description: Mono ASP.NET extension classes
Version: 2.0.0.0
Libs: -r:@prefix@/lib/mono/gac/Mono.Web/2.0.0.0__0738eb9f132ed756/Mono.Web.dll
+13
View File
@@ -1,3 +1,16 @@
2009-03-31 Marek Habersack <[email protected]>
* DefaultWsdlHelpGenerator.aspx: the link element in <head> must
be created using Response.Write, as the code expression in the
href attribute is otherwise treated verbatim. This is the same as
with .NET. Fixes bug #490497
2009-03-27 Gonzalo Paniagua Javier <[email protected]>
* DefaultWsdlHelpGenerator.aspx: disable the test form
when only Soap is supported.
Bug #342073 fixed.
2009-01-07 Kornél Pál <[email protected]>
* DefaultWsdlHelpGenerator.aspx: Move <script> at the end of <head> that
+13 -7
View File
@@ -122,15 +122,20 @@ void BuildOperationInfo ()
// Protocols supported by the operation
CurrentOperationProtocols = "";
WebServiceProtocols testProtocols = 0;
ArrayList prots = FindServiceProtocols (CurrentOperationName);
for (int n=0; n<prots.Count; n++) {
string prot = (string) prots [n];
if (n != 0) CurrentOperationProtocols += ", ";
CurrentOperationProtocols += (string) prots[n];
CurrentOperationProtocols += prot;
if (prot == "HttpGet")
testProtocols |= WebServiceProtocols.HttpGet;
else if (prot == "HttpPost") {
testProtocols |= WebServiceProtocols.HttpPost;
if (Context.Request.IsLocal)
testProtocols |= WebServiceProtocols.HttpPostLocalhost;
}
}
WebServiceProtocols testProtocols = WebServiceProtocols.HttpGet | WebServiceProtocols.HttpPost;
if (Context.Request.IsLocal)
testProtocols |= WebServiceProtocols.HttpPostLocalhost;
CurrentOperationSupportsTest = (WebServicesSection.Current.EnabledProtocols & testProtocols) != 0;
// Operation format
@@ -1516,8 +1521,9 @@ public class HtmlSampleGenerator: SampleGenerator
</script>
<head runat="server">
<link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
<%
Response.Write ("<link rel=\"alternate\" type=\"text/xml\" href=\"" + Request.FilePath + "?disco\"/>");
%>
<title><%=WebServiceName%> Web Service</title>
<style type="text/css">
BODY { font-family: Arial; margin-left: 20px; margin-top: 20px; font-size: x-small}
+32
View File
@@ -1,3 +1,35 @@
2009-04-22 Jeffrey Stedfast <[email protected]>
* src/gtimer-win32.c (g_timer_elapsed): Avoid re-querying freq by
just saving it in a static variable. Also modified microseconds
calculation to avoid overflow.
2009-04-05 Miguel de Icaza <[email protected]>
* src/gpath.c: Avoid situations where we add the separator if one
of the elements is the separator.
2009-04-02 Miguel de Icaza <[email protected]>
* src/gpath.c: If the first element is NULL, return an empty
string.
2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* src/gstr.c: use memset in g_strnfill.
2009-01-19 Bill Holmes <[email protected]>
* src/gstr.c (g_strnfill): Fixing a warning for MSVC.
Contributed under MIT/X11 license.
2009-02-05 Miguel de Icaza <[email protected]>
* src/gstr.c: Add g_strnfill
* src/glib.h: Add g_list_previous
2009-01-19 Bill Holmes <[email protected]>
* gmisc-win32.c (g_path_is_absolute): Adding support for UNC
+30 -6
View File
@@ -2,7 +2,7 @@ AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(eglib,0.2)
AM_INIT_AUTOMAKE(eglib,0.3)
AM_MAINTAINER_MODE
AC_PROG_CC
@@ -55,7 +55,7 @@ AM_CONDITIONAL(PLATFORM_WIN32, test x$OS = xWIN32)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r)
AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r rewinddir)
AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
@@ -84,10 +84,34 @@ else
G_GUINT64_FORMAT='"llu"'
fi
PKG_CHECK_MODULES(GLIB, glib-2.0,
[AM_CONDITIONAL(HAVE_GLIB, test x = x)],
[AM_CONDITIONAL(HAVE_GLIB, test x = y)]
)
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
pkg_config_path=
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
if test x$with_crosspkgdir = "x"; then
if test -s $PKG_CONFIG_PATH; then
pkg_config_path=$PKG_CONFIG_PATH
fi
else
pkg_config_path=$with_crosspkgdir
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
)
dnl
dnl No, you can not replace the call below with a pkg.m4 macro
dnl
if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
have_glib=true;
else
have_glib=false;
fi
AM_CONDITIONAL(HAVE_GLIB, $have_glib)
AC_SUBST(GPOINTER_TO_INT)
AC_SUBST(GPOINTER_TO_UINT)
AC_SUBST(GINT_TO_POINTER)
+1
View File
@@ -39,6 +39,7 @@ libeglib_la_SOURCES = \
gmarkup.c \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files)
libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
+14
View File
@@ -36,6 +36,9 @@
struct _GDir {
DIR *dir;
#ifndef HAVE_REWINDDIR
char *path;
#endif
};
GDir *
@@ -57,6 +60,9 @@ g_dir_open (const gchar *path, guint flags, GError **error)
g_free (dir);
return NULL;
}
#ifndef HAVE_REWINDDIR
dir->path = g_strdup (path);
#endif
return dir;
}
@@ -79,7 +85,12 @@ void
g_dir_rewind (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != NULL);
#ifndef HAVE_REWINDDIR
closedir (dir->dir);
dir->dir = opendir (dir->path);
#else
rewinddir (dir->dir);
#endif
}
void
@@ -87,6 +98,9 @@ g_dir_close (GDir *dir)
{
g_return_if_fail (dir != NULL && dir->dir != 0);
closedir (dir->dir);
#ifndef HAVE_REWINDDIR
g_free (dir->path);
#endif
dir->dir = NULL;
g_free (dir);
}
+4
View File
@@ -234,6 +234,7 @@ gchar *g_strjoinv (const gchar *separator, gchar **str_array);
gchar *g_strchug (gchar *str);
gchar *g_strchomp (gchar *str);
void g_strdown (gchar *string);
gchar *g_strnfill (gsize length, gchar fill_char);
gchar *g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter);
gchar *g_strescape (const gchar *source, const gchar *exceptions);
@@ -366,6 +367,7 @@ struct _GList {
};
#define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL)
#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL)
GList *g_list_alloc (void);
GList *g_list_append (GList *list,
@@ -839,6 +841,8 @@ glong g_utf8_strlen (const gchar *str, gssize max);
#define G_TRYLOCK(name)
#define G_UNLOCK(name)
#define GUINT16_SWAP_LE_BE_CONSTANT(x) ((((guint16) x) >> 8) | ((((guint16) x) << 8)))
#define GUINT16_SWAP_LE_BE(x) ((guint16) (((guint16) x) >> 8) | ((((guint16)(x)) & 0xff) << 8))
#define GUINT32_SWAP_LE_BE(x) ((guint32) \
( (((guint32) (x)) << 24)| \
+5 -2
View File
@@ -47,7 +47,9 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
va_list args;
g_return_val_if_fail (separator != NULL, NULL);
g_return_val_if_fail (first_element != NULL, NULL);
if (first_element == NULL)
return g_strdup ("");
result = g_string_sized_new (48);
@@ -66,7 +68,8 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
g_string_append_len (result, s, p - s);
if (next && *next){
g_string_append (result, separator);
if (strncmp (separator, result->str + strlen (result->str) - slen, slen))
g_string_append (result, separator);
for (; strncmp (next, separator, slen) == 0; )
next += slen;
+8 -2
View File
@@ -826,6 +826,12 @@ g_ascii_xdigit_value (gchar c)
(c - 'A' + 10))));
}
gchar *
g_strnfill (gsize length, gchar fill_char)
{
gchar *ret = g_new (gchar, length + 1);
memset (ret, fill_char, length);
ret [length] = 0;
return ret;
}
+13 -9
View File
@@ -68,9 +68,14 @@ g_timer_stop (GTimer *timer)
gdouble
g_timer_elapsed (GTimer *timer, gulong *microseconds)
{
guint64 stop;
guint64 freq;
gdouble seconds;
static guint64 freq = 0;
guint64 delta, stop;
if (freq == 0) {
if (!QueryPerformanceFrequency ((LARGE_INTEGER *)&freq))
freq = 1;
}
if (timer->stop == 0) {
QueryPerformanceCounter ((LARGE_INTEGER*)&stop);
}
@@ -78,13 +83,12 @@ g_timer_elapsed (GTimer *timer, gulong *microseconds)
stop = timer->stop;
}
QueryPerformanceFrequency ((LARGE_INTEGER*)&freq);
seconds = 1.0 * (stop - timer->start) / freq;
delta = stop - timer->start;
if (microseconds) {
*microseconds = (gulong)(1000000.0 * (stop - timer->start) / freq);
}
return seconds;
if (microseconds)
*microseconds = (gulong) (delta * (1000000.0 / freq));
return (gdouble) delta / (gdouble) freq;
}
+23 -2
View File
@@ -92,7 +92,14 @@ test_buildpath ()
if (strcmp (s, "/a/c/") != 0)
return FAILED ("14 Got wrong result, got: %s", s);
g_free (s);
/* Null */
s = g_build_path ("/", NULL);
if (s == NULL)
return FAILED ("must get a non-NULL return");
if (s [0] != 0)
return FAILED ("must get an empty string");
g_free (s);
return OK;
}
@@ -109,6 +116,20 @@ test_buildfname ()
#endif
return FAILED ("1 Got wrong result, got: %s", s);
g_free (s);
s = g_build_filename ("/", "a", NULL);
#ifdef G_OS_WIN32
if (strcmp (s, "\\a") != 0)
#else
if (strcmp (s, "/a") != 0)
#endif
return FAILED ("1 Got wrong result, got: %s", s);
#ifndef OS_WIN32
s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL);
if (strcmp (s, "/foo/bar/tolo/meo/") != 0)
return FAILED ("1 Got wrong result, got: %s", s);
#endif
return OK;
}
@@ -284,8 +305,8 @@ test_misc ()
}
static Test path_tests [] = {
{"g_buildpath", test_buildpath},
{"g_build_filename", test_buildfname},
{"g_buildpath", test_buildpath},
{"g_path_get_dirname", test_dirname},
{"g_path_get_basename", test_basename},
{"g_find_program_in_path", test_ppath},
+3 -8
View File
@@ -184,14 +184,9 @@ gdouble
get_timestamp()
{
/* FIXME: We should use g_get_current_time here */
#ifdef G_OS_WIN32
long int l = GetTickCount();
return (gdouble)(l / 1000) + (1.e-6) * ((l % 1000) * 1000);
#else
struct timeval tp;
gettimeofday(&tp, NULL);
return (gdouble)tp.tv_sec + (1.e-6) * tp.tv_usec;
#endif
GTimeVal res;
g_get_current_time (&res);
return res.tv_sec + (1.e-6) * res.tv_usec;
}
/*
+9
View File
@@ -1,3 +1,12 @@
2009-04-28 Zoltan Varga <[email protected]>
* misc.c (GC_init): Avoid casting an lvalue. Fixes part of #498692.
2009-04-10 Zoltan Varga <[email protected]>
* include/private/gc_locks.h (GC_test_and_set): Merge a change from libgc
7.1's libatomic-ops to fix the ppc build with gcc 4.4.
2009-01-18 Zoltan Varga <[email protected]>
* include/private/gcconfig.h: Applied patch from Koushik Dutta
+3 -3
View File
@@ -160,15 +160,15 @@
int temp = 1; /* locked value */
__asm__ __volatile__(
"1:\tlwarx %0,0,%3\n" /* load and reserve */
"1:\tlwarx %0,0,%1\n" /* load and reserve */
"\tcmpwi %0, 0\n" /* if load is */
"\tbne 2f\n" /* non-zero, return already set */
"\tstwcx. %2,0,%1\n" /* else store conditional */
"\tbne- 1b\n" /* retry if lost reservation */
"\tsync\n" /* import barrier */
"2:\t\n" /* oldval is zero if we set */
: "=&r"(oldval), "=p"(addr)
: "r"(temp), "1"(addr)
: "=&r"(oldval)
: "r"(addr), "r"(temp)
: "cr0","memory");
return oldval;
}
+1 -1
View File
@@ -479,7 +479,7 @@ void GC_init()
BOOL (WINAPI *pfn) (LPCRITICAL_SECTION, DWORD) = NULL;
HMODULE hK32 = GetModuleHandle(_T("kernel32.dll"));
if (hK32)
(FARPROC) pfn = GetProcAddress(hK32,
pfn = GetProcAddress(hK32,
"InitializeCriticalSectionAndSpinCount");
if (pfn)
pfn(&GC_allocate_ml, 4000);
+4
View File
@@ -1,3 +1,7 @@
2009-04-09 Jonathan Pryor <[email protected]>
* mdoc-update.1: Document -L, -r options.
2008-12-31 Massimiliano Mantione <[email protected]>
* mono.1: Updated the profiler documentation, removing the "ts"
+14 -5
View File
@@ -29,11 +29,9 @@ as added types and members, while preserving existing documentation.
.Sp
In some limited circumstances, renames will be tracked, minimizing the
documentation burden when e.g. a parameter is renamed.
circumstances,
creates stubs and updates documentation in the \fBmdoc\fR(5)
documentation format from \fIASSEMBLIES\fR.
.PP
\fBmdoc update\fR does not rely on documentation found within source code.
\fBmdoc update\fR does not rely on documentation found within source code,
though it can import XML Documentation Comments via the \fB\-i\fR option.
.PP
See \fBmdoc\fR(1) and \fBmdoc\fR(5) for more information.
.SH OPTIONS
@@ -171,11 +169,22 @@ Import documentation found within \fIFILE\fR.
.Sp
\fIFILE\fR may contain either \fIcsc /doc\fR XML or \fIECMA-335\fR XML.
.TP
\fB\-o\fR, \fB\-\-out\fB=\fIDIRECTORY\fR
\fB\-L\fR, \fB\-\-lib\fR=\fIDIRECTORY\fR
Add \fIDIRECTORY\fR to the assembly search path, so that dependencies of
\fIASSEMBLIES\fR can be found without documenting those assemblies.
.TP
\fB\-o\fR, \fB\-\-out\fR=\fIDIRECTORY\fR
Place the generated stubs into \fIDIRECTORY\fR.
.Sp
When updating documentation, \fIDIRECTORY\fR is also the source directory.
.TP
\fB\-r\fR=\fIASSEMBLY\fR
\fIASSEMBLY\fR is a dependency for one of \fIASSEMBLIES\fR which should
\fInot\fR be documented but is required to process one of \fIASSEMBLIES\fR.
Add the directory containing \fIASSEMBLY\fR to the assembly search path.
.Sp
This option is equivalent to specifying \fB\-L\fR `\fIdirname\fR ASSEMBLY`.
.TP
\fB\-\-since\fR=\fIVERSION\fR
When \fIupdating\fR documentation for an assembly, if a type or member is
encountered which didn't exist in the previous version of the assembly a
+1 -1
View File
@@ -951,7 +951,7 @@ integrity of the runtime after sending this signal is not guaranteed
and the application might crash or terminate at any given point
afterwards.
.PP
The \fB--debug=casts\FR option can be used to get more detailed
The \fB--debug=casts\fR option can be used to get more detailed
information for Invalid Cast operations, it will provide information
about the types involved.
.PP
+8
View File
@@ -1,3 +1,11 @@
2009-02-24 Jonathan Pryor <[email protected]>
* docs/Makefile: Remove and don't install nunit-docs.source. As
Atsushi Enomoto said on 2008-11-26, Mono's NUnit is for internal use
only, and installing nunit-docs.source causes an warning message
during monodoc startup.
* docs/nunit-docs.source: Remove.
2008-12-10 Atsushi Enomoto <[email protected]>
* Makefile : remove sys.messaging from CENTUM_TESTS. It has never
@@ -1,3 +1,300 @@
2009-05-20 Dick Porter <[email protected]>
* XplatUICarbon.cs: Add more locking around MessageQueue
manipulations.
2009-05-08 Andrés G. Aragoneses <[email protected]>
* ToolStripItem.cs: Prevent NRE when our holder is a
ToolStripDropDownButton and we get Select()ed.
2009-05-08 Brad Taylor <[email protected]>
* DateTimePicker.cs: Add a UIA-specific property to ensure that if
is_checkbox_checked is changed, we won't break.
2009-05-08 Brad Taylor <[email protected]>
* DateTimePicker.cs: Wrap UIA specific code in NET_2_0 wrappers. Send
OnUIASelectionChanged when ShowCheckbox is true and the checkbox
recieves focus. Part of fix for #502029.
2009-05-06 Mike Gorse <[email protected]>
* FileDialog.cs: Add UIAFocusedItemChanged to PopupButtonPanel.
Add PerformClick and PerformDoubleClick to PopupButton.
Fixes #499851.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* ToolStripDropDown.cs: In OnVisibleChanged, if we have an OwnerItem,
fire OnDropDownOpened/OnDropDownClosed depending on the new
visibility. This also ensures that any direct access to this instance
will fire the mentioned events for the OwnerItem.
* ToolStripDropDownItem.cs: Remove the invocations to
OnDropDownOpened/OnDropDownClosed, since they are handled in
ToolStripDropDown, as well as updating the
OnDropDownHide/OnDropDownShow calls to be in the right order.
Fixes #496139.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: If Insert is pressed, change the internal
overwrite mode for our default value.
Fixes some bits of #477395.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: When setting Text use the very precise algorithm
that .net uses: iterate over every char of the new value, trying to
use every char, and use a normal call to MaskedTextProvider.Replace
call if RejectInputOnFirstFailure is true. Fire OnMaskInputRejected
in case of error in both cases, as well.
Fixes #477408.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: Handle OnKeyDown to properly process the Delete
key. Also create a new method to avoid code duplication between
OnKeyDown and OnKeyPress.
Fixes #477388.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: In OnKeyPress the IsOverwriteMode check is
actually inversed, so put it the right way. Also, don't automatically
look for the next editable item after adding a new one, but way for
the next insertion (this is what .net does) - this is not needed when
MaskedTextProvider.InsertAt is called however, since it already looks for the
next editable position.
Fixes the remaining bits of #477383.
2009-05-04 Carlos Alberto Cortez <[email protected]>
* MaskedTextBox.cs: In OnKeyPress handle backspace by calling
MaskedTextProvider.RemoveAt method. Also for setting the SelectionStart
property after the text was modified, adjust the testPosition value
depending on what method was called.
Fixes part of #477383.
2009-05-04 Andrés G. Aragoneses <[email protected]>
* TabControl.cs: call Focus() to emit GotFocus event at the
proper time when SelectionIndex changes. Fixes #499887.
2009-04-27 Andrés G. Aragoneses <[email protected]>
* ListView.cs: Make OnColumnClick +internal to be used by a11y.
2009-04-27 Brad Taylor <[email protected]>
* ToolStripButton.cs: Emit an internal event when CheckOnClick is
changed.
2009-02-24 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Invalidate the datagrid when the cell is selected
or deselected.
[Fixes bug #479124]
2009-02-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Make the ScrollBars property work properly.
2009-02-22 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix row removal in the data-bound scenario.
2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Use strict equality comparison in order to
prevent superfluous CellValueChanged events.
2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not reset the columns when the data list changes,
but only the rows. Fixes multiple bugs related to sorting, custom
column styles being reset and more.
2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: End or if end fails then cancel the current edit
operation before clearing the data source.
2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Data-bind only after the handle is created.
[Fixes bug #473680]
2009-02-05 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation:
- Use ArrayList.Insert instead of the Item property so that the item
is actually inserted and not an existing item replaced.
- Call DataGridView.OnRowsAddedInternal and drop internal from
OnRowsAdded for binary compitability. This also fixes several
redrawing issues.
[Fixes bug #472968]
2009-02-05 Andrés G. Aragoneses <[email protected]>
* ToolBarButton.cs: OnTextChanged added.
(Backport of r125802.) r: jpobst
2009-02-03 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Move row completion
code in the row collection code, so that the completion happens before
the CollectionChanged event, also better encapsulation.
[Fixes bug #471987]
2009-02-02 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: When editing is finished do not remove the editing
row, because it has already become a real one. Instead add a new one.
[Fixes bug #471754]
2009-02-02 Andrés G. Aragoneses <[email protected]>
* ToolBar.cs: Add new UIAPerformClick method to be called by
UIAutomationWinforms when someone calls Invoke() on the
ToolBarButtonProvider. (Backport of r125354.) r: jpobst
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Complete incomplete rows when they are added to
the grid.
[Fixes bug #471068]
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewColumnCollection.cs: Ensure that the
binding is cleared prior to setting it to null. Fixes a regression
causing exceptions when the DataSource is set to null and then set
again to a data source.
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewImageColumn.cs, DataGridViewCell.cs:
- Make Image/Bitmap cells work.
- Handle images with size greater than the cell.
- Default to MiddleCenter alignment for image cells.
[Fixes bug #471101]
2009-01-29 Carlos Alberto Cortez <[email protected]>
* XplatUIX11.cs: We should use utf8 handling clipboard transference
with other x11 applications, and use utf16 when handling clipboard
data in the class library. Update the related points as well.
Fixes #468683.
2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Format strings according to the supplied
CellStyle.Format.
[Fixes bug #470384]
2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Reset the hover cell if it gets moved due to row(s)
addition or removal. Fixes multiple crashes in OnMouseMove.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeNode.cs: NextVisibleNode and PrevVisibleNode properties don't
take into account the fact that OpenTreeNodeEnumerator needs to call
MoveNext/MovePrevious to actually put the passed node as the one
retrieved in Current. This way this property should work as really
expected in .net.
Fixes part of #467225.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When calculating the scrollbars, don't use
TreeNode.Bounds, since it still can have the values of the previous
-and now invalid- layout -which depends on TreeView.skipped_nodes, and
could not have been updated as well-, and use the actual number of
visible number of nodes to compute the height needed to contain all
the nodes. Also reset the value of vbar to 0 when disabled - this way
we make sure that, when re-enabled, it will update the visible area of
the treeview, even if the previous value before disabling it is the
same as now. Finally don't do anything for the vbar.ValueChanged
handler - for the case wheer we manually set the value but don't the
vbar is disabled already.
Fixes part of #467225.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: In CollapseAll, set vbar to the maximum value, instead
of trying to set as top node the highest parent of the previous
top node. Moving to the bottom of the TreeView after a call
to CollapseAll is exactly what .net does. This should avoid some
nasty issue when CollapseAll is called and we don't need the
vertical scroll bar.
2009-01-27 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix a NRE when setting the CurrentCell to null.
2009-01-27 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Fire Timer.Tick even if there is no MainForm for the
current context.
[Fixes bug #469239]
2009-01-26 Andreia Gaita <[email protected]>
* WebBrowser.cs: fix initial value of ScrollbarsEnabled, so they
won't be disabled by default.
Fixes #468690
2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not clear the rows if we are not databound.
2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not be too smart about selecting the first cell
when the first row is added as this is not what MS does. Fixes the
failing unit tests.
2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewCell.cs: Fix crashes when there is no
editing control.
2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix new row adding/editing in the non-databound
scenario.
2009-01-21 Neville Gao <[email protected]>
* ToolBar.cs: Backported r124045: Control enabled to support
accessibility. Added UIACollectionChangedEvent.
[Fixes Bug #455950]
2009-01-21 Mike Gorse <[email protected]>
* TrackBar.cs: Backported R124116: Make LargeIncrement/Decrement
internal so that UIA can use them.
Added UIAValueParamChangedEvent.
2009-01-21 Mario Carrion <[email protected]>
* Form.cs: Backported r124064: UIA Support: Internal events
added: UIAWindowStateChanged and UIATopMostChanged.
2009-01-21 Sandy Armstrong <[email protected]>
* MenuItem.cs: Add UIACheckChanged, UIARadioCheckChanged,
UIAEnabledChanged, and UIATextChanged events.
* Form.cs: Add UIAMenuChanged event.
* Menu.cs:
* MenuAPI.cs: Note which internal APIs are being used by UIA.
2009-01-19 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When handling mouse up event, check whether
@@ -215,6 +215,7 @@ namespace System.Windows.Forms {
selectionMode = DataGridViewSelectionMode.RowHeaderSelect;
showCellErrors = true;
showEditingIcon = true;
scrollBars = ScrollBars.Both;
userSetCursor = Cursor.Current;
virtualMode = false;
@@ -680,13 +681,12 @@ namespace System.Windows.Forms {
/// to the data cache, or the new cell is in a hidden
/// row.
/////////////////////////////////////////////////////
if (value.DataGridView != this)
throw new ArgumentException("The cell is not in this DataGridView.");
if (value != null)
MoveCurrentCell (value.OwningColumn.Index, value.OwningRow.Index, true, false, false, true);
else
if (value == null)
MoveCurrentCell (-1, -1, true, false, false, true);
else if (value.DataGridView != this)
throw new ArgumentException("The cell is not in this DataGridView.");
else
MoveCurrentCell (value.OwningColumn.Index, value.OwningRow.Index, true, false, false, true);
}
}
@@ -711,7 +711,8 @@ namespace System.Windows.Forms {
set {
if (dataMember != value) {
dataMember = value;
ReBind ();
if (IsHandleCreated)
ReBind ();
OnDataMemberChanged(EventArgs.Empty);
}
}
@@ -732,8 +733,10 @@ namespace System.Windows.Forms {
if (!(value == null || value is IList || value is IListSource || value is IBindingList || value is IBindingListView))
throw new NotSupportedException ("Type cannot be bound.");
ClearBinding ();
dataSource = value;
ReBind ();
if (IsHandleCreated)
ReBind ();
OnDataSourceChanged (EventArgs.Empty);
}
}
@@ -1166,6 +1169,8 @@ namespace System.Windows.Forms {
/// or canceled.
///////////////////////////////////////////////////////////
scrollBars = value;
PerformLayout ();
Invalidate ();
}
}
@@ -2295,7 +2300,8 @@ namespace System.Windows.Forms {
cell.PositionEditingControl (true, true, this.GetCellDisplayRectangle (cell.ColumnIndex, cell.RowIndex, false), bounds, style, false, false, (columns [cell.ColumnIndex].DisplayIndex == 0), (cell.RowIndex == 0));
// Show the editing control
EditingControlInternal.Visible = true;
if (EditingControlInternal != null)
EditingControlInternal.Visible = true;
IDataGridViewEditingControl dgvEditingControl = (IDataGridViewEditingControl) EditingControlInternal;
if (dgvEditingControl != null) {
@@ -2328,7 +2334,8 @@ namespace System.Windows.Forms {
DataManager.CancelCurrentEdit ();
new_row_editing = false;
PrepareEditingRow (true, false);
PrepareEditingRow (false, false);
MoveCurrentCell (currentCell.ColumnIndex, NewRowIndex, true, false, false, true);
OnUserDeletedRow (new DataGridViewRowEventArgs (EditingRow));
}
}
@@ -2427,7 +2434,9 @@ namespace System.Windows.Forms {
Focus ();
if (currentCell.RowIndex == NewRowIndex) {
new_row_editing = false;
PrepareEditingRow (false, false);
editing_row = null; // editing row becomes a real row
PrepareEditingRow (true, false); // add a new editing row
MoveCurrentCell (currentCell.ColumnIndex, NewRowIndex, true, false, false, true);
}
return true;
}
@@ -3662,7 +3671,6 @@ namespace System.Windows.Forms {
//
if (!is_autogenerating_columns && columns.Count == 1)
ReBind ();
foreach (DataGridViewRow row in Rows)
row.Cells.Add ((DataGridViewCell)e.Column.CellTemplate.Clone ());
}
@@ -3963,6 +3971,7 @@ namespace System.Windows.Forms {
protected override void OnHandleCreated (EventArgs e)
{
base.OnHandleCreated(e);
ReBind ();
if (CurrentCell == null && Rows.Count > 0 && Columns.Count > 0)
MoveCurrentCell (ColumnDisplayIndexToIndex (0), 0, true, false, false, false);
@@ -4609,23 +4618,25 @@ namespace System.Windows.Forms {
bool verticalVisible = false;
if (AutoSize) {
if (gridWidth > Size.Width || gridHeight > Size.Height) {
if (gridWidth > Size.Width || gridHeight > Size.Height)
Size = new Size(gridWidth, gridHeight);
}
}
else {
if (gridWidth > Size.Width) {
if (gridWidth > Size.Width)
horizontalVisible = true;
}
if (gridHeight > Size.Height) {
if (gridHeight > Size.Height)
verticalVisible = true;
}
if (horizontalScrollBar.Visible && (gridHeight + horizontalScrollBar.Height) > Size.Height) {
if (horizontalScrollBar.Visible && (gridHeight + horizontalScrollBar.Height) > Size.Height)
verticalVisible = true;
}
if (verticalScrollBar.Visible && (gridWidth + verticalScrollBar.Width) > Size.Width) {
if (verticalScrollBar.Visible && (gridWidth + verticalScrollBar.Width) > Size.Width)
horizontalVisible = true;
}
if (scrollBars != ScrollBars.Vertical && scrollBars != ScrollBars.Both)
verticalVisible = false;
if (scrollBars != ScrollBars.Horizontal && scrollBars != ScrollBars.Both)
horizontalVisible = false;
if (horizontalVisible) {
horizontalScrollBar.Minimum = 0;
horizontalScrollBar.Maximum = gridWidth;
@@ -4825,12 +4836,15 @@ namespace System.Windows.Forms {
internal void OnRowsAddedInternal (DataGridViewRowsAddedEventArgs e)
{
if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
hover_cell = null;
AutoResizeColumnsInternal ();
Invalidate ();
OnRowsAdded (e);
}
protected internal virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e)
protected virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e)
{
DataGridViewRowsAddedEventHandler eh = (DataGridViewRowsAddedEventHandler)(Events [RowsAddedEvent]);
if (eh != null) eh (this, e);
@@ -4851,14 +4865,18 @@ namespace System.Windows.Forms {
if (Rows.Count == 0) {
MoveCurrentCell (-1, -1, true, false, false, true);
hover_cell = null;
} else if (Columns.Count == 0) {
MoveCurrentCell (-1, -1, true, false, false, true);
hover_cell = null;
} else {
int nextRowIndex = e.RowIndex;
if (nextRowIndex >= Rows.Count)
nextRowIndex = Rows.Count - 1;
MoveCurrentCell (currentCell != null ? currentCell.ColumnIndex : 0, nextRowIndex,
true, false, false, true);
if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
hover_cell = null;
}
Invalidate ();
@@ -4920,15 +4938,17 @@ namespace System.Windows.Forms {
protected virtual void OnUserAddedRow (DataGridViewRowEventArgs e)
{
// Switch the current editing row with a real
int newRowIndex = NewRowIndex;
int currentColumnIndex = currentCell != null ? currentCell.ColumnIndex : 0;
new_row_editing = true;
PrepareEditingRow (false, false);
if (DataManager != null)
new_row_editing = true;
if (DataManager != null) {
// Switch the current editing row with a real one
if (editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
}
DataManager.AddNew (); // will raise OnListPositionChanged
else
MoveCurrentCell (currentColumnIndex, NewRowIndex, true, false, false, true);
}
e = new DataGridViewRowEventArgs (Rows[NewRowIndex]);
DataGridViewRowEventHandler eh = (DataGridViewRowEventHandler)(Events [UserAddedRowEvent]);
@@ -5018,7 +5038,7 @@ namespace System.Windows.Forms {
protected bool ProcessDeleteKey (Keys keyData)
{
if (!allowUserToDeleteRows || SelectedRows.Count == 0)
if (!AllowUserToDeleteRows || SelectedRows.Count == 0)
return false;
int index = Math.Max (selected_row - SelectedRows.Count + 1, 0);
@@ -5032,8 +5052,8 @@ namespace System.Windows.Forms {
if (hover_cell != null && hover_cell.OwningRow == row)
hover_cell = null;
if (DataSource != null && DataSource is DataSet)
(DataSource as DataSet).Tables[dataMember].Rows.RemoveAt (row.Index);
if (DataManager != null)
DataManager.RemoveAt (row.Index);
else
Rows.RemoveAt (row.Index);
}
@@ -5172,7 +5192,7 @@ namespace System.Windows.Forms {
if (cell != null) {
if (cell.KeyEntersEditMode (new KeyEventArgs ((Keys)m.WParam.ToInt32 ())))
BeginEdit (true);
if (EditingControl != null && (Msg)m.Msg == Msg.WM_KEYDOWN || (Msg)m.Msg == Msg.WM_CHAR)
if (EditingControl != null && ((Msg)m.Msg == Msg.WM_KEYDOWN || (Msg)m.Msg == Msg.WM_CHAR))
XplatUI.SendMessage (EditingControl.Handle, (Msg)m.Msg, m.WParam, m.LParam);
}
@@ -5412,10 +5432,12 @@ namespace System.Windows.Forms {
if (cell != currentCell) {
if (currentCell != null) {
if (currentCell.IsInEditMode && !EndEdit ())
return false;
else if (currentCell.RowIndex == NewRowIndex && new_row_editing)
CancelEdit ();
if (currentCell.IsInEditMode) {
if (!EndEdit ())
return false;
else if (currentCell.RowIndex == NewRowIndex && new_row_editing)
CancelEdit ();
}
OnCellLeave (new DataGridViewCellEventArgs(currentCell.ColumnIndex, currentCell.RowIndex));
OnRowLeave (new DataGridViewCellEventArgs (currentCell.ColumnIndex, currentCell.RowIndex));
}
@@ -5774,30 +5796,23 @@ namespace System.Windows.Forms {
return bounds;
}
internal void PrepareEditingRow (bool cell_changed, bool column_changed)
private void PrepareEditingRow (bool cell_changed, bool column_changed)
{
if (new_row_editing) {
if (editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
}
if (new_row_editing)
return;
}
bool show = false;
show = ColumnCount > 0 && AllowUserToAddRows;
if (!show && editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
if (!show) {
RemoveEditingRow ();
} else if (show) {
if (editing_row != null && (cell_changed || column_changed)) {
// The row changed, it's no longer an editing row.
// or
// The number of columns has changed, we need a new editing row.
Rows.RemoveInternal (editing_row);
editing_row = null;
RemoveEditingRow ();
}
if (editing_row == null) {
editing_row = RowTemplateFull;
@@ -5806,6 +5821,15 @@ namespace System.Windows.Forms {
}
}
internal void RemoveEditingRow ()
{
if (editing_row != null) {
if (Rows.Contains (editing_row))
Rows.RemoveInternal (editing_row);
editing_row = null;
}
}
internal DataGridViewRow EditingRow {
get { return editing_row; }
}
@@ -5850,20 +5874,38 @@ namespace System.Windows.Forms {
{
if (type == typeof (bool))
return new DataGridViewCheckBoxColumn ();
else if (typeof(Bitmap).IsAssignableFrom (type))
return new DataGridViewImageColumn ();
return new DataGridViewTextBoxColumn ();
}
private void ClearBinding ()
{
columns.ClearAutoGeneratedColumns ();
rows.Clear ();
PrepareEditingRow (false, true);
if (IsCurrentCellInEditMode && !EndEdit ())
CancelEdit ();
MoveCurrentCell (-1, -1, false, false, false, true);
if (DataManager != null) {
DataManager.ListChanged -= OnListChanged;
DataManager.PositionChanged -= OnListPositionChanged;
columns.ClearAutoGeneratedColumns ();
rows.Clear ();
RemoveEditingRow ();
}
}
private void ResetRows ()
{
rows.Clear ();
RemoveEditingRow ();
if (DataManager != null) {
foreach (object element in DataManager.List)
AddBoundRow (element);
}
PrepareEditingRow (false, true);
OnListPositionChanged (this, EventArgs.Empty);
}
private void DoBinding ()
{
@@ -5919,6 +5961,7 @@ namespace System.Windows.Forms {
MoveCurrentCell (0, 0, true, false, false, false);
}
PrepareEditingRow (false, true);
PerformLayout();
Invalidate ();
}
@@ -6043,7 +6086,7 @@ namespace System.Windows.Forms {
case ListChangedType.ItemChanged:
break;
default:
ReBind ();
ResetRows ();
break;
}
@@ -316,11 +316,11 @@ namespace System.Windows.Forms {
return false;
}
set {
bool changed = selected != value;
selected = value;
if (value != ((State & DataGridViewElementStates.Selected) != 0)) {
if (value != ((State & DataGridViewElementStates.Selected) != 0))
SetState(State ^ DataGridViewElementStates.Selected);
}
// If our row is selected, unselect it and select
// the first cell in it that isn't us
@@ -332,6 +332,9 @@ namespace System.Windows.Forms {
else if (OwningRow.Cells.Count > 1)
OwningRow.Cells[1].Selected = true;
}
if (changed && DataGridView != null && DataGridView.IsHandleCreated)
DataGridView.Invalidate ();
}
}
@@ -697,12 +700,14 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
public virtual void PositionEditingControl (bool setLocation, bool setSize, Rectangle cellBounds, Rectangle cellClip, DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow)
{
if (setLocation && setSize)
DataGridView.EditingControl.Bounds = cellBounds;
else if (setLocation)
DataGridView.EditingControl.Location = cellBounds.Location;
else if (setSize)
DataGridView.EditingControl.Size = cellBounds.Size;
if (DataGridView.EditingControl != null) {
if (setLocation && setSize)
DataGridView.EditingControl.Bounds = cellBounds;
else if (setLocation)
DataGridView.EditingControl.Location = cellBounds.Location;
else if (setSize)
DataGridView.EditingControl.Size = cellBounds.Size;
}
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -873,6 +878,11 @@ namespace System.Windows.Forms {
value = e.Value;
}
if (FormattedValueType == typeof(string) && value is IFormattable && !String.IsNullOrEmpty (cellStyle.Format))
return ((IFormattable) value).ToString (cellStyle.Format, cellStyle.FormatProvider);
if (value != null && FormattedValueType.IsAssignableFrom (value.GetType()))
return value;
if (formattedValueTypeConverter == null)
formattedValueTypeConverter = FormattedValueTypeConverter;
if (valueTypeConverter == null)
@@ -1293,7 +1303,7 @@ namespace System.Windows.Forms {
else
valuex = value;
if (oldValue != value) {
if (!Object.ReferenceEquals (oldValue, value) || !Object.Equals (oldValue, value)) {
RaiseCellValueChanged (new DataGridViewCellEventArgs (ColumnIndex, RowIndex));
// Set this dirty flag back to false
@@ -1397,13 +1407,13 @@ namespace System.Windows.Forms {
else if (align == DataGridViewContentAlignment.BottomCenter || align == DataGridViewContentAlignment.MiddleCenter || align == DataGridViewContentAlignment.TopCenter)
x = Math.Max (outer.X + ((outer.Width - inner.Width) / 2), outer.Left);
else if (align == DataGridViewContentAlignment.BottomRight || align == DataGridViewContentAlignment.MiddleRight || align == DataGridViewContentAlignment.TopRight)
x = outer.Right - inner.Width;
x = Math.Max (outer.Right - inner.Width, outer.X);
if (align == DataGridViewContentAlignment.TopCenter || align == DataGridViewContentAlignment.TopLeft || align == DataGridViewContentAlignment.TopRight)
y = outer.Y;
else if (align == DataGridViewContentAlignment.MiddleCenter || align == DataGridViewContentAlignment.MiddleLeft || align == DataGridViewContentAlignment.MiddleRight)
y = outer.Y + (outer.Height - inner.Height) / 2;
y = Math.Max (outer.Y + (outer.Height - inner.Height) / 2, outer.Y);
else if (align == DataGridViewContentAlignment.BottomCenter || align == DataGridViewContentAlignment.BottomRight || align == DataGridViewContentAlignment.BottomLeft)
y = outer.Bottom - inner.Height;
y = Math.Max (outer.Bottom - inner.Height, outer.Y);
return new Rectangle (x, y, Math.Min (inner.Width, outer.Width), Math.Min (inner.Height, outer.Height));
}
@@ -105,7 +105,7 @@ namespace System.Windows.Forms
// When we clear the column collection, all rows get deleted
dataGridView.Rows.Clear ();
dataGridView.PrepareEditingRow (false, true);
dataGridView.RemoveEditingRow ();
RegenerateSortedList ();
}
@@ -47,6 +47,7 @@ namespace System.Windows.Forms {
this.valuesAreIcons = valuesAreIcons;
base.CellTemplate = new DataGridViewImageCell(valuesAreIcons);
(base.CellTemplate as DataGridViewImageCell).ImageLayout = DataGridViewImageCellLayout.Normal;
DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
icon = null;
image = null;
}
@@ -135,7 +135,7 @@ namespace System.Windows.Forms
dataGridViewRow.SetIndex (result);
}
dataGridViewRow.SetDataGridView (dataGridView);
CompleteRowCells (dataGridViewRow);
for (int i = 0; i < dataGridViewRow.Cells.Count; i++) {
dataGridViewRow.Cells [i].SetOwningColumn (dataGridView.Columns [i]);
}
@@ -147,6 +147,18 @@ namespace System.Windows.Forms
return result;
}
// Complete the rows if they are incomplete.
private void CompleteRowCells (DataGridViewRow row)
{
if (row == null || DataGridView == null)
return;
if (row.Cells.Count < DataGridView.ColumnCount) {
for (int i = row.Cells.Count; i < DataGridView.ColumnCount; i++)
row.Cells.Add ((DataGridViewCell) DataGridView.Columns[i].CellTemplate.Clone ());
}
}
public virtual int Add (DataGridViewRow dataGridViewRow)
{
if (dataGridView.DataSource != null)
@@ -186,7 +198,7 @@ namespace System.Windows.Forms
int result = 0;
for (int i = 0; i < count; i++)
result = Add (dataGridView.RowTemplateFull as DataGridViewRow);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (result - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (result - count + 1, count));
raiseEvent = true;
return result;
}
@@ -211,7 +223,7 @@ namespace System.Windows.Forms
int lastIndex = 0;
for (int i = 0; i < count; i++)
lastIndex = AddCopy(indexSource);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
raiseEvent = true;
return lastIndex;
}
@@ -234,7 +246,7 @@ namespace System.Windows.Forms
lastIndex = Add (row);
count++;
}
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
raiseEvent = true;
}
@@ -391,10 +403,12 @@ namespace System.Windows.Forms
{
dataGridViewRow.SetIndex (rowIndex);
dataGridViewRow.SetDataGridView (dataGridView);
list[rowIndex] = dataGridViewRow;
CompleteRowCells (dataGridViewRow);
list.Insert (rowIndex, dataGridViewRow);
ReIndex ();
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRow));
if (raiseEvent)
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, 1));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, 1));
}
public virtual void Insert (int rowIndex, int count)
@@ -403,7 +417,7 @@ namespace System.Windows.Forms
raiseEvent = false;
for (int i = 0; i < count; i++)
Insert (index++, dataGridView.RowTemplateFull);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count));
raiseEvent = true;
}
@@ -424,7 +438,7 @@ namespace System.Windows.Forms
int index = indexDestination;
for (int i = 0; i < count; i++)
InsertCopy (indexSource, index++);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (indexDestination, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (indexDestination, count));
raiseEvent = true;
}
@@ -442,7 +456,7 @@ namespace System.Windows.Forms
Insert (index++, row);
count++;
}
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count));
raiseEvent = true;
}
@@ -318,8 +318,10 @@ namespace System.Windows.Forms {
for (int i = 0; i < part_data.Length; i++)
part_data [i].Selected = false;
Invalidate (date_area_rect);
#if NET_2_0
OnUIAChecked ();
OnUIASelectionChanged ();
#endif
}
}
}
@@ -433,7 +435,9 @@ namespace System.Windows.Forms {
// invalidate the value inside this control
this.Invalidate (date_area_rect);
}
#if NET_2_0
OnUIAMaximumChanged ();
#endif
}
}
get {
@@ -489,7 +493,9 @@ namespace System.Windows.Forms {
// invalidate the value inside this control
this.Invalidate (date_area_rect);
}
#if NET_2_0
OnUIAMinimumChanged ();
#endif
}
}
get {
@@ -547,7 +553,9 @@ namespace System.Windows.Forms {
show_check_box = value;
// invalidate the value inside this control
this.Invalidate (date_area_rect);
#if NET_2_0
OnUIAShowCheckBoxChanged ();
#endif
}
}
get {
@@ -563,7 +571,9 @@ namespace System.Windows.Forms {
show_up_down = value;
// need to invalidate the whole control
this.Invalidate ();
#if NET_2_0
OnUIAShowUpDownChanged ();
#endif
}
}
get {
@@ -1338,7 +1348,9 @@ namespace System.Windows.Forms {
}
Invalidate ();
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
internal void SelectNextPart()
@@ -1391,7 +1403,9 @@ namespace System.Windows.Forms {
}
}
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
internal void SelectPreviousPart()
@@ -1447,7 +1461,9 @@ namespace System.Windows.Forms {
}
}
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
// raised by key down events.
@@ -1668,6 +1684,9 @@ namespace System.Windows.Forms {
if (ShowCheckBox) {
is_checkbox_selected = true;
Invalidate (CheckBoxRect);
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
}
@@ -1681,12 +1700,17 @@ namespace System.Windows.Forms {
Rectangle invalidate_rect = Rectangle.Ceiling (part_data [selected_index].drawing_rectangle);
invalidate_rect.Inflate (2, 2);
Invalidate (invalidate_rect);
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
else if (is_checkbox_selected)
{
is_checkbox_selected = false;
Invalidate (CheckBoxRect);
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
}
@@ -1741,13 +1765,20 @@ namespace System.Windows.Forms {
{
is_checkbox_selected = true;
Checked = !Checked;
#if NET_2_0
OnUIASelectionChanged ();
#endif
return;
}
// Deselect the checkbox only if the pointer is not on it
// *and* the other parts are enabled (Checked as true)
if (Checked)
if (Checked) {
is_checkbox_selected = false;
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
if (ShowUpDown && drop_down_arrow_rect.Contains (e.X, e.Y))
{
@@ -1794,7 +1825,9 @@ namespace System.Windows.Forms {
}
if (invalidate_afterwards) {
Invalidate ();
#if NET_2_0
OnUIASelectionChanged ();
#endif
}
}
@@ -1988,9 +2021,13 @@ namespace System.Windows.Forms {
#endregion
#if NET_2_0
#region UIA Framework: Methods, Properties and Events
internal bool UIAIsCheckBoxSelected {
get { return is_checkbox_selected; }
}
static object UIAMinimumChangedEvent = new object ();
static object UIAMaximumChangedEvent = new object ();
static object UIASelectionChangedEvent = new object ();
@@ -2071,5 +2108,6 @@ namespace System.Windows.Forms {
}
#endregion
#endif
}
}
@@ -1546,7 +1546,7 @@ namespace System.Windows.Forms
if (panel.focusButton != null && panel.focusButton.ButtonState == PopupButtonState.Up) {
panel.focusButton.ButtonState = PopupButtonState.Normal;
panel.focusButton = null;
panel.SetFocusButton (null);
}
Invalidate ();
base.OnMouseEnter (e);
@@ -1648,7 +1648,7 @@ namespace System.Windows.Forms
SetStyle (ControlStyles.StandardClick, false);
}
void OnClickButton (object sender, EventArgs e)
{
if (lastPopupButton != null && lastPopupButton != sender as PopupButton)
@@ -1676,6 +1676,28 @@ namespace System.Windows.Forms
eh (this, EventArgs.Empty);
}
#if NET_2_0
static object UIAFocusedItemChangedEvent = new object ();
internal event EventHandler UIAFocusedItemChanged {
add { Events.AddHandler (UIAFocusedItemChangedEvent, value); }
remove { Events.RemoveHandler (UIAFocusedItemChangedEvent, value); }
}
internal void OnUIAFocusedItemChanged ()
{
EventHandler eh = (EventHandler) Events [UIAFocusedItemChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
internal PopupButton UIAFocusButton {
get {
return focusButton;
}
}
#endif
public string CurrentFolder {
set {
string currentPath = value;
@@ -1734,7 +1756,7 @@ namespace System.Windows.Forms
{
if (lastPopupButton != recentlyusedButton) {
recentlyusedButton.ButtonState = PopupButton.PopupButtonState.Up;
focusButton = recentlyusedButton;
SetFocusButton (recentlyusedButton);
}
currentFocusIndex = 0;
@@ -1792,7 +1814,7 @@ namespace System.Windows.Forms
focusButton.ButtonState = PopupButton.PopupButtonState.Normal;
if (newfocusButton.ButtonState != PopupButton.PopupButtonState.Down)
newfocusButton.ButtonState = PopupButton.PopupButtonState.Up;
focusButton = newfocusButton;
SetFocusButton (newfocusButton);
}
e.Handled = true;
@@ -1804,6 +1826,17 @@ namespace System.Windows.Forms
add { Events.AddHandler (PDirectoryChangedEvent, value); }
remove { Events.RemoveHandler (PDirectoryChangedEvent, value); }
}
internal void SetFocusButton (PopupButton button)
{
if (button == focusButton)
return;
focusButton = button;
#if NET_2_0
OnUIAFocusedItemChanged ();
#endif
}
}
#endregion
@@ -2758,6 +2791,19 @@ namespace System.Windows.Forms
}
}
#if NET_2_0
#region UIA Framework Members
internal void PerformClick ()
{
OnClick (EventArgs.Empty);
}
internal void PerformDoubleClick ()
{
OnDoubleClick (EventArgs.Empty);
}
#endregion
#endif
protected override void OnClick (EventArgs e)
{
if (!MultiSelect) {
@@ -999,6 +999,10 @@ namespace System.Windows.Forms {
}
} else
UpdateBounds ();
#if NET_2_0
// UIA Framework Event: Menu Changed
OnUIAMenuChanged (EventArgs.Empty);
#endif
}
}
}
@@ -1311,6 +1315,11 @@ namespace System.Windows.Forms {
topmost = value;
if (IsHandleCreated)
XplatUI.SetTopmost(window.Handle, value);
#if NET_2_0
// UIA Framework: Raises internal event
OnUIATopMostChanged ();
#endif
}
}
}
@@ -1366,6 +1375,12 @@ namespace System.Windows.Forms {
XplatUI.SetWindowState(Handle, value);
}
#if NET_2_0
// UIA Framework: Raises internal event
if (old_state != window_state)
OnUIAWindowStateChanged ();
#endif
}
}
@@ -3284,6 +3299,50 @@ namespace System.Windows.Forms {
eh (this, e);
}
#endif
#region UIA Framework Events
#if NET_2_0
static object UIAMenuChangedEvent = new object ();
static object UIATopMostChangedEvent = new object ();
static object UIAWindowStateChangedEvent = new object ();
internal event EventHandler UIAMenuChanged {
add { Events.AddHandler (UIAMenuChangedEvent, value); }
remove { Events.RemoveHandler (UIAMenuChangedEvent, value); }
}
internal event EventHandler UIATopMostChanged {
add { Events.AddHandler (UIATopMostChangedEvent, value); }
remove { Events.RemoveHandler (UIATopMostChangedEvent, value); }
}
internal event EventHandler UIAWindowStateChanged {
add { Events.AddHandler (UIAWindowStateChangedEvent, value); }
remove { Events.RemoveHandler (UIAWindowStateChangedEvent, value); }
}
internal void OnUIAMenuChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIAMenuChangedEvent];
if (eh != null)
eh (this, e);
}
internal void OnUIATopMostChanged ()
{
EventHandler eh = (EventHandler) Events [UIATopMostChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
internal void OnUIAWindowStateChanged ()
{
EventHandler eh = (EventHandler) Events [UIAWindowStateChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
#endif
#endregion // UIA Framework Events
#endregion // Events
}
}
@@ -3440,7 +3440,7 @@ namespace System.Windows.Forms
eh (this, e);
}
protected virtual void OnColumnClick (ColumnClickEventArgs e)
protected internal virtual void OnColumnClick (ColumnClickEventArgs e)
{
ColumnClickEventHandler eh = (ColumnClickEventHandler)(Events [ColumnClickEvent]);
if (eh != null)
@@ -226,7 +226,32 @@ namespace System.Windows.Forms
protected override void OnKeyDown (KeyEventArgs e)
{
base.OnKeyDown (e);
// Only handle Delete or Insert here
if (e.KeyCode == Keys.Insert && insert_key_mode == InsertKeyMode.Default) {
// switch the internal overwriting mode, not the public one
insert_key_overwriting = !insert_key_overwriting;
OnIsOverwriteModeChanged (EventArgs.Empty);
e.Handled = true;
return;
}
if (e.KeyCode != Keys.Delete || is_empty_mask) {
base.OnKeyDown (e);
return;
}
int testPosition, endSelection;
MaskedTextResultHint resultHint;
bool result;
// Use a slightly different approach than the one used for backspace
endSelection = SelectionLength == 0 ? SelectionStart : SelectionStart + SelectionLength - 1;
result = provider.RemoveAt (SelectionStart, endSelection, out testPosition, out resultHint);
PostprocessKeyboardInput (result, testPosition, testPosition, resultHint);
e.Handled = true;
}
protected override void OnKeyPress (KeyPressEventArgs e)
@@ -236,31 +261,43 @@ namespace System.Windows.Forms
return;
}
int testPosition;
int testPosition, editPosition;
MaskedTextResultHint resultHint;
bool result;
if (IsOverwriteMode) {
result = provider.InsertAt (e.KeyChar, SelectionStart, out testPosition, out resultHint);
} else {
result = provider.Replace (e.KeyChar, SelectionStart, SelectionStart, out testPosition, out resultHint);
}
if (!result) {
OnMaskInputRejected (new MaskInputRejectedEventArgs (testPosition, resultHint));
} else {
int iIndex = provider.FindEditPositionFrom (SelectionStart+1, true);
if (e.KeyChar == '\b') {
if (SelectionLength == 0)
result = provider.RemoveAt (SelectionStart - 1, SelectionStart - 1, out testPosition, out resultHint);
else
result = provider.RemoveAt (SelectionStart, SelectionStart + SelectionLength - 1, out testPosition, out resultHint);
if (iIndex != MaskedTextProvider.InvalidIndex) {
SelectionStart = iIndex;
} else {
editPosition = testPosition;
} else if (IsOverwriteMode) {
int start = provider.FindEditPositionFrom (SelectionStart, true);
result = provider.Replace (e.KeyChar, start, start, out testPosition, out resultHint);
editPosition = testPosition + 1;
} else {
result = provider.InsertAt (e.KeyChar, SelectionStart, out testPosition, out resultHint);
editPosition = testPosition + 1;
}
PostprocessKeyboardInput (result, editPosition, testPosition, resultHint);
e.Handled = true;
}
void PostprocessKeyboardInput (bool result, int newPosition, int testPosition, MaskedTextResultHint resultHint)
{
if (!result)
OnMaskInputRejected (new MaskInputRejectedEventArgs (testPosition, resultHint));
else {
if (newPosition != MaskedTextProvider.InvalidIndex)
SelectionStart = newPosition;
else
SelectionStart = provider.Length;
}
UpdateVisibleText ();
}
e.Handled = true;
}
protected override void OnKeyUp (KeyEventArgs e)
@@ -695,7 +732,8 @@ namespace System.Windows.Forms
base.Text = value;
setting_text = false;
} else {
InputText (value, true, true);
SelectionStart = 0;
InputText (value, true);
}
UpdateVisibleText ();
}
@@ -839,7 +877,7 @@ namespace System.Windows.Forms
setting_text = false;
}
private void InputText (string text, bool overwrite, bool clear)
private void InputText (string text, bool clear)
{
string input = text;
@@ -849,27 +887,24 @@ namespace System.Windows.Forms
int testPosition;
MaskedTextResultHint resultHint;
bool result = false;
bool result;
if (RejectInputOnFirstFailure) {
if (overwrite) {
provider.Replace (input, SelectionStart, SelectionStart + input.Length - 1, out testPosition, out resultHint);
} else {
provider.InsertAt (input, SelectionStart);
}
result = provider.Replace (input, SelectionStart, SelectionStart + input.Length - 1, out testPosition, out resultHint);
if (!result)
OnMaskInputRejected (new MaskInputRejectedEventArgs (testPosition, resultHint));
} else {
while (!result && input.Length > 0) {
if (overwrite) {
result = provider.Replace (input, SelectionStart, SelectionStart + input.Length - 1, out testPosition, out resultHint);
} else {
result = provider.InsertAt (input, SelectionStart, out testPosition, out resultHint);
}
if (result) {
break;
}
input = input.Substring (0, Math.Min(testPosition - SelectionStart - 1, input.Length - 1));
// Unfortunately we can't break if we reach the end of the mask, since
// .net iterates over _all_ the chars in the input
testPosition = SelectionStart;
for (int i = 0; i < input.Length; i++) {
char c = input [i];
result = provider.InsertAt (c, testPosition, out testPosition, out resultHint);
if (result)
testPosition++; // Move to the next free position
else
OnMaskInputRejected (new MaskInputRejectedEventArgs (testPosition, resultHint));
}
}
}
@@ -49,6 +49,7 @@ namespace System.Windows.Forms
internal IntPtr menu_handle = IntPtr.Zero;
internal Menu parent_menu = null;
System.Drawing.Rectangle rect;
// UIA Framework Note: Used to keep track of expanded menus
internal Control Wnd;
internal MenuTracker tracker;
@@ -134,6 +135,7 @@ namespace System.Windows.Forms
#region Private Properties
// UIA Framework Note: Used to obtain menu bounds
internal System.Drawing.Rectangle Rect {
get { return rect; }
}
@@ -331,6 +333,7 @@ namespace System.Windows.Forms
#endregion Public Methods
static object MenuChangedEvent = new object ();
// UIA Framework Note: Used to track changes in MenuItemCollection
internal event EventHandler MenuChanged {
add { Events.AddHandler (MenuChangedEvent, value); }
remove { Events.RemoveHandler (MenuChangedEvent, value); }
@@ -35,6 +35,7 @@ namespace System.Windows.Forms {
When writing this code the Wine project was of great help to
understand the logic behind some Win32 issues. Thanks to them. Jordi,
*/
// UIA Framework Note: This class used by UIA for its mouse action methods.
internal class MenuTracker {
internal bool active;
@@ -136,6 +137,7 @@ namespace System.Windows.Forms {
return item;
}
// UIA Framework Note: Used to expand/collapse MenuItems
public bool OnMouseDown (MouseEventArgs args)
{
MenuItem item = GetItemAtXY (args.X, args.Y);
@@ -167,6 +169,7 @@ namespace System.Windows.Forms {
return true;
}
// UIA Framework Note: Used to select MenuItems
public void OnMotion (MouseEventArgs args)
{
// Windows helpfully sends us MOUSEMOVE messages when any key is pressed.
@@ -214,6 +217,7 @@ namespace System.Windows.Forms {
}
}
// UIA Framework Note: Used to expand/collapse MenuItems
public void OnMouseUp (MouseEventArgs args)
{
/* mouse down dont comes from menu */
@@ -65,6 +65,7 @@ namespace System.Windows.Forms
private int menuheight;
private bool menubar;
private MenuMerge mergetype;
// UIA Framework Note: Used to obtain item bounds
internal Rectangle bounds;
public MenuItem (): base (null)
@@ -167,6 +168,66 @@ namespace System.Windows.Forms
add { Events.AddHandler (SelectEvent, value); }
remove { Events.RemoveHandler (SelectEvent, value); }
}
#region UIA Framework Events
#if NET_2_0
static object UIACheckedChangedEvent = new object ();
internal event EventHandler UIACheckedChanged {
add { Events.AddHandler (UIACheckedChangedEvent, value); }
remove { Events.RemoveHandler (UIACheckedChangedEvent, value); }
}
internal void OnUIACheckedChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIACheckedChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIARadioCheckChangedEvent = new object ();
internal event EventHandler UIARadioCheckChanged {
add { Events.AddHandler (UIARadioCheckChangedEvent, value); }
remove { Events.RemoveHandler (UIARadioCheckChangedEvent, value); }
}
internal void OnUIARadioCheckChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIARadioCheckChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIAEnabledChangedEvent = new object ();
internal event EventHandler UIAEnabledChanged {
add { Events.AddHandler (UIAEnabledChangedEvent, value); }
remove { Events.RemoveHandler (UIAEnabledChangedEvent, value); }
}
internal void OnUIAEnabledChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIAEnabledChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIATextChangedEvent = new object ();
internal event EventHandler UIATextChanged {
add { Events.AddHandler (UIATextChangedEvent, value); }
remove { Events.RemoveHandler (UIATextChangedEvent, value); }
}
internal void OnUIATextChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIATextChangedEvent];
if (eh != null)
eh (this, e);
}
#endif
#endregion
#endregion // Events
#region Public Properties
@@ -188,7 +249,16 @@ namespace System.Windows.Forms
[DefaultValue(false)]
public bool Checked {
get { return checked_; }
set { checked_ = value; }
set {
if (checked_ == value)
return;
checked_ = value;
#if NET_2_0
// UIA Framework Event: Checked Changed
OnUIACheckedChanged (EventArgs.Empty);
#endif
}
}
[DefaultValue(false)]
@@ -206,6 +276,10 @@ namespace System.Windows.Forms
return;
enabled = value;
#if NET_2_0
// UIA Framework Event: Enabled Changed
OnUIAEnabledChanged (EventArgs.Empty);
#endif
Invalidate ();
}
}
@@ -283,7 +357,16 @@ namespace System.Windows.Forms
[DefaultValue(false)]
public bool RadioCheck {
get { return radiocheck; }
set { radiocheck = value; }
set {
if (radiocheck == value)
return;
radiocheck = value;
#if NET_2_0
// UIA Framework Event: Checked Changed
OnUIARadioCheckChanged (EventArgs.Empty);
#endif
}
}
[DefaultValue(Shortcut.None)]
@@ -316,6 +399,10 @@ namespace System.Windows.Forms
separator = true;
else
separator = false;
#if NET_2_0
// UIA Framework Event: Text Changed
OnUIATextChanged (EventArgs.Empty);
#endif
ProcessMnemonic ();
Invalidate ();
@@ -295,6 +295,7 @@ namespace System.Windows.Forms {
return;
#endif
Focus ();
int old_index = selected_index;
int new_index = value;
@@ -524,6 +524,28 @@ namespace System.Windows.Forms
base.Dispose (disposing);
}
#if NET_2_0
internal void UIAPerformClick (ToolBarButton button)
{
ToolBarItem previous_item = current_item;
current_item = null;
foreach (ToolBarItem item in items)
if (item.Button == button) {
current_item = item;
break;
}
try {
if (current_item == null)
throw new ArgumentException ("button", "The button specified is not part of this toolbar");
OnButtonClick (new ToolBarButtonClickEventArgs (button));
} finally {
current_item = previous_item;
}
}
#endif
protected virtual void OnButtonClick (ToolBarButtonClickEventArgs e)
{
if (e.Button.Style == ToolBarButtonStyle.ToggleButton) {
@@ -1110,6 +1132,25 @@ namespace System.Windows.Forms
private bool redraw; // Flag if needs to redraw after add/remove operations
#endregion
#region UIA Framework Events
#if NET_2_0
static object UIACollectionChangedEvent = new object ();
internal event CollectionChangeEventHandler UIACollectionChanged {
add { owner.Events.AddHandler (UIACollectionChangedEvent, value); }
remove { owner.Events.RemoveHandler (UIACollectionChangedEvent, value); }
}
internal void OnUIACollectionChanged (CollectionChangeEventArgs e)
{
CollectionChangeEventHandler eh
= (CollectionChangeEventHandler) owner.Events [UIACollectionChangedEvent];
if (eh != null)
eh (owner, e);
}
#endif
#endregion
#region constructors
public ToolBarButtonCollection (ToolBar owner)
{
@@ -1132,9 +1173,20 @@ namespace System.Windows.Forms
public virtual ToolBarButton this [int index] {
get { return (ToolBarButton) list [index]; }
set {
#if NET_2_0
// UIA Framework Event: Button Removed
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
#endif
value.SetParent (owner);
list [index] = value;
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
#endif
}
}
@@ -1189,6 +1241,12 @@ namespace System.Windows.Forms
result = list.Add (button);
if (redraw)
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, result));
#endif
return result;
}
@@ -1209,6 +1267,11 @@ namespace System.Windows.Forms
{
list.Clear ();
owner.Redraw (false);
#if NET_2_0
// UIA Framework Event: Button Cleared
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
#endif
}
public bool Contains (ToolBarButton button)
@@ -1294,6 +1357,11 @@ namespace System.Windows.Forms
{
list.Insert (index, button);
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
#endif
}
public void Remove (ToolBarButton button)
@@ -1306,6 +1374,11 @@ namespace System.Windows.Forms
{
list.RemoveAt (index);
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Removed
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
#endif
}
#if NET_2_0
@@ -262,6 +262,11 @@ namespace System.Windows.Forms
return;
text = value;
#if NET_2_0
OnUIATextChanged (EventArgs.Empty);
#endif
if (Parent != null)
Parent.Redraw (true);
}
@@ -311,9 +316,25 @@ namespace System.Windows.Forms
if (Parent != null)
Parent.Invalidate (Rectangle);
}
#if NET_2_0
static object UIATextChangedEvent = new object ();
internal event EventHandler UIATextChanged {
add { Events.AddHandler (UIATextChangedEvent, value); }
remove { Events.RemoveHandler (UIATextChangedEvent, value); }
}
protected virtual void OnUIATextChanged (EventArgs e)
{
EventHandler eh = (EventHandler)(Events [UIATextChangedEvent]);
if (eh != null)
eh (this, e);
}
#endif
#endregion Internal Methods
#region methods
protected override void Dispose (bool disposing)
@@ -110,7 +110,12 @@ namespace System.Windows.Forms
[DefaultValue (false)]
public bool CheckOnClick {
get { return this.check_on_click; }
set { this.check_on_click = value; }
set {
if (this.check_on_click != value) {
this.check_on_click = value;
OnUIACheckOnClickChangedEvent (EventArgs.Empty);
}
}
}
[DefaultValue (CheckState.Unchecked)]
@@ -225,6 +230,23 @@ namespace System.Windows.Forms
remove { Events.RemoveHandler (CheckStateChangedEvent, value); }
}
#endregion
#region UIA Framework Events
static object UIACheckOnClickChangedEvent = new object ();
internal event EventHandler UIACheckOnClickChanged {
add { Events.AddHandler (UIACheckOnClickChangedEvent, value); }
remove { Events.RemoveHandler (UIACheckOnClickChangedEvent, value); }
}
internal void OnUIACheckOnClickChangedEvent (EventArgs args)
{
EventHandler eh
= (EventHandler) Events [UIACheckOnClickChangedEvent];
if (eh != null)
eh (this, args);
}
#endregion
}
}
#endif
@@ -647,6 +647,14 @@ namespace System.Windows.Forms
protected override void OnVisibleChanged (EventArgs e)
{
base.OnVisibleChanged (e);
if (owner_item != null && owner_item is ToolStripDropDownItem) {
ToolStripDropDownItem dropdown_owner = (ToolStripDropDownItem)owner_item;
if (Visible)
dropdown_owner.OnDropDownOpened (EventArgs.Empty);
else
dropdown_owner.OnDropDownClosed (EventArgs.Empty);
}
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -129,11 +129,11 @@ namespace System.Windows.Forms
if (this.drop_down == null || !this.DropDown.Visible)
return;
// OnDropDownHide is called before actually closing DropDown
this.OnDropDownHide (EventArgs.Empty);
this.DropDown.Close (ToolStripDropDownCloseReason.CloseCalled);
this.is_pressed = false;
this.Invalidate ();
this.OnDropDownHide (EventArgs.Empty);
this.OnDropDownClosed (EventArgs.Empty);
}
public void ShowDropDown ()
@@ -152,7 +152,6 @@ namespace System.Windows.Forms
this.Invalidate ();
this.DropDown.Show (this.DropDownLocation);
this.OnDropDownOpened (EventArgs.Empty);
}
#endregion
@@ -325,11 +324,11 @@ namespace System.Windows.Forms
if (this.drop_down == null || !this.DropDown.Visible)
return;
// OnDropDownHide is called before actually closing DropDown
this.OnDropDownHide (EventArgs.Empty);
this.DropDown.Close (reason);
this.is_pressed = false;
this.Invalidate ();
this.OnDropDownHide (EventArgs.Empty);
this.OnDropDownClosed (EventArgs.Empty);
}
private void DropDown_ItemAdded (object sender, ToolStripItemEventArgs e)
@@ -924,12 +924,14 @@ namespace System.Windows.Forms
{
if (!this.is_selected && this.CanSelect) {
this.is_selected = true;
if (this.Visible && this.Parent.Focused && this is ToolStripControlHost)
(this as ToolStripControlHost).Focus ();
if (this.Parent != null) {
if (this.Visible && this.Parent.Focused && this is ToolStripControlHost)
(this as ToolStripControlHost).Focus ();
this.Invalidate ();
this.Parent.NotifySelectedChanged (this);
this.Invalidate ();
this.Parent.NotifySelectedChanged (this);
}
OnUIASelectionChanged ();
}
}
@@ -205,6 +205,24 @@ namespace System.Windows.Forms
#endregion // Events
#region UIA FrameWork Events
#if NET_2_0
static object UIAValueParamChangedEvent = new object ();
internal event EventHandler UIAValueParamChanged {
add { Events.AddHandler (UIAValueParamChangedEvent, value); }
remove { Events.RemoveHandler (UIAValueParamChangedEvent, value); }
}
internal void OnUIAValueParamChanged ()
{
EventHandler eh = (EventHandler) Events [UIAValueParamChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
#endif
#endregion
public TrackBar ()
{
orientation = Orientation.Horizontal;
@@ -364,6 +382,10 @@ namespace System.Windows.Forms
#endif
largeChange = value;
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
@@ -379,6 +401,10 @@ namespace System.Windows.Forms
minimum = maximum;
Refresh ();
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -396,6 +422,10 @@ namespace System.Windows.Forms
maximum = minimum;
Refresh ();
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -461,6 +491,10 @@ namespace System.Windows.Forms
#endif
if (smallChange != value) {
smallChange = value;
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -673,14 +707,16 @@ namespace System.Windows.Forms
}
}
private void LargeIncrement ()
// Used by UIA implementation, so making internal
internal void LargeIncrement ()
{
UpdatePos (position + LargeChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
private void LargeDecrement ()
// Used by UIA implementation, so making internal
internal void LargeDecrement ()
{
UpdatePos (position - LargeChange, true);
Invalidate (thumb_area);
@@ -534,6 +534,8 @@ namespace System.Windows.Forms
public TreeNode NextVisibleNode {
get {
OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this);
o.MoveNext (); // move to the node itself
if (!o.MoveNext ())
return null;
TreeNode c = o.CurrentNode;
@@ -607,6 +609,8 @@ namespace System.Windows.Forms
public TreeNode PrevVisibleNode {
get {
OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this);
o.MovePrevious (); // move to the node itself
if (!o.MovePrevious ())
return null;
TreeNode c = o.CurrentNode;
@@ -806,19 +806,12 @@ namespace System.Windows.Forms {
public void CollapseAll ()
{
TreeNode walk = TopNode;
if (walk == null)
return;
while (walk.parent != root_node)
walk = walk.parent;
BeginUpdate ();
root_node.CollapseAll ();
EndUpdate ();
SetTop (walk);
if (IsHandleCreated && vbar.VisibleInternal)
vbar.Value = vbar.Maximum - VisibleCount + 1;
}
public TreeNode GetNodeAt (Point pt) {
@@ -1835,25 +1828,22 @@ namespace System.Windows.Forms {
bool vert = false;
bool horz = false;
int height = -1;
int height = 0;
int width = -1;
int item_height = ActualItemHeight;
if (scrollable) {
OpenTreeNodeEnumerator walk = new OpenTreeNodeEnumerator (root_node);
while (walk.MoveNext ()) {
int r = walk.CurrentNode.Bounds.Right;
int b = walk.CurrentNode.Bounds.Bottom;
if (r > width)
width = r;
if (b > height)
height = b;
height += item_height;
}
// Remove scroll adjustments
if (nodes.Count > 0)
height -= nodes [0].Bounds.Top;
height -= item_height; // root_node adjustment
width += hbar_offset;
if (height > ClientRectangle.Height) {
@@ -1899,6 +1889,7 @@ namespace System.Windows.Forms {
skipped_nodes = 0;
RecalculateVisibleOrder (root_node);
vbar.Visible = false;
vbar.Value = 0;
vbar_bounds_set = false;
}
@@ -1951,6 +1942,9 @@ namespace System.Windows.Forms {
private void SetVScrollPos (int pos, TreeNode new_top)
{
if (!vbar.VisibleInternal)
return;
if (pos < 0)
pos = 0;
@@ -48,7 +48,7 @@ namespace System.Windows.Forms
bool isWebBrowserContextMenuEnabled;
object objectForScripting;
bool webBrowserShortcutsEnabled;
bool scrollbarsEnabled;
bool scrollbarsEnabled = true;
WebBrowserReadyState readyState;
@@ -141,13 +141,15 @@ namespace System.Windows.Forms {
internal void FlushQueue () {
CheckTimers (DateTime.UtcNow);
while (MessageQueue.Count > 0) {
object queueobj = MessageQueue.Dequeue ();
if (queueobj is GCHandle) {
XplatUIDriverSupport.ExecuteClientMessage((GCHandle)queueobj);
} else {
MSG msg = (MSG)queueobj;
NativeWindow.WndProc (msg.hwnd, msg.message, msg.wParam, msg.lParam);
lock (queuelock) {
while (MessageQueue.Count > 0) {
object queueobj = MessageQueue.Dequeue ();
if (queueobj is GCHandle) {
XplatUIDriverSupport.ExecuteClientMessage((GCHandle)queueobj);
} else {
MSG msg = (MSG)queueobj;
NativeWindow.WndProc (msg.hwnd, msg.message, msg.wParam, msg.lParam);
}
}
}
}
@@ -420,7 +422,7 @@ namespace System.Windows.Forms {
msg.message = Msg.WM_MOUSEHOVER;
msg.wParam = GetMousewParam (0);
msg.lParam = (IntPtr)((ushort)Hover.X << 16 | (ushort)Hover.X);
MessageQueue.Enqueue (msg);
EnqueueMessage (msg);
}
}
#endregion
@@ -736,7 +738,7 @@ namespace System.Windows.Forms {
MSG msg = new MSG ();
msg.message = Msg.WM_PAINT;
msg.hwnd = hwnd.Handle;
MessageQueue.Enqueue (msg);
EnqueueMessage (msg);
hwnd.expose_pending = true;
}
} else {
@@ -749,7 +751,7 @@ namespace System.Windows.Forms {
msg.wParam = hrgn == IntPtr.Zero ? (IntPtr)1 : hrgn;
msg.refobject = rgn;
msg.hwnd = hwnd.Handle;
MessageQueue.Enqueue (msg);
EnqueueMessage (msg);
hwnd.nc_expose_pending = true;
}
@@ -1613,7 +1615,7 @@ namespace System.Windows.Forms {
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
MessageQueue.Enqueue (msg);
EnqueueMessage (msg);
return true;
}
@@ -1681,7 +1683,9 @@ namespace System.Windows.Forms {
[MonoTODO]
internal override void SendAsyncMethod (AsyncMethodData method) {
// Fake async
MessageQueue.Enqueue (GCHandle.Alloc (method));
lock (queuelock) {
MessageQueue.Enqueue (GCHandle.Alloc (method));
}
}
[MonoTODO]
@@ -205,7 +205,8 @@ namespace System.Windows.Forms {
private static IntPtr PRIMARY;
//private static IntPtr DIB;
private static IntPtr OEMTEXT;
private static IntPtr UNICODETEXT;
private static IntPtr UTF8_STRING;
private static IntPtr UTF16_STRING;
private static IntPtr RICHTEXTFORMAT;
private static IntPtr TARGETS;
@@ -619,6 +620,7 @@ namespace System.Windows.Forms {
"PRIMARY",
"COMPOUND_TEXT",
"UTF8_STRING",
"UTF16_STRING",
"RICHTEXTFORMAT",
"TARGETS",
"_SWF_AsyncAtom",
@@ -693,7 +695,8 @@ namespace System.Windows.Forms {
CLIPBOARD = atoms [off++];
PRIMARY = atoms [off++];
OEMTEXT = atoms [off++];
UNICODETEXT = atoms [off++];
UTF8_STRING = atoms [off++];
UTF16_STRING = atoms [off++];
RICHTEXTFORMAT = atoms [off++];
TARGETS = atoms [off++];
AsyncAtom = atoms [off++];
@@ -1248,7 +1251,12 @@ namespace System.Windows.Forms {
// FIXME - convert pixmap to image
} else if (property == OEMTEXT) {
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
} else if (property == UNICODETEXT) {
} else if (property == UTF8_STRING) {
byte [] buffer = new byte [(int)nitems];
for (int i = 0; i < (int)nitems; i++)
buffer [i] = Marshal.ReadByte (prop, i);
Clipboard.Item = Encoding.UTF8.GetString (buffer);
} else if (property == UTF16_STRING) {
Clipboard.Item = Marshal.PtrToStringUni (prop, Encoding.Unicode.GetMaxCharCount ((int)nitems));
} else if (property == RICHTEXTFORMAT)
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
@@ -1422,8 +1430,8 @@ namespace System.Windows.Forms {
//
if (in_doevents ||
(Application.MWFThread.Current.Context != null &&
Application.MWFThread.Current.Context.MainForm != null &&
Application.MWFThread.Current.Context.MainForm.IsLoaded)) {
(Application.MWFThread.Current.Context.MainForm == null ||
Application.MWFThread.Current.Context.MainForm.IsLoaded))) {
timer.Busy = true;
timer.Update (now);
timer.FireTick ();
@@ -1703,7 +1711,8 @@ namespace System.Windows.Forms {
if (Clipboard.Item is String) {
atoms[atom_count++] = (int)Atom.XA_STRING;
atoms[atom_count++] = (int)OEMTEXT;
atoms[atom_count++] = (int)UNICODETEXT;
atoms[atom_count++] = (int)UTF8_STRING;
atoms[atom_count++] = (int)UTF16_STRING;
atoms[atom_count++] = (int)RICHTEXTFORMAT;
} else if (Clipboard.Item is Image) {
atoms[atom_count++] = (int)Atom.XA_PIXMAP;
@@ -1737,7 +1746,7 @@ namespace System.Windows.Forms {
while (Marshal.ReadByte(buffer, buflen) != 0) {
buflen++;
}
} else if (xevent.SelectionRequestEvent.target == UNICODETEXT) {
} else if (xevent.SelectionRequestEvent.target == UTF16_STRING) {
Byte [] bytes;
bytes = Encoding.Unicode.GetBytes ((string)Clipboard.Source);
@@ -2612,7 +2621,7 @@ namespace System.Windows.Forms {
//else if (format == "PenData" ) return 10;
//else if (format == "RiffAudio" ) return 11;
//else if (format == "WaveAudio" ) return 12;
else if (format == "UnicodeText" ) return UNICODETEXT.ToInt32();
else if (format == "UnicodeText" ) return UTF16_STRING.ToInt32();
//else if (format == "EnhancedMetafile" ) return 14;
//else if (format == "FileDrop" ) return 15;
//else if (format == "Locale" ) return 16;
@@ -4565,7 +4574,7 @@ namespace System.Windows.Forms {
XGetWindowProperty(DisplayHandle, handle,
_NET_WM_NAME, IntPtr.Zero, new IntPtr (1), false,
UNICODETEXT, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
UTF8_STRING, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
if ((long)nitems > 0 && prop != IntPtr.Zero) {
text = Marshal.PtrToStringUni (prop, (int)nitems);
@@ -5627,13 +5636,15 @@ namespace System.Windows.Forms {
case FormWindowState.Maximized: SetWindowState(handle, FormWindowState.Maximized); break;
}
}
SendMessage(handle, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
}
else {
UnmapWindow(hwnd, WindowType.Both);
}
}
if (visible)
SendMessage(handle, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero);
return true;
}
@@ -6018,7 +6029,7 @@ namespace System.Windows.Forms {
hwnd = Hwnd.ObjectFromHandle(handle);
lock (XlibLock) {
XChangeProperty(DisplayHandle, hwnd.whole_window, _NET_WM_NAME, UNICODETEXT, 8,
XChangeProperty(DisplayHandle, hwnd.whole_window, _NET_WM_NAME, UTF8_STRING, 8,
PropertyMode.Replace, text, Encoding.UTF8.GetByteCount (text));
// XXX this has problems with UTF8.
@@ -1,3 +1,11 @@
2009-05-08 Andrés G. Aragoneses <[email protected]>
* ToolStripMenuItemTest.cs: Add a test for a NRE bug.
2009-05-04 Andrés G. Aragoneses <[email protected]>
* TabControlTest.cs: Added test for bug#499887.
2009-01-19 Carlos Alberto Cortez <[email protected]>
* ListBoxTest.cs: New test for RemoveAt and selection.
@@ -754,7 +754,40 @@ namespace MonoTests.System.Windows.Forms
Assert.AreEqual ("tc_OnEnter;p1_OnEnter;p1_OnLeave;tc_OnLeave;", events, "A2");
}
[Test] // bug #499887
public void SelectedIndexChangeFiresFocus ()
{
Form f = new Form ();
TabControl tc = new TabControl ();
TabPage p1 = new TabPage ();
TabPage p2 = new TabPage ();
string events = string.Empty;
tc.TabPages.Add (p1);
tc.TabPages.Add (p2);
tc.SelectedIndex = 0;
Button b1 = new Button ();
Button b2 = new Button ();
f.Controls.Add (b1);
f.Controls.Add (b2);
f.Controls.Add (tc);
f.Show ();
b1.Focus ();
b2.GotFocus += new EventHandler (delegate (Object obj, EventArgs e) {
tc.SelectedIndex = 1;
});
tc.GotFocus += new EventHandler(delegate (Object obj, EventArgs e) { events += ("tc_OnGotFocus" + tc.SelectedIndex + ";"); });
tc.SelectedIndexChanged += new EventHandler(delegate (Object obj, EventArgs e) { events += ("tc_OnSelectedIndexChanged" + tc.SelectedIndex + ";"); });
p2.Enter += new EventHandler(delegate (Object obj, EventArgs e) { events += ("p2_OnEnter" + tc.SelectedIndex + ";"); });
p2.Leave += new EventHandler (delegate (Object obj, EventArgs e) { events += ("p2_OnLeave;"); });
b2.Focus ();
Assert.AreEqual ("tc_OnGotFocus0;p2_OnEnter1;tc_OnSelectedIndexChanged1;", events, "A1");
Assert.IsTrue (tc.Focused, "A2");
}
#endif
}
@@ -162,6 +162,54 @@ namespace MonoTests.System.Windows.Forms
tsmi.ShortcutKeyDisplayString = null;
Assert.AreEqual (null, tsmi.ShortcutKeyDisplayString, "A5");
}
[Test]
public void ToolStripDropDownButton_SelectChild ()
{
ToolStripDropDownButton tsddb = new ToolStripDropDownButton ();
tsddb.DropDownClosed += Helper.FireEvent1;
tsddb.DropDownItemClicked += Helper.FireEvent2;
tsddb.DropDownOpened += Helper.FireEvent1;
tsddb.DropDownOpening += Helper.FireEvent1;
tsddb.Click += Helper.FireEvent1;
Helper item1 = new Helper ();
Helper item2 = new Helper ();
tsddb.DropDownItems.Add (item1);
tsddb.DropDownItems.Add (item2);
ToolStripDropDownButton_SelectChildVerify (item1);
ToolStrip ts = new ToolStrip ();
ts.Items.Add (tsddb);
ToolStripDropDownButton_SelectChildVerify (item2);
}
private static void ToolStripDropDownButton_SelectChildVerify (Helper item)
{
Assert.IsNull (item.MyParent);
Assert.IsTrue (item.CanSelect);
Assert.IsFalse (item.Selected);
item.Select ();
Assert.IsTrue (item.Selected);
Assert.IsFalse (Helper.eventFired);
}
private class Helper : ToolStripMenuItem
{
internal Helper () {
this.DropDownClosed += Helper.FireEvent1;
this.DropDownItemClicked += Helper.FireEvent2;
this.DropDownOpened += Helper.FireEvent1;
this.DropDownOpening += Helper.FireEvent1;
this.Click += Helper.FireEvent1;
}
internal ToolStrip MyParent { get { return this.Parent; } }
internal static bool eventFired = false;
internal static void FireEvent1 (object o, EventArgs args) { eventFired = true; }
internal static void FireEvent2 (object o, ToolStripItemClickedEventArgs args) { FireEvent1 (null, null); }
}
private class ExposeProtectedMethods : ToolStripMenuItem
{
@@ -1,3 +1,17 @@
2009-02-21 Ankit Jain <[email protected]>
* Import.cs (GetFullPath): Use Utilities.FromMSBuildPath .
2009-02-19 Jonathan Chambers <[email protected]>
* Microsoft.Build.Engine.csproj: Add.
* Microsoft.Build.Engine.Test.csproj: Update.
2009-01-31 Ankit Jain <[email protected]>
* Microsoft.Build.Engine_test.dll.sources: Replace BatchingImpl.cs with
BatchingImplBase.cs, TargetBatchingImpl.cs and TaskBatchingImpl.cs
2009-01-06 Ankit Jain <[email protected]>
* Microsoft.Build.Engine_test.dll.sources: Add TestMessageLogger from
@@ -0,0 +1,238 @@
//
// BatchingImplBase.cs: Base class that implements BatchingAlgorithm from the wiki.
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (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
@@ -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 ()
@@ -59,7 +59,8 @@ namespace Microsoft.Build.BuildEngine {
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)
@@ -68,7 +69,7 @@ namespace Microsoft.Build.BuildEngine {
(string) de.Key, (string) de.Value,
PropertyType.Global));
return engine.BuildProjectFile (projectFileName,
targetNames, bpg, targetOutputs);
targetNames, bpg, targetOutputs, BuildSettings.DoNotResetPreviouslyBuiltTargets);
}
}
@@ -41,7 +41,7 @@ using Mono.XBuild.Utilities;
namespace Microsoft.Build.BuildEngine {
public class BuildItem {
BuildItemGroup child_items;
List<BuildItem> child_items;
XmlElement itemElement;
string finalItemSpec;
bool isImported;
@@ -82,10 +82,10 @@ namespace Microsoft.Build.BuildEngine {
unevaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
evaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
}
internal BuildItem (XmlElement itemElement, BuildItemGroup parentItemGroup)
{
child_items = new BuildItemGroup ();
child_items = new List<BuildItem> ();
isImported = parentItemGroup.IsImported;
unevaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
evaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
@@ -102,7 +102,7 @@ namespace Microsoft.Build.BuildEngine {
isImported = parent.isImported;
name = parent.Name;
parent_item = parent;
parent_item.child_items.AddItem (this);
parent_item.child_items.Add (this);
parent_item_group = parent.parent_item_group;
unevaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable (parent.unevaluatedMetadata);
evaluatedMetadata = CollectionsUtil.CreateCaseInsensitiveHashtable (parent.evaluatedMetadata);
@@ -169,7 +169,7 @@ namespace Microsoft.Build.BuildEngine {
XmlNode node = itemElement [metadataName];
itemElement.RemoveChild (node);
}
} else if (HasParent) {
} else if (HasParentItem) {
if (parent_item.child_items.Count > 1)
SplitParentItem ();
parent_item.RemoveMetadata (metadataName);
@@ -198,7 +198,7 @@ namespace Microsoft.Build.BuildEngine {
throw new ArgumentException (String.Format ("\"{0}\" is a reserved item meta-data, and cannot be modified or deleted.",
metadataName));
if (treatMetadataValueAsLiteral && !HasParent)
if (treatMetadataValueAsLiteral && !HasParentItem)
metadataValue = Utilities.Escape (metadataValue);
if (FromXml) {
@@ -209,12 +209,12 @@ namespace Microsoft.Build.BuildEngine {
itemElement.AppendChild (element);
} else
element.InnerText = metadataValue;
} else if (HasParent) {
} else if (HasParentItem) {
if (parent_item.child_items.Count > 1)
SplitParentItem ();
parent_item.SetMetadata (metadataName, metadataValue, treatMetadataValueAsLiteral);
}
if (FromXml || HasParent) {
if (FromXml || HasParentItem) {
parent_item_group.ParentProject.MarkProjectAsDirty ();
parent_item_group.ParentProject.NeedToReevaluate ();
}
@@ -228,11 +228,11 @@ namespace Microsoft.Build.BuildEngine {
if (parent_item_group != null) {
Expression e = new Expression ();
e.Parse (value, true);
evaluatedMetadata.Add (name, (string) e.ConvertTo (parent_item_group.ParentProject, typeof (string)));
evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject, typeof (string));
} else
evaluatedMetadata.Add (name, Utilities.Unescape (value));
evaluatedMetadata [name] = Utilities.Unescape (value);
unevaluatedMetadata.Add (name, value);
unevaluatedMetadata [name] = value;
}
void DeleteMetadata (string name)
@@ -252,8 +252,11 @@ namespace Microsoft.Build.BuildEngine {
return;
}
foreach (XmlElement xe in itemElement.ChildNodes)
AddMetadata (xe.Name, xe.InnerText);
foreach (XmlNode xn in itemElement.ChildNodes) {
XmlElement xe = xn as XmlElement;
if (xe != null && ConditionParser.ParseAndEvaluate (xe.GetAttribute ("Condition"), project))
AddMetadata (xe.Name, xe.InnerText);
}
DirectoryScanner directoryScanner;
Expression includeExpr, excludeExpr;
@@ -291,6 +294,8 @@ namespace Microsoft.Build.BuildEngine {
BuildItem bi = new BuildItem (this);
bi.finalItemSpec = itemSpec;
project.EvaluatedItemsIgnoringCondition.AddItem (bi);
if (evaluatedTo) {
project.EvaluatedItems.AddItem (bi);
@@ -330,7 +335,7 @@ namespace Microsoft.Build.BuildEngine {
{
if (FromXml)
itemElement.ParentNode.RemoveChild (itemElement);
else if (HasParent) {
else if (HasParentItem) {
if (parent_item.child_items.Count > 1)
SplitParentItem ();
parent_item.Detach ();
@@ -383,12 +388,12 @@ namespace Microsoft.Build.BuildEngine {
newElement.SetAttribute ("Include", child.FinalItemSpec);
if (parent.itemElement.HasAttribute ("Condition"))
newElement.SetAttribute ("Condition", parent.itemElement.GetAttribute ("Condition"));
foreach (XmlElement xe in parent.itemElement)
newElement.AppendChild (xe.Clone ());
foreach (XmlNode xn in parent.itemElement)
newElement.AppendChild (xn.Clone ());
parent.itemElement.ParentNode.InsertAfter (newElement, insertAfter);
newParent = new BuildItem (newElement, parent.parent_item_group);
newParent.child_items.AddItem (child);
newParent.child_items.Add (child);
child.parent_item = newParent;
return newParent;
@@ -404,7 +409,7 @@ namespace Microsoft.Build.BuildEngine {
set {
if (FromXml)
itemElement.SetAttribute ("Condition", value);
else if (!HasParent)
else if (!HasParentItem)
throw new InvalidOperationException ("Cannot set a condition on an object not represented by an XML element in the project file.");
}
}
@@ -432,7 +437,7 @@ namespace Microsoft.Build.BuildEngine {
get {
if (FromXml)
return itemElement.GetAttribute ("Include");
else if (HasParent)
else if (HasParentItem)
return parent_item.Include;
else
return itemInclude;
@@ -440,7 +445,7 @@ namespace Microsoft.Build.BuildEngine {
set {
if (FromXml)
itemElement.SetAttribute ("Include", value);
else if (HasParent) {
else if (HasParentItem) {
if (parent_item.child_items.Count > 1)
SplitParentItem ();
parent_item.Include = value;
@@ -457,7 +462,7 @@ namespace Microsoft.Build.BuildEngine {
get {
if (FromXml)
return itemElement.Name;
else if (HasParent)
else if (HasParentItem)
return parent_item.Name;
else
return name;
@@ -467,11 +472,11 @@ namespace Microsoft.Build.BuildEngine {
XmlElement newElement = itemElement.OwnerDocument.CreateElement (value, Project.XmlNamespace);
newElement.SetAttribute ("Include", itemElement.GetAttribute ("Include"));
newElement.SetAttribute ("Condition", itemElement.GetAttribute ("Condition"));
foreach (XmlElement xe in itemElement)
newElement.AppendChild (xe.Clone ());
foreach (XmlNode xn in itemElement)
newElement.AppendChild (xn.Clone ());
itemElement.ParentNode.ReplaceChild (newElement, itemElement);
itemElement = newElement;
} else if (HasParent) {
} else if (HasParentItem) {
if (parent_item.child_items.Count > 1)
SplitParentItem ();
parent_item.Name = value;
@@ -484,7 +489,7 @@ namespace Microsoft.Build.BuildEngine {
get { return itemElement != null; }
}
internal bool HasParent {
internal bool HasParentItem {
get { return parent_item != null; }
}
@@ -494,6 +499,7 @@ namespace Microsoft.Build.BuildEngine {
internal BuildItemGroup ParentItemGroup {
get { return parent_item_group; }
set { parent_item_group = value; }
}
}
}
@@ -49,7 +49,12 @@ namespace Microsoft.Build.BuildEngine {
: this (null, null, null, false)
{
}
internal BuildItemGroup (Project project)
: this (null, project, null, false)
{
}
internal BuildItemGroup (XmlElement xmlElement, Project project, ImportedProject importedProject, bool readOnly)
{
this.buildItems = new List <BuildItem> ();
@@ -95,6 +100,7 @@ namespace Microsoft.Build.BuildEngine {
item = new BuildItem (element, this);
} else {
item = new BuildItem (itemName, itemInclude);
item.ParentItemGroup = this;
}
item.Evaluate (null, true);
@@ -175,6 +181,7 @@ namespace Microsoft.Build.BuildEngine {
{
BuildItem buildItem;
buildItem = new BuildItem (name, taskItem);
buildItem.ParentItemGroup = this;
buildItems.Add (buildItem);
}
@@ -269,6 +276,11 @@ namespace Microsoft.Build.BuildEngine {
internal Project ParentProject {
get { return parentProject; }
set {
if (parentProject != null)
throw new InvalidOperationException ("parentProject is already set");
parentProject = value;
}
}
internal bool FromXml {
@@ -74,7 +74,7 @@ namespace Microsoft.Build.BuildEngine {
this.propertyType = PropertyType.Normal;
this.parentProject = parentProject;
this.name = propertyElement.Name;
this.value = propertyElement.InnerText;
this.value = propertyElement.InnerXml;
this.isImported = false;
}
@@ -166,7 +166,7 @@ namespace Microsoft.Build.BuildEngine {
set {
this.@value = value;
if (FromXml) {
propertyElement.InnerText = value;
propertyElement.InnerXml = value;
} else {
finalValue = value;
}
@@ -129,7 +129,24 @@ namespace Microsoft.Build.BuildEngine {
[MonoTODO]
public BuildPropertyGroup Clone (bool deepClone)
{
throw new NotImplementedException ();
BuildPropertyGroup bpg = new BuildPropertyGroup (propertyGroup, parentProject, importedProject, read_only);
if (FromXml) {
foreach (BuildProperty bp in properties) {
if (deepClone)
bpg.AddProperty (bp.Clone (true));
else
bpg.AddNewProperty (bp.Name, bp.FinalValue);
}
} else {
foreach (BuildProperty bp in propertiesByName.Values) {
if (deepClone)
bpg.AddProperty (bp.Clone (true));
else
bpg.AddNewProperty (bp.Name, bp.FinalValue);
}
}
return bpg;
}
public IEnumerator GetEnumerator ()
@@ -33,23 +33,21 @@ using System.Xml;
namespace Microsoft.Build.BuildEngine {
internal class BuildWhen {
//Project parentProject;
Project parentProject;
GroupingCollection groupingCollection;
XmlElement whenElement;
public BuildWhen (XmlElement whenElement, Project parentProject)
{
/*
this.parentProject = parentProject;
this.groupingCollection = new GroupingCollection (null);
if (whenElement == null)
throw new ArgumentNullException ("whenElement");
this.whenElement = whenElement;
if (whenElement.GetAttribute ("Condition") != String.Empty)
condition = whenElement.GetAttributeNode ("Condition");
foreach (XmlElement xe in whenElement.ChildNodes) {
if (xe.Name == "ItemGroup") {
BuildItemGroup big = new BuildItemGroup ();
BuildItemGroup big = new BuildItemGroup (xe, parentProject, null, true);
//big.BindToXml (xe);
groupingCollection.Add (big);
// FIXME: add nested chooses
@@ -60,7 +58,12 @@ namespace Microsoft.Build.BuildEngine {
} else
throw new InvalidProjectFileException ("Invalid element in When.");
}
*/
}
public void Evaluate()
{
groupingCollection.Evaluate ();
}
public string Condition {
@@ -1,3 +1,192 @@
2009-06-12 Ankit Jain <[email protected]>
Fix bug #512535.
* ExpressionCollection.cs (ConvertToITaskItemArray): Whitespace around a
itemref is allowed if the prev/next element is ";".
2009-06-12 Ankit Jain <[email protected]>
* Utilities.cs (FromMSBuildPath): Return null if the path contains
"drive:" only on windows.
2009-06-07 Ankit Jain <[email protected]>
* Target.cs (Outputs): Use ITaskItem[] for conversion, to retain
the metadata.
2009-05-29 Ankit Jain <[email protected]>
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 <[email protected]>
* ConditionFunctionExpression.cs: Add 'HasTrailingSlash' function.
(HasTrailingSlash): New.
2009-05-12 Ankit Jain <[email protected]>
* Project.cs (.ctor): Init timeOfLastDirty.
2009-05-05 Miguel de Icaza <[email protected]>
* Contribution from Martin Brenn to fix #498154.
2009-04-27 Ankit Jain <[email protected]>
Fix bug #497839.
* Engine.cs (BuildProjectFile): Set project's GlobalProperties to the
one passed as argument.
2009-04-27 Ankit Jain <[email protected]>
* TaskEngine.cs (Prepare): Emit a useful error message property value
can't be converted to required type.
2009-04-27 Ankit Jain <[email protected]>
* ExpressionCollection.cs (ConvertToObject): Allow true/on/yes
as valid true values for bool, and corresponding for false.
2009-03-27 Jonathan Chambers <[email protected]>
* 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 <[email protected]>
* TaskDatabase.cs (RegisterTask): Search for class by name
if task was not found using GetType (which uses namespace).
2009-02-26 Ankit Jain <[email protected]>
* Target.cs: Handle target with no tasks. Log errors.
2009-02-24 Ankit Jain <[email protected]>
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 <[email protected]>
* BuildItem.cs (AddMetadata): Allow overwriting older values.
2009-02-22 Ankit Jain <[email protected]>
* BuildItem.cs: Iterate over XmlElements childnodes with XmlNode
instead of XmlElement. Eg. XmlComment
2009-02-21 Ankit Jain <[email protected]>
* Utilities.cs (FromMSBuildPath): Copy from monodevelop.
* Project.cs (Load): Use FromMSBuildPath on the path.
(InitializeProperties): Set "MSBuildToolsPath" also.
2009-02-20 Ankit Jain <[email protected]>
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 <[email protected]>
* BuildProperty.cs: Value corresponds to XmlElement.InnerXml
no XmlElement.InnerText. This allows properties to be additional
xml elements.
2009-02-01 Ankit Jain <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* TaskEngine.cs (GetObjectFromString): Empty value is allowed only for
arrays.
2009-01-29 Ankit Jain <[email protected]>
* 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.
2009-01-06 Ankit Jain <[email protected]>
* Project.cs (Build): Honor InitialTargets list.
@@ -44,7 +44,7 @@ namespace Microsoft.Build.BuildEngine {
static ConditionFunctionExpression ()
{
Type t = typeof (ConditionFunctionExpression);
string [] names = new string [] { "Exists" };
string [] names = new string [] { "Exists", "HasTrailingSlash" };
functions = new Dictionary <string, MethodInfo> ();
foreach (string name in names)
@@ -115,6 +115,21 @@ namespace Microsoft.Build.BuildEngine {
return File.Exists (file);
}
static bool HasTrailingSlash (string file, Project context)
{
if (file == null)
return false;
file = file.Trim ();
int len = file.Length;
if (len == 0)
return false;
return file [len - 1] == '\\' || file [len - 1] == '/';
}
#endregion
#pragma warning restore 0169
@@ -165,10 +165,9 @@ namespace Microsoft.Build.BuildEngine {
e = new ConditionFactorExpression (token);
} else if (token.Type == TokenType.Number) {
e = new ConditionFactorExpression (token);
} else if (token.Type == TokenType.Item) {
throw new NotImplementedException ();
} else if (token.Type == TokenType.Property) {
throw new NotImplementedException ();
} else if (token.Type == TokenType.Item || token.Type == TokenType.Property
|| token.Type == TokenType.Metadata) {
e = ParseReferenceExpression (token.Value);
} else if (token.Type == TokenType.Not) {
e = ParseNotExpression ();
} else
@@ -208,6 +207,45 @@ namespace Microsoft.Build.BuildEngine {
return list;
}
//@prefix: @ or $
ConditionExpression ParseReferenceExpression (string prefix)
{
StringBuilder sb = new StringBuilder ();
ExpectToken (TokenType.LeftParen);
tokenizer.GetNextToken ();
sb.AppendFormat ("{0}({1}", prefix, tokenizer.Token.Value);
tokenizer.GetNextToken ();
if (prefix == "@" && tokenizer.Token.Type == TokenType.Transform) {
tokenizer.GetNextToken ();
sb.AppendFormat ("->'{0}'", tokenizer.Token.Value);
tokenizer.GetNextToken ();
if (tokenizer.Token.Type == TokenType.Comma) {
tokenizer.GetNextToken ();
sb.AppendFormat (", '{0}'", tokenizer.Token.Value);
tokenizer.GetNextToken ();
}
}
ExpectToken (TokenType.RightParen);
tokenizer.GetNextToken ();
sb.Append (")");
//FIXME: HACKY!
return new ConditionFactorExpression (new Token (sb.ToString (), TokenType.String));
}
void ExpectToken (TokenType type)
{
if (tokenizer.Token.Type != type)
throw new ExpressionParseException ("Expected token type of type: " + type + ", got " +
tokenizer.Token.Type + " (" + tokenizer.Token.Value + ") .");
}
}
}
@@ -170,7 +170,10 @@ namespace Microsoft.Build.BuildEngine {
// FIXME: looks like a hack: if '-' is here '->' won't be tokenized
// maybe we should treat item reference as a token
if (Char.IsDigit (ch) || ch == '-') {
if (ch == '-' && PeekChar () == '>') {
ReadChar ();
token = new Token ("->", TokenType.Transform);
} else if (Char.IsDigit (ch) || ch == '-') {
StringBuilder sb = new StringBuilder ();
sb.Append (ch);
@@ -190,14 +193,24 @@ namespace Microsoft.Build.BuildEngine {
string temp;
sb.Append (ch);
bool is_itemref = (PeekChar () == '@');
int num_open_braces = 0;
bool in_literal = false;
while ((i = PeekChar ()) != -1) {
ch = (char) i;
if (ch == '(' && !in_literal && is_itemref)
num_open_braces ++;
if (ch == ')' && !in_literal && is_itemref)
num_open_braces --;
sb.Append ((char) ReadChar ());
if (ch == '\'')
break;
if (ch == '\'') {
if (num_open_braces == 0)
break;
in_literal = !in_literal;
}
}
temp = sb.ToString ();
@@ -140,6 +140,25 @@ namespace Microsoft.Build.BuildEngine {
} else if (input [ptr] == "..") {
di = new DirectoryInfo [1];
di [0] = directory.Parent;
} else if (input[ptr] == "**")
{
// Read this directory and all subdirectories recursive
Stack<DirectoryInfo> currentDirectories = new Stack<DirectoryInfo>();
currentDirectories.Push(directory);
List<DirectoryInfo> allDirectories = new List<DirectoryInfo>();
while (currentDirectories.Count > 0)
{
DirectoryInfo current = currentDirectories.Pop();
allDirectories.Add (current);
foreach (DirectoryInfo dir in current.GetDirectories())
{
currentDirectories.Push(dir);
}
}
// No further directories shall be read
di = allDirectories.ToArray();
} else
di = directory.GetDirectories (input [ptr]);
foreach (DirectoryInfo info in di) {
@@ -44,12 +44,16 @@ namespace Microsoft.Build.BuildEngine {
const string defaultTasksProjectName = "Microsoft.Common.tasks";
EventSource eventSource;
bool buildStarted;
BuildPropertyGroup globalProperties;
BuildPropertyGroup global_properties;
//IDictionary importedProjects;
List <ILogger> loggers;
//bool onlyLogCriticalEvents;
Dictionary <string, Project> projects;
// the key here represents the project+target+global_properties set
Dictionary <string, ITaskItem[]> builtTargetsOutputByName;
Stack<Project> currentlyBuildingProjectsStack;
static Engine globalEngine;
static Version version;
@@ -73,7 +77,9 @@ namespace Microsoft.Build.BuildEngine {
this.eventSource = new EventSource ();
this.loggers = new List <ILogger> ();
this.buildStarted = false;
this.globalProperties = new BuildPropertyGroup ();
this.global_properties = new BuildPropertyGroup ();
this.builtTargetsOutputByName = new Dictionary<string, ITaskItem[]> ();
this.currentlyBuildingProjectsStack = new Stack<Project> ();
RegisterDefaultTasks ();
}
@@ -111,27 +117,17 @@ namespace Microsoft.Build.BuildEngine {
return BuildProject (project, targetNames, targetOutputs, BuildSettings.None);
}
[MonoTODO ("use buildFlags")]
public bool BuildProject (Project project,
string[] targetNames,
IDictionary targetOutputs,
BuildSettings buildFlags)
{
bool result;
if (project == null)
throw new ArgumentException ("project");
if (targetNames == null)
return false;
StartBuild ();
LogProjectStarted (project, targetNames);
result = project.Build (targetNames, targetOutputs);
LogProjectFinished (project, result);
return result;
return project.Build (targetNames, targetOutputs, buildFlags);
}
[MonoTODO]
@@ -171,32 +167,42 @@ namespace Microsoft.Build.BuildEngine {
return BuildProjectFile (projectFile, targetNames, globalProperties, targetOutputs, BuildSettings.None);
}
[MonoTODO ("use buildFlags")]
public bool BuildProjectFile (string projectFile,
string[] targetNames,
BuildPropertyGroup globalProperties,
IDictionary targetOutputs,
BuildSettings buildFlags)
{
bool result;
Project project;
StartBuild ();
if (projects.ContainsKey (projectFile)) {
project = (Project) projects [projectFile];
LogProjectStarted (project, targetNames);
result = project.Build (targetNames, targetOutputs);
} else {
project = CreateNewProject ();
project.Load (projectFile);
LogProjectStarted (project, targetNames);
result = project.Build (targetNames, targetOutputs);
}
LogProjectFinished (project, result);
return result;
BuildPropertyGroup engine_old_grp = null;
BuildPropertyGroup project_old_grp = null;
if (globalProperties != null) {
engine_old_grp = GlobalProperties.Clone (true);
project_old_grp = project.GlobalProperties.Clone (true);
// Override project's global properties with the
// ones explicitlcur_y specified here
foreach (BuildProperty bp in globalProperties)
project.GlobalProperties.AddProperty (bp);
project.NeedToReevaluate ();
}
try {
return project.Build (targetNames, targetOutputs, buildFlags);
} finally {
if (globalProperties != null) {
GlobalProperties = engine_old_grp;
project.GlobalProperties = project_old_grp;
}
}
}
void CheckBinPath ()
@@ -273,25 +279,56 @@ namespace Microsoft.Build.BuildEngine {
{
// FIXME: check if build succeeded
// FIXME: it shouldn't be here
LogBuildFinished (true);
if (buildStarted)
LogBuildFinished (true);
foreach (ILogger i in loggers) {
i.Shutdown ();
}
loggers.Clear ();
}
internal void StartBuild ()
internal void StartProjectBuild (Project project, string [] target_names)
{
if (!buildStarted) {
LogBuildStarted ();
buildStarted = true;
}
if (currentlyBuildingProjectsStack.Count == 0 ||
String.Compare (currentlyBuildingProjectsStack.Peek ().FullFileName, project.FullFileName) != 0)
LogProjectStarted (project, target_names);
currentlyBuildingProjectsStack.Push (project);
}
void LogProjectStarted (Project project, string [] targetNames)
internal void EndProjectBuild (Project project, bool succeeded)
{
if (!buildStarted)
throw new Exception ("build isnt started currently");
Project top_project = currentlyBuildingProjectsStack.Pop ();
if (String.Compare (project.FullFileName, top_project.FullFileName) != 0)
throw new Exception (String.Format (
"INTERNAL ERROR: Project finishing is not the same as the one on top " +
"of the stack. Project: {0} Top of stack: {1}",
project.FullFileName, top_project.FullFileName));
if (currentlyBuildingProjectsStack.Count == 0 ||
String.Compare (top_project.FullFileName, currentlyBuildingProjectsStack.Peek ().FullFileName) != 0)
LogProjectFinished (top_project, succeeded);
if (currentlyBuildingProjectsStack.Count == 0) {
//FIXME: build result
LogBuildFinished (true);
buildStarted = false;
}
}
void LogProjectStarted (Project project, string [] target_names)
{
ProjectStartedEventArgs psea;
if (targetNames == null || targetNames.Length == 0) {
if (target_names == null || target_names.Length == 0) {
if (project.DefaultTargets != String.Empty)
psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
project.DefaultTargets, null, null);
@@ -299,17 +336,17 @@ namespace Microsoft.Build.BuildEngine {
psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName, "default", null, null);
} else
psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName, String.Join (";",
targetNames), null, null);
target_names), null, null);
eventSource.FireProjectStarted (this, psea);
}
void LogProjectFinished (Project project, bool succeeded)
{
ProjectFinishedEventArgs pfea;
pfea = new ProjectFinishedEventArgs ("Project started.", null, project.FullFileName, succeeded);
eventSource.FireProjectFinished (this, pfea);
}
void LogBuildStarted ()
{
BuildStartedEventArgs bsea;
@@ -365,8 +402,8 @@ namespace Microsoft.Build.BuildEngine {
}
public BuildPropertyGroup GlobalProperties {
get { return globalProperties; }
set { globalProperties = value; }
get { return global_properties; }
set { global_properties = value; }
}
public bool OnlyLogCriticalEvents {
@@ -385,6 +422,10 @@ namespace Microsoft.Build.BuildEngine {
internal TaskDatabase DefaultTasks {
get { return defaultTasks; }
}
internal Dictionary<string, ITaskItem[]> BuiltTargetsOutputByName {
get { return builtTargetsOutputByName; }
}
}
}
@@ -41,6 +41,19 @@ namespace Microsoft.Build.BuildEngine {
internal class ExpressionCollection {
IList objects;
static Dictionary<string, bool> boolValues;
static ExpressionCollection ()
{
string[] trueValuesArray = new string[] {"true", "on", "yes"};
string[] falseValuesArray = new string[] {"false", "off", "no"};
boolValues = new Dictionary<string, bool> (StringComparer.InvariantCultureIgnoreCase);
foreach (string s in trueValuesArray)
boolValues.Add (s, true);
foreach (string s in falseValuesArray)
boolValues.Add (s, false);
}
public ExpressionCollection ()
{
@@ -100,9 +113,15 @@ namespace Microsoft.Build.BuildEngine {
object ConvertToObject (string raw, Type type)
{
if (type == typeof (bool))
return Boolean.Parse (raw);
else if (type == typeof (string))
if (type == typeof (bool)) {
bool value;
if (boolValues.TryGetValue (raw, out value))
return value;
else
return false;
}
if (type == typeof (string))
return raw;
else if (type == typeof (int))
return Int32.Parse (raw);
@@ -168,10 +187,18 @@ namespace Microsoft.Build.BuildEngine {
string str = o as string;
if (str != null) {
if (str != ";" && prev != null && prev is ItemReference)
string trimmed_str = str.Trim ();
if (!IsSemicolon (str) && trimmed_str.Length > 0 && prev != null && prev is ItemReference)
// non-empty, non-semicolon string after item ref
ThrowCantConcatError (prev, str);
prev_can_concat = !(str.Length > 0 && str [str.Length - 1] == ';') && str.Trim ().Length > 0;
if (trimmed_str.Length == 0 && prev is string && IsSemicolon ((string) prev)) {
// empty string after a ';', ignore it
continue;
}
// empty string _after_ a itemref, not an error
prev_can_concat = !(str.Length > 0 && str [str.Length - 1] == ';') && trimmed_str.Length > 0;
AddItemsToArray (finalItems,
ConvertToITaskItemArrayFromString (str),
can_concat);
@@ -250,6 +277,11 @@ namespace Microsoft.Build.BuildEngine {
return items.ToArray ();
}
bool IsSemicolon (string str)
{
return str != null && str.Length == 1 && str [0] == ';';
}
void ThrowCantConcatError (object first, object second)
{
throw new Exception (String.Format (
@@ -164,6 +164,7 @@ namespace Microsoft.Build.BuildEngine {
{
Evaluate (EvaluationType.Property);
Evaluate (EvaluationType.Item);
Evaluate (EvaluationType.Choose);
}
void Evaluate (EvaluationType type)
@@ -194,7 +195,7 @@ namespace Microsoft.Build.BuildEngine {
evaluate_iterator = evaluate_iterator.Next;
}
} else {
} else if (type == EvaluationType.Item) {
evaluate_iterator = list.First;
add_iterator = list.First;
@@ -205,6 +206,29 @@ namespace Microsoft.Build.BuildEngine {
big.Evaluate ();
}
evaluate_iterator = evaluate_iterator.Next;
}
} else if (type == EvaluationType.Choose) {
evaluate_iterator = list.First;
add_iterator = list.First;
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildChoose) {
BuildChoose bc = (BuildChoose)evaluate_iterator.Value;
bool whenUsed = false;
foreach (BuildWhen bw in bc.Whens) {
if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) {
bw.Evaluate ();
whenUsed = true;
break;
}
}
if (!whenUsed && bc.Otherwise != null &&
ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
bc.Otherwise.Evaluate ();
}
}
evaluate_iterator = evaluate_iterator.Next;
}
}
@@ -231,7 +255,8 @@ namespace Microsoft.Build.BuildEngine {
enum EvaluationType {
Property,
Item
Item,
Choose
}
}
@@ -102,7 +102,7 @@ namespace Microsoft.Build.BuildEngine {
file = Path.Combine (dir, EvaluatedProjectPath);
}
return file;
return Utilities.FromMSBuildPath (file);
}
public string Condition {
@@ -71,6 +71,9 @@ namespace Microsoft.Build.BuildEngine {
XmlDocument xmlDocument;
bool unloaded;
bool initialTargetsBuilt;
List<string> builtTargetKeys;
bool building;
BuildSettings current_settings;
static XmlNamespaceManager manager;
static string ns = "http://schemas.microsoft.com/developer/msbuild/2003";
@@ -91,6 +94,10 @@ namespace Microsoft.Build.BuildEngine {
xmlDocument.DocumentElement.SetAttribute ("xmlns", ns);
fullFileName = String.Empty;
timeOfLastDirty = DateTime.Now;
current_settings = BuildSettings.None;
builtTargetKeys = new List<string> ();
globalProperties = new BuildPropertyGroup (null, this, null, false);
foreach (BuildProperty bp in parentEngine.GlobalProperties)
@@ -251,10 +258,33 @@ namespace Microsoft.Build.BuildEngine {
IDictionary targetOutputs,
BuildSettings buildFlags)
{
bool result = false;
ParentEngine.StartProjectBuild (this, targetNames);
string current_directory = Environment.CurrentDirectory;
try {
current_settings = buildFlags;
if (!String.IsNullOrEmpty (fullFileName))
Directory.SetCurrentDirectory (Path.GetDirectoryName (fullFileName));
building = true;
result = BuildInternal (targetNames, targetOutputs, buildFlags);
} finally {
ParentEngine.EndProjectBuild (this, result);
current_settings = BuildSettings.None;
Directory.SetCurrentDirectory (current_directory);
building = false;
}
return result;
}
bool BuildInternal (string [] targetNames,
IDictionary targetOutputs,
BuildSettings buildFlags)
{
CheckUnloaded ();
ParentEngine.StartBuild ();
NeedToReevaluate ();
if (buildFlags == BuildSettings.None)
Reevaluate ();
if (targetNames == null || targetNames.Length == 0) {
if (defaultTargets != null && defaultTargets.Length != 0)
@@ -291,15 +321,37 @@ namespace Microsoft.Build.BuildEngine {
return false;
}
// built targets are keyed by the particular set of global
// properties. So, a different set could allow a target
// to run again
string key = fullFileName + ":" + target + ":" + GlobalPropertiesToString (GlobalProperties);
ITaskItem[] outputs;
if (ParentEngine.BuiltTargetsOutputByName.TryGetValue (key, out outputs)) {
if (targetOutputs != null)
targetOutputs.Add (target, outputs);
LogTargetSkipped (target);
return true;
}
if (!targets [target].Build ())
return false;
ParentEngine.BuiltTargetsOutputByName [key] = (ITaskItem[]) targets [target].Outputs.Clone ();
builtTargetKeys.Add (key);
if (targetOutputs != null)
targetOutputs.Add (target, targets [target].Outputs);
return true;
}
string GlobalPropertiesToString (BuildPropertyGroup bgp)
{
StringBuilder sb = new StringBuilder ();
foreach (BuildProperty bp in bgp)
sb.AppendFormat (" {0}:{1}", bp.Name, bp.FinalValue);
return sb.ToString ();
}
[MonoTODO]
public string [] GetConditionedPropertyValues (string propertyName)
{
@@ -319,7 +371,7 @@ namespace Microsoft.Build.BuildEngine {
if (evaluatedItemsByName.ContainsKey (itemName))
return evaluatedItemsByName [itemName];
else
return new BuildItemGroup ();
return new BuildItemGroup (this);
}
public BuildItemGroup GetEvaluatedItemsByNameIgnoringCondition (string itemName)
@@ -332,7 +384,7 @@ namespace Microsoft.Build.BuildEngine {
if (evaluatedItemsByNameIgnoringCondition.ContainsKey (itemName))
return evaluatedItemsByNameIgnoringCondition [itemName];
else
return new BuildItemGroup ();
return new BuildItemGroup (this);
}
public string GetEvaluatedProperty (string propertyName)
@@ -367,8 +419,8 @@ namespace Microsoft.Build.BuildEngine {
public void Load (string projectFileName)
{
this.fullFileName = Path.GetFullPath (projectFileName);
DoLoad (new StreamReader (projectFileName));
this.fullFileName = Utilities.FromMSBuildPath (Path.GetFullPath (projectFileName));
DoLoad (new StreamReader (fullFileName));
}
[MonoTODO ("Not tested")]
@@ -426,7 +478,7 @@ namespace Microsoft.Build.BuildEngine {
if (itemToRemove == null)
throw new ArgumentNullException ("itemToRemove");
if (!itemToRemove.FromXml && !itemToRemove.HasParent)
if (!itemToRemove.FromXml && !itemToRemove.HasParentItem)
throw new InvalidOperationException ("The object passed in is not part of the project.");
BuildItemGroup big = itemToRemove.ParentItemGroup;
@@ -494,7 +546,10 @@ namespace Microsoft.Build.BuildEngine {
[MonoTODO]
public void ResetBuildStatus ()
{
throw new NotImplementedException ();
// hack to allow built targets to be removed
building = true;
Reevaluate ();
building = false;
}
public void Save (string projectFileName)
@@ -761,7 +816,8 @@ namespace Microsoft.Build.BuildEngine {
evaluatedItemsIgnoringCondition = new BuildItemGroup (null, this, null, true);
evaluatedItemsByName = new Dictionary <string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
evaluatedItemsByNameIgnoringCondition = new Dictionary <string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
evaluatedProperties = new BuildPropertyGroup (null, null, null, true);
if (building && current_settings == BuildSettings.None)
RemoveBuiltTargets ();
InitializeProperties ();
@@ -772,21 +828,43 @@ namespace Microsoft.Build.BuildEngine {
usingTask.Evaluate ();
}
// Removes entries of all earlier built targets for this project
void RemoveBuiltTargets ()
{
foreach (string key in builtTargetKeys)
ParentEngine.BuiltTargetsOutputByName.Remove (key);
}
void InitializeProperties ()
{
BuildProperty bp;
evaluatedProperties = new BuildPropertyGroup (null, null, null, true);
foreach (BuildProperty gp in GlobalProperties) {
bp = new BuildProperty (gp.Name, gp.Value, PropertyType.Global);
EvaluatedProperties.AddProperty (bp);
}
foreach (BuildProperty gp in GlobalProperties)
ParentEngine.GlobalProperties.AddProperty (gp);
// add properties that we dont have from parent engine's
// global properties
foreach (BuildProperty gp in ParentEngine.GlobalProperties) {
if (EvaluatedProperties [gp.Name] == null) {
bp = new BuildProperty (gp.Name, gp.Value, PropertyType.Global);
EvaluatedProperties.AddProperty (bp);
}
}
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables ()) {
bp = new BuildProperty ((string) de.Key, (string) de.Value, PropertyType.Environment);
EvaluatedProperties.AddProperty (bp);
}
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", parentEngine.BinPath, PropertyType.Reserved));
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", parentEngine.BinPath, PropertyType.Reserved));
// FIXME: make some internal method that will work like GetDirectoryName but output String.Empty on null/String.Empty
string projectDir;
@@ -995,6 +1073,16 @@ namespace Microsoft.Build.BuildEngine {
return default (T);
}
void LogTargetSkipped (string targetName)
{
BuildMessageEventArgs bmea;
bmea = new BuildMessageEventArgs (String.Format (
"Target {0} skipped, as it has already been built.", targetName),
null, null, MessageImportance.Low);
ParentEngine.EventSource.FireMessageRaised (this, bmea);
}
public BuildPropertyGroup EvaluatedProperties {
get {
if (needToReevaluate) {
@@ -37,7 +37,7 @@ using Microsoft.Build.Utilities;
namespace Microsoft.Build.BuildEngine {
public class Target : IEnumerable {
BatchingImpl batchingImpl;
TargetBatchingImpl batchingImpl;
BuildState buildState;
Engine engine;
ImportedProject importedProject;
@@ -64,7 +64,7 @@ namespace Microsoft.Build.BuildEngine {
this.onErrorElements = new List <XmlElement> ();
this.buildState = BuildState.NotStarted;
this.buildTasks = new List <BuildTask> ();
this.batchingImpl = new BatchingImpl (project, this.targetElement);
this.batchingImpl = new TargetBatchingImpl (project, this.targetElement);
bool onErrorFound = false;
foreach (XmlNode xn in targetElement.ChildNodes) {
@@ -128,7 +128,8 @@ namespace Microsoft.Build.BuildEngine {
buildState = BuildState.Finished;
// FIXME: log it
} catch (Exception) {
} catch (Exception e) {
LogError ("Error building target {0}: {1}", Name, e.ToString ());
return false;
}
@@ -171,26 +172,20 @@ namespace Microsoft.Build.BuildEngine {
bool DoBuild ()
{
bool executeOnErrors = false;
bool executeOnErrors;
bool result = true;
if (BuildTasks.Count == 0)
// nothing to do
return true;
LogTargetStarted ();
if (batchingImpl.BuildNeeded ()) {
foreach (BuildTask bt in buildTasks) {
result = batchingImpl.BatchBuildTask (bt);
if (!result && !bt.ContinueOnError) {
executeOnErrors = true;
break;
}
}
} else {
LogTargetSkipped ();
try {
result = batchingImpl.Build (this, out executeOnErrors);
} catch (Exception e) {
LogError ("Error building target {0}: {1}", Name, e.ToString ());
throw;
}
LogTargetFinished (result);
if (executeOnErrors == true)
ExecuteOnErrors ();
@@ -209,28 +204,15 @@ namespace Microsoft.Build.BuildEngine {
}
}
void LogTargetSkipped ()
void LogError (string message, params object [] messageArgs)
{
BuildMessageEventArgs bmea;
bmea = new BuildMessageEventArgs (String.Format ("Skipping target \"{0}\" because its outputs are up-to-date.",
name), null, "MSBuild", MessageImportance.Normal);
engine.EventSource.FireMessageRaised (this, bmea);
}
void LogTargetStarted ()
{
TargetStartedEventArgs tsea;
string projectFile = project.FullFileName;
tsea = new TargetStartedEventArgs (String.Format ("Target {0} started.", name), null, name, projectFile, null);
engine.EventSource.FireTargetStarted (this, tsea);
}
void LogTargetFinished (bool succeeded)
{
TargetFinishedEventArgs tfea;
string projectFile = project.FullFileName;
tfea = new TargetFinishedEventArgs (String.Format ("Target {0} finished.", name), null, name, projectFile, null, succeeded);
engine.EventSource.FireTargetFinished (this, tfea);
if (message == null)
throw new ArgumentException ("message");
BuildErrorEventArgs beea = new BuildErrorEventArgs (
null, null, null, 0, 0, 0, 0, String.Format (message, messageArgs),
null, null);
engine.EventSource.FireErrorRaised (this, beea);
}
public string Condition {
@@ -254,12 +236,19 @@ namespace Microsoft.Build.BuildEngine {
internal Project Project {
get { return project; }
}
internal List<BuildTask> BuildTasks {
get { return buildTasks; }
}
internal Engine Engine {
get { return engine; }
}
internal BuildState BuildState {
get { return buildState; }
}
// FIXME: implement batching
internal ITaskItem [] Outputs {
get {
string outputs = targetElement.GetAttribute ("Outputs");
@@ -269,11 +258,7 @@ namespace Microsoft.Build.BuildEngine {
Expression e = new Expression ();
e.Parse (outputs, true);
string [] outputFiles = (string []) e.ConvertTo (project, typeof (string []));
ITaskItem [] outputItems = new ITaskItem [outputFiles.Length];
for (int i = 0; i < outputFiles.Length; i++)
outputItems [i] = new TaskItem (outputFiles [i]);
return outputItems;
return (ITaskItem []) e.ConvertTo (project, typeof (ITaskItem []));
}
}
}
@@ -0,0 +1,262 @@
//
// TargetBatchingImpl.cs: Class that implements Target Batching Algorithm from the wiki.
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (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.Xml;
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
internal class TargetBatchingImpl : BatchingImplBase
{
string inputs;
string outputs;
public TargetBatchingImpl (Project project, XmlElement targetElement)
: base (project)
{
if (targetElement == null)
throw new ArgumentNullException ("targetElement");
inputs = targetElement.GetAttribute ("Inputs");
outputs = targetElement.GetAttribute ("Outputs");
}
public bool Build (Target target, out bool executeOnErrors)
{
executeOnErrors = false;
try {
if (!BuildTargetNeeded ()) {
LogTargetStarted (target);
LogTargetSkipped (target);
LogTargetFinished (target, true);
return true;
}
Init ();
ParseTargetAttributes (target);
BatchAndPrepareBuckets ();
return Run (target, out executeOnErrors);
} finally {
consumedItemsByName = null;
consumedMetadataReferences = null;
consumedQMetadataReferences = null;
consumedUQMetadataReferences = null;
batchedItemsByName = null;
commonItemsByName = null;
}
}
bool Run (Target target, out bool executeOnErrors)
{
executeOnErrors = false;
if (buckets.Count > 0)
return RunBatched (target, out executeOnErrors);
else
return RunUnbatched (target, out executeOnErrors);
}
bool RunBatched (Target target, out bool executeOnErrors)
{
bool result = true;
executeOnErrors = false;
foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
LogTargetStarted (target);
try {
project.SetBatchedItems (bucket, commonItemsByName);
if (!BuildTargetNeeded ()) {
LogTargetSkipped (target);
continue;
}
for (int i = 0; i < target.BuildTasks.Count; i ++) {
//required setting here, as batchtask.Run resets
//these to null before returning!
project.SetBatchedItems (bucket, commonItemsByName);
//FIXME: parsing attributes repeatedly
BuildTask task = target.BuildTasks [i];
result = new TaskBatchingImpl (project).Build (task, out executeOnErrors);
if (!result && !task.ContinueOnError) {
executeOnErrors = true;
break;
}
}
} finally {
LogTargetFinished (target, result);
}
}
project.SetBatchedItems (null, null);
return result;
}
bool RunUnbatched (Target target, out bool executeOnErrors)
{
bool result = true;
executeOnErrors = false;
LogTargetStarted (target);
try {
if (!BuildTargetNeeded ()) {
LogTargetSkipped (target);
LogTargetFinished (target, true);
return true;
}
foreach (BuildTask bt in target.BuildTasks) {
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
result = batchingImpl.Build (bt, out executeOnErrors);
if (!result && !bt.ContinueOnError) {
executeOnErrors = true;
break;
}
}
} finally {
LogTargetFinished (target, result);
}
return result;
}
// Parse target's Input and Output attributes to get list of referenced
// metadata and items to determine batching
void ParseTargetAttributes (Target target)
{
if (!String.IsNullOrEmpty (inputs))
ParseAttribute (inputs);
if (!String.IsNullOrEmpty (outputs))
ParseAttribute (outputs);
}
bool BuildTargetNeeded ()
{
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime oldestInput, youngestOutput;
if (String.IsNullOrEmpty (inputs.Trim ()))
return true;
if (String.IsNullOrEmpty (outputs.Trim ()))
return true;
Expression e = new Expression ();
e.Parse (inputs, true);
inputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]));
e = new Expression ();
e.Parse (outputs, true);
outputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]));
if (inputFiles == null || inputFiles.Length == 0)
return false;
//FIXME: if input specified, then output must also
// be there, add tests and confirm
if (outputFiles == null || outputFiles.Length == 0)
return false;
if (File.Exists (inputFiles [0].ItemSpec))
oldestInput = File.GetLastWriteTime (inputFiles [0].ItemSpec);
else
return true;
if (File.Exists (outputFiles [0].ItemSpec))
youngestOutput = File.GetLastWriteTime (outputFiles [0].ItemSpec);
else
return true;
foreach (ITaskItem item in inputFiles) {
string file = item.ItemSpec;
if (file.Trim () == String.Empty)
continue;
if (File.Exists (file.Trim ())) {
if (File.GetLastWriteTime (file.Trim ()) > oldestInput)
oldestInput = File.GetLastWriteTime (file.Trim ());
} else {
return true;
}
}
foreach (ITaskItem item in outputFiles) {
string file = item.ItemSpec;
if (file.Trim () == String.Empty)
continue;
if (File.Exists (file.Trim ())) {
if (File.GetLastWriteTime (file.Trim ()) < youngestOutput)
youngestOutput = File.GetLastWriteTime (file.Trim ());
} else
return true;
}
if (oldestInput > youngestOutput)
return true;
else
return false;
}
void LogTargetSkipped (Target target)
{
BuildMessageEventArgs bmea;
bmea = new BuildMessageEventArgs (String.Format ("Skipping target \"{0}\" because its outputs are up-to-date.",
target.Name), null, "MSBuild", MessageImportance.Normal);
target.Engine.EventSource.FireMessageRaised (this, bmea);
}
void LogTargetStarted (Target target)
{
TargetStartedEventArgs tsea;
string projectFile = project.FullFileName;
tsea = new TargetStartedEventArgs (String.Format ("Target {0} started.", target.Name), null, target.Name, projectFile, null);
target.Engine.EventSource.FireTargetStarted (this, tsea);
}
void LogTargetFinished (Target target, bool succeeded)
{
TargetFinishedEventArgs tfea;
string projectFile = project.FullFileName;
tfea = new TargetFinishedEventArgs (String.Format ("Target {0} finished.", target.Name), null, target.Name, projectFile, null, succeeded);
target.Engine.EventSource.FireTargetFinished (this, tfea);
}
}
}
#endif
@@ -0,0 +1,104 @@
//
// TaskBatchingImpl.cs: Class that implements Task Batching Algorithm from the wiki.
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (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.Collections.Generic;
using System.Xml;
namespace Microsoft.Build.BuildEngine {
internal class TaskBatchingImpl : BatchingImplBase
{
public TaskBatchingImpl (Project project)
: base (project)
{
}
public bool Build (BuildTask buildTask, out bool executeOnErrors)
{
executeOnErrors = false;
try {
Init ();
// populate list of referenced items and metadata
ParseTaskAttributes (buildTask);
if (consumedMetadataReferences.Count == 0) {
// No batching required
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project))
return buildTask.Execute ();
else // skipped, it should be logged
return true;
}
BatchAndPrepareBuckets ();
return Run (buildTask, out executeOnErrors);
} finally {
consumedItemsByName = null;
consumedMetadataReferences = null;
consumedQMetadataReferences = null;
consumedUQMetadataReferences = null;
batchedItemsByName = null;
commonItemsByName = null;
}
}
bool Run (BuildTask buildTask, out bool executeOnErrors)
{
executeOnErrors = false;
// Run the task in batches
bool retval = true;
foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
project.SetBatchedItems (bucket, commonItemsByName);
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
if (! (retval = buildTask.Execute ()))
break;
}
}
project.SetBatchedItems (null, null);
return retval;
}
// Parse task attributes to get list of referenced metadata and items
// to determine batching
//
void ParseTaskAttributes (BuildTask buildTask)
{
foreach (XmlAttribute attrib in buildTask.TaskElement.Attributes)
ParseAttribute (attrib.Value);
}
}
}
#endif
@@ -36,6 +36,7 @@ using Mono.XBuild.Framework;
namespace Microsoft.Build.BuildEngine {
internal class TaskDatabase {
Dictionary<string, UsingTaskInfo> usingTasksByFullName;
// full name -> AssemblyLoadInfo
Dictionary <string, AssemblyLoadInfo> assemblyInformation;
// full name -> Type
@@ -48,6 +49,7 @@ namespace Microsoft.Build.BuildEngine {
assemblyInformation = new Dictionary <string, AssemblyLoadInfo> ();
typesByFullName = new Dictionary <string, Type> ();
typesByShortName = new Dictionary <string, Type> ();
usingTasksByFullName = new Dictionary <string, UsingTaskInfo> ();
}
public void RegisterTask (string classname, AssemblyLoadInfo assemblyLoadInfo)
@@ -63,15 +65,64 @@ namespace Microsoft.Build.BuildEngine {
assembly = Assembly.Load (assemblyLoadInfo.AssemblyNameString);
Type type = assembly.GetType (classname);
if (type == null) {
// search for matching class in case namespace was not used
foreach (Type exportedType in assembly.GetExportedTypes()) {
if (exportedType.Name == classname) {
type = exportedType;
break;
}
}
}
typesByFullName.Add (classname, type);
typesByShortName.Add (GetShortName (classname), type);
typesByShortName [GetShortName (classname)] = type;
}
public void RegisterUsingTask (UsingTask ut)
{
usingTasksByFullName [ut.TaskName] = new UsingTaskInfo (GetShortName (ut.TaskName), ut);
}
public Type GetTypeFromClassName (string classname)
{
Type ret = GetTypeFromClassNameInternal (classname);
if (ret == null) {
// Task not already loaded,
// Check list of pending UsingTasks
bool is_shortname = classname.IndexOf ('.') < 0;
UsingTaskInfo info = new UsingTaskInfo (String.Empty, null);
if (is_shortname) {
// Linear search UsingTaskInfo objects for short name match
foreach (UsingTaskInfo ut_info in usingTasksByFullName.Values) {
if (String.Compare (ut_info.ShortName, classname) == 0) {
info = ut_info;
break;
}
}
if (info.Task == null)
ThrowTaskNotRegistered (classname);
} else {
// Look for full name match
if (!usingTasksByFullName.TryGetValue (classname, out info))
ThrowTaskNotRegistered (classname);
}
usingTasksByFullName.Remove (info.Task.TaskName);
info.Task.Load (this);
ret = GetTypeFromClassNameInternal (classname);
}
if (ret == null)
ThrowTaskNotRegistered (classname);
return ret;
}
Type GetTypeFromClassNameInternal (string classname)
{
if (!typesByFullName.ContainsKey (classname)) {
if (!typesByShortName.ContainsKey (classname))
throw new Exception (String.Format ("Not registered task {0}.", classname));
return null;
else
return typesByShortName [classname];
} else
@@ -86,6 +137,8 @@ namespace Microsoft.Build.BuildEngine {
typesByFullName.Add (kvp.Key, kvp.Value);
foreach (KeyValuePair <string, Type> kvp in taskDatabase.typesByShortName)
typesByShortName.Add (kvp.Key, kvp.Value);
foreach (KeyValuePair <string, UsingTaskInfo> kvp in taskDatabase.usingTasksByFullName)
usingTasksByFullName.Add (kvp.Key, kvp.Value);
}
private string GetShortName (string fullname)
@@ -93,6 +146,22 @@ namespace Microsoft.Build.BuildEngine {
string[] parts = fullname.Split ('.');
return parts [parts.Length - 1];
}
void ThrowTaskNotRegistered (string classname)
{
throw new Exception (String.Format ("Not registered task {0}.", classname));
}
}
struct UsingTaskInfo {
public string ShortName;
public UsingTask Task;
public UsingTaskInfo (string shortname, UsingTask task)
{
ShortName = shortname;
Task = task;
}
}
}
@@ -76,7 +76,13 @@ namespace Microsoft.Build.BuildEngine {
throw new InvalidProjectFileException (String.Format ("Task does not have property \"{0}\" defined",
de.Key));
value = GetObjectFromString (de.Value, currentProperty.PropertyType);
try {
value = GetObjectFromString (de.Value, currentProperty.PropertyType);
} catch (Exception e) {
throw new Exception (String.Format (
"Error converting Property named '{0}' with value '{1}' to type {2}: {3}",
de.Key, de.Value, currentProperty.PropertyType, e.Message), e);
}
if (value != null)
values.Add (de.Key, value);
@@ -162,6 +168,7 @@ namespace Microsoft.Build.BuildEngine {
string itemName)
{
BuildItemGroup newItems = ChangeType.ToBuildItemGroup (o, propertyInfo.PropertyType, itemName);
newItems.ParentProject = parentProject;
if (parentProject.EvaluatedItemsByName.ContainsKey (itemName)) {
BuildItemGroup big = parentProject.EvaluatedItemsByName [itemName];
@@ -181,8 +188,11 @@ namespace Microsoft.Build.BuildEngine {
e = new Expression ();
e.Parse (raw, true);
if ((string) e.ConvertTo (parentProject, typeof (string)) == String.Empty)
// Empty contents allowed only for arrays
// See TestRequiredTask_*
if (!type.IsArray &&
(string) e.ConvertTo (parentProject, typeof (string)) == String.Empty)
return null;
result = e.ConvertTo (parentProject, type);
@@ -29,6 +29,8 @@
#if NET_2_0
using System;
namespace Microsoft.Build.BuildEngine {
internal class Token {
@@ -49,6 +51,11 @@ namespace Microsoft.Build.BuildEngine {
public TokenType Type {
get { return tokenType; }
}
public override string ToString ()
{
return String.Format ("Token (Type: {0} -> Value: {1})", tokenType, tokenValue);
}
}
internal enum TokenType {
@@ -63,7 +70,7 @@ namespace Microsoft.Build.BuildEngine {
Property,
Metadata,
FunctionName,
// Transform,
Transform,
// LiteralSubExpression,
FirstPunct,
@@ -57,7 +57,16 @@ namespace Microsoft.Build.BuildEngine {
internal void Evaluate ()
{
AssemblyLoadInfo loadInfo;
if (AssemblyName == null && AssemblyFile == null)
throw new InvalidProjectFileException ("A <UsingTask> element must contain either the \"AssemblyName\" attribute or the \"AssemblyFile\" attribute (but not both). ");
if (ConditionParser.ParseAndEvaluate (Condition, project))
project.TaskDatabase.RegisterUsingTask (this);
}
internal void Load (TaskDatabase db)
{
AssemblyLoadInfo loadInfo = null;
if (AssemblyName != null) {
loadInfo = new AssemblyLoadInfo (AssemblyName, TaskName);
@@ -79,10 +88,9 @@ namespace Microsoft.Build.BuildEngine {
filename = Path.Combine (ffn, filename);
}
loadInfo = new AssemblyLoadInfo (LoadInfoType.AssemblyFilename, filename, null, null, null, null, TaskName);
} else {
throw new InvalidProjectFileException ("A <UsingTask> element must contain either the \"AssemblyName\" attribute or the \"AssemblyFile\" attribute (but not both). ");
}
project.TaskDatabase.RegisterTask (TaskName, loadInfo);
db.RegisterTask (TaskName, loadInfo);
}
public bool IsImported {
@@ -3,8 +3,10 @@
//
// Author:
// Marek Sieradzki ([email protected])
// Lluis Sanchez Gual <[email protected]>
//
// (C) 2005 Marek Sieradzki
// Copyright (c) 2008 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
@@ -29,6 +31,7 @@
using System;
using System.Collections;
using System.IO;
using System.Text;
namespace Microsoft.Build.BuildEngine {
@@ -77,7 +80,69 @@ namespace Microsoft.Build.BuildEngine {
return sb.ToString ();
}
internal static string FromMSBuildPath (string relPath)
{
if (relPath == null || relPath.Length == 0)
return null;
bool is_windows = Path.DirectorySeparatorChar == '\\';
string path = relPath;
if (!is_windows)
path = path.Replace ("\\", "/");
// a path with drive letter is invalid/unusable on non-windows
if (!is_windows && char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':')
return null;
if (System.IO.File.Exists (path)){
return Path.GetFullPath (path);
}
if (Path.IsPathRooted (path)) {
// Windows paths are case-insensitive. When mapping an absolute path
// we can try to find the correct case for the path.
string[] names = path.Substring (1).Split ('/');
string part = "/";
for (int n=0; n<names.Length; n++) {
string[] entries;
if (names [n] == ".."){
if (part == "/")
return ""; // Can go further back. It's not an existing file
part = Path.GetFullPath (part + "/..");
continue;
}
entries = Directory.GetFileSystemEntries (part);
string fpath = null;
foreach (string e in entries) {
if (string.Compare (Path.GetFileName (e), names[n], true) == 0) {
fpath = e;
break;
}
}
if (fpath == null) {
// Part of the path does not exist. Can't do any more checking.
part = Path.GetFullPath (part);
for (; n < names.Length; n++)
part += "/" + names[n];
return part;
}
part = fpath;
}
return Path.GetFullPath (part);
} else {
return Path.GetFullPath (path);
}
}
}
}
#endif
@@ -19,6 +19,18 @@
</DocumentationFile>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMS' ">
<OutputPath>.\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<UseVSHostingProcess>true</UseVSHostingProcess>
<DocumentationFile>
</DocumentationFile>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<Optimize>True</Optimize>
@@ -35,22 +47,36 @@
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities" />
<Reference Include="nunit.core" />
<Reference Include="nunit.framework" />
<Reference Include="nunit.core">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\nunit24\NUnitCore\core\bin\Debug2005\nunit.core.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\nunit24\NUnitFramework\framework\bin\Debug2005\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'DebugMS' ">
<Reference Include="Microsoft.Build.Engine" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'DebugMS' ">
<ProjectReference Include="Microsoft.Build.Engine.csproj">
<Project>{49CC9B64-E28A-4818-97F9-301E14B383B9}</Project>
<Name>Microsoft.Build.Engine</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildItemGroupCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildItemGroupTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildItemTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildPropertyGroupCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildPropertyGroupTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildPropertyTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildPropertyGroupTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildPropertyGroupCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildTaskTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\BuildChooseTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\ConsoleLoggerTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\Consts.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\EngineTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\ImportCollectionTest.cs" />
@@ -60,8 +86,9 @@
<Compile Include="Test\Microsoft.Build.BuildEngine\ProjectTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\TargetCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\TargetTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\UsingTaskCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\TestNamespaceManager.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\UsingTaskTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\UsingTaskCollectionTest.cs" />
<Compile Include="Test\Microsoft.Build.BuildEngine\UtilitiesTest.cs" />
<Compile Include="Test\various\Build.cs" />
<Compile Include="Test\various\Conditions.cs" />
@@ -70,6 +97,10 @@
<Compile Include="Test\various\Items.cs" />
<Compile Include="Test\various\ProjectElement.cs" />
<Compile Include="Test\various\Properties.cs" />
<Compile Include="..\Microsoft.Build.Tasks\Test/Microsoft.Build.Tasks\TestMessageLogger.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<PropertyGroup>
<PreBuildEvent>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /r:Microsoft.Build.Framework.dll /r:Microsoft.Build.Utilities.dll /target:library /out:$(ProjectDir)Test\resources\TestTasks.dll $(ProjectDir)Test\resources\TestTasks.cs</PreBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,115 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.Build.Engine</RootNamespace>
<AssemblyName>Microsoft.Build.Engine</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{49CC9B64-E28A-4818-97F9-301E14B383B9}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>.\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<UseVSHostingProcess>true</UseVSHostingProcess>
<DocumentationFile>
</DocumentationFile>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<UseVSHostingProcess>true</UseVSHostingProcess>
<DocumentationFile>
</DocumentationFile>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMS' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugMS\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'DebugMS' ">
<Compile Include="Assembly\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\build\common\Consts.cs" />
<Compile Include="..\..\build\common\MonoTODOAttribute.cs" />
<Compile Include="..\Microsoft.Build.Framework\Mono.XBuild.Framework/AssemblyLoadInfo.cs" />
<Compile Include="..\Microsoft.Build.Utilities\Mono.XBuild.Utilities/ReservedNameUtils.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BatchingImplBase.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildChoose.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildEngine.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildItem.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildItemGroup.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildItemGroupCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildProperty.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildPropertyGroup.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildPropertyGroupCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildSettings.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildTask.cs" />
<Compile Include="Microsoft.Build.BuildEngine\BuildWhen.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ChangeType.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ColorResetter.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ColorSetter.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionAndExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionFactorExpresion.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionFunctionExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionNotExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionOrExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionParser.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionRelationalExpression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConditionTokenizer.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ConsoleLogger.cs" />
<Compile Include="Microsoft.Build.BuildEngine\DirectoryScanner.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Engine.cs" />
<Compile Include="Microsoft.Build.BuildEngine\EventSource.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Expression.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ExpressionCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ExpressionParseException.cs" />
<Compile Include="Microsoft.Build.BuildEngine\FileLogger.cs" />
<Compile Include="Microsoft.Build.BuildEngine\GroupingCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Import.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ImportCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ImportedProject.cs" />
<Compile Include="Microsoft.Build.BuildEngine\InternalLoggerException.cs" />
<Compile Include="Microsoft.Build.BuildEngine\InvalidProjectFileException.cs" />
<Compile Include="Microsoft.Build.BuildEngine\IReference.cs" />
<Compile Include="Microsoft.Build.BuildEngine\ItemReference.cs" />
<Compile Include="Microsoft.Build.BuildEngine\MetadataReference.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Project.cs" />
<Compile Include="Microsoft.Build.BuildEngine\PropertyPosition.cs" />
<Compile Include="Microsoft.Build.BuildEngine\PropertyReference.cs" />
<Compile Include="Microsoft.Build.BuildEngine\SolutionParser.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Target.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TargetBatchingImpl.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TargetCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskBatchingImpl.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskDatabase.cs" />
<Compile Include="Microsoft.Build.BuildEngine\TaskEngine.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Token.cs" />
<Compile Include="Microsoft.Build.BuildEngine\UsingTask.cs" />
<Compile Include="Microsoft.Build.BuildEngine\UsingTaskCollection.cs" />
<Compile Include="Microsoft.Build.BuildEngine\Utilities.cs" />
<Compile Include="Microsoft.Build.BuildEngine\WriteHandler.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>
@@ -3,7 +3,9 @@
Assembly/AssemblyInfo.cs
../Microsoft.Build.Framework/Mono.XBuild.Framework/AssemblyLoadInfo.cs
../Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
Microsoft.Build.BuildEngine/BatchingImpl.cs
Microsoft.Build.BuildEngine/BatchingImplBase.cs
Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
Microsoft.Build.BuildEngine/BuildChoose.cs
Microsoft.Build.BuildEngine/BuildEngine.cs
Microsoft.Build.BuildEngine/BuildItem.cs
@@ -1,3 +1,4 @@
Microsoft.Build.BuildEngine/BuildChooseTest.cs
Microsoft.Build.BuildEngine/BuildItemGroupCollectionTest.cs
Microsoft.Build.BuildEngine/BuildItemGroupTest.cs
Microsoft.Build.BuildEngine/BuildItemTest.cs
@@ -0,0 +1,279 @@
//
// BuildChoose.cs
//
// Author:
// Jonathan Chambers ([email protected])
//
// (C) 2009 Jonathan Chambers
//
// 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.
using System;
using System.Collections;
using Microsoft.Build.BuildEngine;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.BuildEngine {
[TestFixture]
public class BuildChooseTest {
[Test]
public void TestEmptyWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == ''"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (1, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (1, project.EvaluatedItems.Count, "A3");
Assert.AreEqual (1, project.EvaluatedItemsIgnoringCondition.Count, "A4");
}
[Test]
public void TestFalseWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == 'False'"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (1, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (0, project.EvaluatedItems.Count, "A3");
Assert.AreEqual (0, project.EvaluatedItemsIgnoringCondition.Count, "A4");
}
[Test]
public void TestMultipleTrueWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == ''"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
<When Condition=""'$(Configuration)' == ''"">
<ItemGroup>
<B Include='a' />
</ItemGroup>
</When>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (2, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (1, project.EvaluatedItems.Count, "A3");
Assert.AreEqual ("A", project.EvaluatedItems[0].Name, "A4");
Assert.AreEqual (1, project.EvaluatedItemsIgnoringCondition.Count, "A5");
}
[Test]
public void TestMultipleFalseWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == 'False'"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
<When Condition=""'$(Configuration)' == 'False'"">
<ItemGroup>
<B Include='a' />
</ItemGroup>
</When>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (2, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (0, project.EvaluatedItems.Count, "A3");
Assert.AreEqual (0, project.EvaluatedItemsIgnoringCondition.Count, "A4");
}
[Test]
[ExpectedException (typeof (InvalidProjectFileException))]
public void TestMissingWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
// a <Choose> requires at least one <When>
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<Otherwise>
<ItemGroup>
<A Include='a' />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
}
[Test]
[ExpectedException (typeof (InvalidProjectFileException))]
public void TestMissingConditionWhen () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
// a <When> requires a Condition
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When>
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
}
[Test]
public void TestWhenOtherwise1 () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == ''"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<B Include='a' />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (2, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (1, project.EvaluatedItems.Count, "A3");
Assert.AreEqual ("A", project.EvaluatedItems[0].Name, "A4");
Assert.AreEqual (1, project.EvaluatedItemsIgnoringCondition.Count, "A5");
}
[Test]
public void TestWhenOtherwise2 () {
Engine engine;
Project project;
BuildItemGroup[] groups = new BuildItemGroup[1];
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Choose>
<When Condition=""'$(Configuration)' == 'False'"">
<ItemGroup>
<A Include='a' />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<B Include='a' />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
//Assert.AreEqual (2, project.ItemGroups.Count, "A1");
Assert.AreEqual (0, project.PropertyGroups.Count, "A2");
Assert.AreEqual (1, project.EvaluatedItems.Count, "A3");
Assert.AreEqual ("B", project.EvaluatedItems[0].Name, "A4");
Assert.AreEqual (1, project.EvaluatedItemsIgnoringCondition.Count, "A5");
}
}
}
@@ -388,9 +388,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("Item", items [0].Name, "A7");
}
// A shallow clone of this object cannot be created
[Test]
[ExpectedException (typeof (InvalidOperationException),
"A shallow clone of this object cannot be created.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestClone5 ()
{
Engine engine;
@@ -474,9 +474,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.IsFalse (groups [0].IsImported, "A2");
}
// Cannot set a condition on an object not represented by an XML element in the project file.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Cannot set a condition on an object not represented by an XML element in the project file.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestCondition2 ()
{
BuildItemGroup big = new BuildItemGroup ();
@@ -93,9 +93,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
new BuildItem (null, "something");
}
// Parameter "itemInclude" cannot have zero length.
[Test]
[ExpectedException (typeof (ArgumentException),
"Parameter \"itemInclude\" cannot have zero length.")]
[ExpectedException (typeof (ArgumentException))]
public void TestCtor6 ()
{
new BuildItem (null, String.Empty);
@@ -124,9 +124,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("name", item2.Name, "A6");
}
// Cannot set a condition on an object not represented by an XML element in the project file.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Cannot set a condition on an object not represented by an XML element in the project file.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestCondition1 ()
{
item = new BuildItem ("name", "1");
@@ -217,9 +217,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
item.CopyCustomMetadataTo (null);
}
// Assigning the "Exclude" attribute of a virtual item is not allowed.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Assigning the \"Exclude\" attribute of a virtual item is not allowed.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestExclude1 ()
{
item = new BuildItem ("name", "1");
@@ -561,9 +561,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
item.RemoveMetadata ("undefined_metadata");
}
// "Filename" is a reserved item meta-data, and cannot be modified or deleted.
[Test]
[ExpectedException (typeof (ArgumentException),
"\"Filename\" is a reserved item meta-data, and cannot be modified or deleted.")]
[ExpectedException (typeof (ArgumentException))]
public void TestRemoveMetadata4 ()
{
item = new BuildItem ("name", "value");
@@ -671,9 +671,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual (Utilities.Escape ("$(A)"), item.GetMetadata ("b"), "A5");
Assert.AreEqual ("$(A)", item.GetMetadata ("c"), "A6");
}
// "Filename" is a reserved item meta-data, and cannot be modified or deleted.
[Test]
[ExpectedException (typeof (ArgumentException),
"\"Filename\" is a reserved item meta-data, and cannot be modified or deleted.")]
[ExpectedException (typeof (ArgumentException))]
public void TestSetMetadata4 ()
{
item = new BuildItem ("name", "include");
@@ -802,5 +803,50 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.ItemGroups.CopyTo (groups, 0);
Assert.AreEqual (1, groups [0].Count, "A3");
}
[Test]
public void TestBuildItemTransform ()
{
string projectText = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName='BatchingTestTask' AssemblyFile='Test\resources\TestTasks.dll' />
<ItemGroup>
<Foo Include='abc'/>
<Foo Include='def'/>
</ItemGroup>
<PropertyGroup>
<FooProp>PropValue/</FooProp>
</PropertyGroup>
<Target Name=""main"">
<CreateItem Include=""@(Foo)"">
<Output TaskParameter =""Include"" ItemName=""SyntheticFoo""/>
</CreateItem>
<BatchingTestTask
TaskItemsOutput=""@(SyntheticFoo->'$(FooProp)%(Identity).txt')"">
<Output TaskParameter='TaskItemsOutput' ItemName='I0' />
</BatchingTestTask>
</Target>
</Project>";
Engine engine = new Engine (Consts.BinPath);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
Project project = engine.CreateNewProject ();
project.LoadXml (projectText);
bool result = project.Build ("main");
if (!result) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
BuildItemGroup grp = project.GetEvaluatedItemsByName ("I0");
Assert.AreEqual (2, grp.Count, "A1");
Assert.AreEqual ("PropValue/abc.txt", grp [0].FinalItemSpec, "A2");
Assert.AreEqual ("PropValue/def.txt", grp [1].FinalItemSpec, "A3");
}
}
}
@@ -60,9 +60,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.PropertyGroups.CopyTo (null, 0);
}
// Index was outside the bounds of the array.
[Test]
[ExpectedException (typeof (IndexOutOfRangeException),
"Index was outside the bounds of the array.")]
[ExpectedException (typeof (IndexOutOfRangeException))]
public void TestCopyTo2 ()
{
string documentString = @"
@@ -102,9 +102,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
new BuildPropertyGroup ()}}, 0);
}
// Index was outside the bounds of the array.
[Test]
[ExpectedException (typeof (IndexOutOfRangeException),
"Index was outside the bounds of the array.")]
[ExpectedException (typeof (IndexOutOfRangeException))]
public void TestCopyTo4 ()
{
string documentString = @"
@@ -123,9 +123,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.PropertyGroups.CopyTo (new BuildPropertyGroup [1], 2);
}
// Index was outside the bounds of the array.
[Test]
[ExpectedException (typeof (IndexOutOfRangeException),
"Index was outside the bounds of the array.")]
[ExpectedException (typeof (IndexOutOfRangeException))]
public void TestCopyTo5 ()
{
string documentString = @"
@@ -122,9 +122,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
}
// FIXME: what was that supposed to test?
// Properties in persisted property groups cannot be accessed by name.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Properties in persisted property groups cannot be accessed by name.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestClone1 ()
{
string documentString = @"
@@ -179,9 +179,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual (0, array [0].Count, "A1");
}
// Cannot set a condition on an object not represented by an XML element in the project file.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Cannot set a condition on an object not represented by an XML element in the project file.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestCondition1 ()
{
string condition = "condition";
@@ -284,9 +284,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("3", bpg ["a"].Value, "A4");
}
// Properties in persisted property groups cannot be accessed by name.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Properties in persisted property groups cannot be accessed by name.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestIndexer2 ()
{
string documentString = @"
@@ -307,9 +307,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("a", array [0] ["a"].Name, "A1");
}
// Properties in persisted property groups cannot be accessed by name.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Properties in persisted property groups cannot be accessed by name.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestIndexer3 ()
{
string documentString = @"
@@ -430,9 +430,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.IsNull (node, "A3");
}
// The specified property does not belong to the current property group.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The specified property does not belong to the current property group.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestRemoveProperty6 ()
{
Engine engine;
@@ -535,9 +535,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("$(A)", b2.FinalValue, "A6");
}
// The name "1" contains an invalid character "1".
[Test]
[ExpectedException (typeof (ArgumentException),
"The name \"1\" contains an invalid character \"1\".")]
[ExpectedException (typeof (ArgumentException))]
public void TestSetProperty5 ()
{
BuildPropertyGroup bpg = new BuildPropertyGroup ();
@@ -615,9 +615,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.IsNull (project.EvaluatedProperties ["A"], "A1");
}
// This method is only valid for virtual property groups, not <PropertyGroup> elements.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"This method is only valid for virtual property groups, not <PropertyGroup> elements.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestSetProperty9 ()
{
Engine engine;
@@ -94,9 +94,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
}
// A shallow clone of this object cannot be created.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"A shallow clone of this object cannot be created.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestClone1 ()
{
bp = new BuildProperty ("name", "value");
@@ -256,9 +256,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("true", a.Condition, "A1");
}
// Cannot set a condition on an object not represented by an XML element in the project file.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"Cannot set a condition on an object not represented by an XML element in the project file.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestCondition2 ()
{
BuildProperty a = new BuildProperty ("name", "value");
@@ -347,5 +347,37 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
node = xd.SelectSingleNode ("tns:Project/tns:PropertyGroup/tns:Name", TestNamespaceManager.NamespaceManager);
Assert.AreEqual ("AnotherValue", node.InnerText, "A1");
}
[Test]
public void TestValueXml ()
{
BuildPropertyGroup [] bpgs = new BuildPropertyGroup [1];
BuildProperty [] props;
XmlDocument xd;
XmlNode node;
string documentString = @"
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup>
<Name>Value</Name>
</PropertyGroup>
</Project>
";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
project.PropertyGroups.CopyTo (bpgs, 0);
bpgs[0].AddNewProperty("XmlProp", "<XmlStuff></XmlStuff>");
xd = new XmlDocument ();
xd.LoadXml (project.Xml);
Console.WriteLine(project.Xml);
node = xd.SelectSingleNode ("tns:Project/tns:PropertyGroup/tns:XmlProp/tns:XmlStuff", TestNamespaceManager.NamespaceManager);
Assert.IsNotNull (node, "A1");
}
}
}
@@ -344,7 +344,41 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual ("ItemName", project.EvaluatedItems [0].Name, "A1");
Assert.AreEqual ("some_text", project.EvaluatedItems [0].FinalItemSpec, "A2");
}
}
[Test]
public void TestTaskInNamespace()
{
Engine engine;
Project project;
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<UsingTask
AssemblyFile='Test\resources\TestTasks.dll'
TaskName='NamespacedOutputTestTask'
/>
<Target Name='T'>
<NamespacedOutputTestTask />
</Target>
</Project>
";
engine = new Engine(Consts.BinPath);
project = engine.CreateNewProject();
project.LoadXml(documentString);
Target[] t = new Target[1];
BuildTask[] bt;
project.Targets.CopyTo(t, 0);
bt = GetTasks(t[0]);
bt[0].AddOutputItem("Property", "ItemName");
project.Build("T");
Assert.AreEqual("ItemName", project.EvaluatedItems[0].Name, "A1");
Assert.AreEqual("some_text", project.EvaluatedItems[0].FinalItemSpec, "A2");
}
[Test]
public void TestAddOutputProperty1 ()
@@ -1,3 +1,85 @@
2009-06-09 Ankit Jain <[email protected]>
* EngineTest.cs (TestMSBuildOutputs): New.
2009-06-08 Ankit Jain <[email protected]>
* ProjectTest (TestBuildSolutionProject): New. Disabled for now.
* Consts.cs (RunningOnMono): Make public.
2009-06-07 Ankit Jain <[email protected]>
* TargetTest (TestTargetOutputsIncludingMetadata): New.
2009-05-29 Ankit Jain <[email protected]>
* EngineTest.cs (TestGlobalProperties*): New tests
and some helper methods.
* ProjectTest.cs (TestResetBuildStatus): Reset twice. Update
the event counts.
2009-05-15 Marek Sieradzki <[email protected]>
* 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 <[email protected]>
* ProjectTest.cs (TestAssignment1):
* UsingTaskTest.cs (TestTaskName):
(TestAssemblyNameOrAssemblyFile1):
(TestAssemblyNameOrAssemblyFile2): Don't compare exception messages.
2009-03-27 Jonathan Chambers <[email protected]>
* BuildChooseTest.cs: Enable tests.
* Microsoft.Build.Engine.Test.csproj: Update post build step.
2009-03-26 Jonathan Chambers <[email protected]>
* BuildTaskTest.cs (TestTaskInNamespace): Add test for Task in namespace.
2009-02-24 Ankit Jain <[email protected]>
* UsingTaskTest.cs (TestLazyLoad{1,2,3}): New.
(TestAssemblyNameOrAssemblyFileConditionFalse): New.
(TestDuplicate1): New.
* TargetTest (CheckLoggedMessageHead): Moved to TestMessageLogger,
use that.
2009-02-15 Jonathan Chambers <[email protected]>
* BuildChooseTest.cs (TestValueXml): Add tests for Choose.
Currently not working.
2009-02-12 Jonathan Chambers <[email protected]>
* BuildPropertyTest.cs (TestValueXml): New.
2009-02-01 Ankit Jain <[email protected]>
* 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 <[email protected]>
* ProjectTest.cs (TestRequiredTask_*): New.
(TestBatchedMetadataRef5): New.
2009-01-29 Ankit Jain <[email protected]>
* BuildItemTest.cs (TestBuildItemTransform): New.
2009-01-06 Ankit Jain <[email protected]>
* ProjectTest.cs (TestInitialTargets): New.
@@ -30,7 +30,7 @@ using Microsoft.Build.Utilities;
public static class Consts {
static bool RunningOnMono ()
public static bool RunningOnMono ()
{
return Type.GetType ("Mono.Runtime") != null;
}
@@ -30,6 +30,7 @@ using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
using System.IO;
namespace MonoTests.Microsoft.Build.BuildEngine {
@@ -61,6 +62,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
public class EngineTest {
Engine engine;
string secondProject;
static string GetPropValue (BuildPropertyGroup bpg, string name)
{
@@ -72,16 +74,34 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
return String.Empty;
}
[SetUp]
public void Setup ()
{
secondProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup Condition=""'$(foo)' == 'hello'"">
<A>FooWasHello</A>
</PropertyGroup>
<Target Name=""TargetA"">
<Message Text=""(TargetA) foo: $(foo) A: $(A) External: $(External)""/>
</Target>
<Target Name=""TargetB"">
<Message Text=""(TargetB) foo: $(foo) A: $(A) External: $(External)""/>
</Target>
</Project>";
}
[Test]
public void TestCtor ()
{
engine = new Engine (Consts.BinPath);
}
// Before a project can be instantiated, Engine.BinPath must be set to the location on disk where MSBuild is installed.
// This is used to evaluate $(MSBuildBinPath).
[Test]
[ExpectedException (typeof (InvalidOperationException),
@"Before a project can be instantiated, Engine.BinPath must be set to the location on disk where MSBuild is installed. " +
"This is used to evaluate $(MSBuildBinPath).")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestNewProject ()
{
engine = new Engine ();
@@ -170,9 +190,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
engine.RegisterLogger (null);
}
// The "Project" object specified does not belong to the correct "Engine" object.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The \"Project\" object specified does not belong to the correct \"Engine\" object.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestUnloadProject1 ()
{
Engine a = new Engine (Consts.BinPath);
@@ -193,9 +213,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
a.UnloadProject (null);
}
// This project object has been unloaded from the MSBuild engine and is no longer valid.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"This project object has been unloaded from the MSBuild engine and is no longer valid.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestUnloadProject3 ()
{
Engine a = new Engine (Consts.BinPath);
@@ -298,5 +318,575 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
engine.BuildProject (null, (string)null);
}
// Tests to check global properties behavior
[Test]
public void TestGlobalProperties1 ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
9, 7, 13,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second" });
}
[Test]
public void TestGlobalProperties1a ()
{
Directory.CreateDirectory ("Test/resources/foo");
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
10, 7, 14,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
[Test]
public void TestGlobalProperties1b ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
10, 7, 14,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetA) foo: A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
[Test]
public void TestGlobalProperties2 ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<MSBuild Projects=""first.proj"" Targets = ""2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
10, 7, 14,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
[Test]
public void TestGlobalProperties3 ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<CallTarget Targets=""Call2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
<Target Name=""Call2"">
<MSBuild Projects=""first.proj"" Targets = ""2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
10, 8, 15,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
//externally set global properties
[Test]
public void TestGlobalProperties4 ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<CallTarget Targets=""Call2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
<Target Name=""Call2"">
<MSBuild Projects=""first.proj"" Targets = ""2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
BuildPropertyGroup globalprops = new BuildPropertyGroup ();
globalprops.SetProperty ("foo", "hello");
engine.GlobalProperties = globalprops;
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
globalprops, null, 10, 8, 15,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: hello A: FooWasHello External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
//externally set global properties, merge with explicit
[Test]
public void TestGlobalProperties4a ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<CallTarget Targets=""Call2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
<Target Name=""Call2"">
<MSBuild Projects=""first.proj"" Targets = ""2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
BuildPropertyGroup globalprops = new BuildPropertyGroup ();
globalprops.SetProperty ("external", "ExternalValue");
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
globalprops, null,
10, 8, 15,
new string [] {
"(TargetA) foo: bar A: External: ExternalValue",
"(TargetB) foo: foofoo A: External: ExternalValue",
"(TargetA) foo: A: External: ExternalValue",
"(TargetB) foo: foofoo1 A: External: ExternalValue",
"second"});
}
//set global properties on _project_, merge with explicit
[Test]
public void TestGlobalProperties4b ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<CallTarget Targets=""Call2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
<Target Name=""Call2"">
<MSBuild Projects=""first.proj"" Targets = ""2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
BuildPropertyGroup globalprops = new BuildPropertyGroup ();
globalprops.SetProperty ("external", "ExternalValue");
BuildPropertyGroup project_globalprops = new BuildPropertyGroup ();
project_globalprops.SetProperty ("external", "ProjExternalValue");
project_globalprops.SetProperty ("foo", "ProjFooValue");
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
globalprops, project_globalprops,
10, 8, 15,
new string [] {
"(TargetA) foo: bar A: External: ProjExternalValue",
"(TargetB) foo: foofoo A: External: ProjExternalValue",
"(TargetA) foo: ProjFooValue A: External: ProjExternalValue",
"(TargetB) foo: foofoo1 A: External: ProjExternalValue",
"second"});
}
//set global properties on _project_, and engine and explicit via msbuild
[Test]
public void TestGlobalProperties4c ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name=""main"">
<MSBuild Projects=""first.proj"" Targets = ""1""/>
<CallTarget Targets=""Call2""/>
<Message Text=""second""/>
<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
</Target>
<Target Name=""Call2"">
<MSBuild Projects=""first.proj"" Targets = ""2""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<Target Name = ""1"">
<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
</Target>
<Target Name=""2"">
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetA""/>
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo"" />
<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo1"" />
</Target>
</Project>
";
BuildPropertyGroup globalprops = new BuildPropertyGroup ();
globalprops.SetProperty ("foo", "EngineFooValue");
BuildPropertyGroup project_globalprops = new BuildPropertyGroup ();
project_globalprops.SetProperty ("foo", "ProjFooValue");
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
globalprops, project_globalprops,
10, 8, 15,
new string [] {
"(TargetA) foo: bar A: External: ",
"(TargetB) foo: foofoo A: External: ",
"(TargetA) foo: ProjFooValue A: External: ",
"(TargetB) foo: foofoo1 A: External: ",
"second"});
}
[Test]
public void TestMSBuildOutputs ()
{
string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
<ItemGroup>
<ProjectRef Include=""first.proj"">
<Prop3>value</Prop3>
<Unique>true</Unique>
</ProjectRef>
<ProjectRef Include=""first.proj"">
<Prop3>value2</Prop3>
<Unique>false</Unique>
</ProjectRef>
<ProjectRef Include=""second.proj"">
<Prop3>value3</Prop3>
<Unique>unique</Unique>
</ProjectRef>
</ItemGroup>
<Target Name='Main'>
<MSBuild Projects=""@(ProjectRef)"" Targets=""GetData"">
<Output TaskParameter=""TargetOutputs"" ItemName=""F""/>
</MSBuild>
<Message Text=""@(F): F.Unique: %(F.Unique)""/>
<Message Text=""@(F): F.Prop1: %(F.Prop1)""/>
<Message Text=""@(F): F.Prop2: %(F.Prop2)""/>
<Message Text=""@(F): F.Prop3: %(F.Prop3)""/>
</Target>
</Project>";
string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
<A Include=""foofoo"">
<Prop1>false</Prop1>
<Prop2>false</Prop2>
<Prop3>foo value</Prop3>
</A>
<A Include=""barbar"">
<Prop1>bar_false</Prop1>
<Prop2>bar_false</Prop2>
<Prop3>bar value</Prop3>
</A>
</ItemGroup>
<Target Name=""GetData"" Outputs=""@(AbcOutputs)"">
<CreateItem Include=""@(A)"">
<Output TaskParameter=""Include"" ItemName=""AbcOutputs""/>
</CreateItem>
</Target>
</Project>
";
string secondProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
<A Include=""from_second"">
<Prop1>false</Prop1>
<Prop2>false</Prop2>
<Prop3>new value</Prop3>
</A>
</ItemGroup>
<Target Name=""GetData"" Outputs=""@(AbcOutputs)"">
<CreateItem Include=""@(A)"">
<Output TaskParameter=""Include"" ItemName=""AbcOutputs""/>
</CreateItem>
</Target>
</Project>
";
CreateAndCheckGlobalPropertiesTest (mainProject, firstProject, secondProject,
null, null,
4, 3, 12,
new string [] {
"foofoo;barbar;foofoo;barbar: F.Unique: true",
"from_second: F.Unique: unique",
"foofoo;foofoo;from_second: F.Prop1: false",
"barbar;barbar: F.Prop1: bar_false",
"foofoo;foofoo;from_second: F.Prop2: false",
"barbar;barbar: F.Prop2: bar_false",
"foofoo;foofoo: F.Prop3: foo value",
"barbar;barbar: F.Prop3: bar value",
"from_second: F.Prop3: new value",
});
}
// Helper Methods for TestGlobalProperties*
void CreateAndCheckGlobalPropertiesTest (string main, string first, string second,
int project_count, int target_count, int task_count, string [] messages)
{
CreateAndCheckGlobalPropertiesTest (main, first, second, null, null,
project_count, target_count, task_count, messages);
}
void CreateAndCheckGlobalPropertiesTest (string main, string first, string second,
BuildPropertyGroup engine_globals, BuildPropertyGroup project_globals,
int project_count, int target_count, int task_count, string [] messages)
{
WriteGlobalPropertiesProjects (main, first, second);
Engine engine = new Engine (Consts.BinPath);
if (engine_globals != null)
engine.GlobalProperties = engine_globals;
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
Project project = engine.CreateNewProject ();
project.Load (Path.Combine ("Test", Path.Combine ("resources", "main.proj")));
if (project_globals != null)
project.GlobalProperties = project_globals;
bool result = project.Build ();
if (!result) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
CheckEventCounts (logger, project_count, target_count, task_count);
CheckLoggedMessages (logger, messages, "A1");
}
void CheckEventCounts (MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger,
int project, int target, int task)
{
try {
Assert.AreEqual (project, logger.ProjectStarted, "#project started events");
Assert.AreEqual (project, logger.ProjectFinished, "#project finished events");
Assert.AreEqual (target, logger.TargetStarted, "#target started events");
Assert.AreEqual (target, logger.TargetFinished, "#target finished events");
Assert.AreEqual (task, logger.TaskStarted, "#task started events");
Assert.AreEqual (task, logger.TaskFinished, "#task finished events");
Assert.AreEqual (1, logger.BuildStarted, "#build started events");
Assert.AreEqual (1, logger.BuildFinished, "#build finished events");
} catch (AssertionException) {
logger.DumpMessages ();
throw;
}
}
void CheckLoggedMessages (MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger, string [] messages,
string prefix)
{
try {
for (int i = 0; i < messages.Length; i++) {
logger.CheckLoggedMessageHead (messages [i], String.Format ("{0} #{1}", prefix, i));
}
} catch {
logger.DumpMessages ();
throw;
}
Assert.AreEqual (0, logger.NormalMessageCount, "Number of remaining messages");
}
// helper methods for TestGlobalProperties*
void WriteGlobalPropertiesProjects (string mainProject, string firstProject, string secondProject)
{
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "main.proj")))) {
sw.Write (mainProject);
}
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "first.proj")))) {
sw.Write (firstProject);
}
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
sw.Write (secondProject);
}
}
}
}
@@ -32,10 +32,12 @@ using NUnit.Framework;
namespace MonoTests.Microsoft.Build.BuildEngine {
[TestFixture]
public class InternalLoggerExceptionTest {
// An InternalLoggerException can only be thrown by the MSBuild engine.
// The public constructors of this class cannot be used to create an instance of the exception.
[Test]
[ExpectedException (typeof (System.InvalidOperationException),
"An InternalLoggerException can only be thrown by the MSBuild engine." +
" The public constructors of this class cannot be used to create an instance of the exception.")]
[ExpectedException (typeof (System.InvalidOperationException))]
public void TestCtorMessage ()
{
string message = "message";
@@ -43,10 +45,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
new InternalLoggerException (message);
}
// An InternalLoggerException can only be thrown by the MSBuild engine.
// The public constructors of this class cannot be used to create an instance of the exception.
[Test]
[ExpectedException (typeof (System.InvalidOperationException),
"An InternalLoggerException can only be thrown by the MSBuild engine." +
" The public constructors of this class cannot be used to create an instance of the exception.")]
[ExpectedException (typeof (System.InvalidOperationException))]
public void TestCtorMessageException ()
{
string message = "message";
@@ -36,6 +36,8 @@ using Microsoft.Build.Utilities;
using NUnit.Framework;
using System.Text;
using MBT = MonoTests.Microsoft.Build.Tasks;
namespace MonoTests.Microsoft.Build.BuildEngine {
class TestLogger : Logger {
@@ -87,11 +89,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
*/
[Test]
[ExpectedException (typeof (InvalidProjectFileException),
@"The default XML namespace of the project must be the MSBuild XML namespace." +
" If the project is authored in the MSBuild 2003 format, please add " +
"xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" to the <Project> element. " +
"If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. ")]
public void TestAssignment1 ()
{
Engine engine;
@@ -102,16 +99,22 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
engine = new Engine (Consts.BinPath);
DateTime time = DateTime.Now;
project = engine.CreateNewProject ();
project.LoadXml (documentString);
try {
project.LoadXml (documentString);
} catch (InvalidProjectFileException) {
Assert.AreEqual (true, project.BuildEnabled, "A1");
Assert.AreEqual (String.Empty, project.DefaultTargets, "A2");
Assert.AreEqual (String.Empty, project.FullFileName, "A3");
Assert.AreEqual (false, project.IsDirty, "A4");
Assert.AreEqual (false, project.IsValidated, "A5");
Assert.AreEqual (engine, project.ParentEngine, "A6");
Console.WriteLine ("time: {0} p.t: {1}", time, project.TimeOfLastDirty);
Assert.IsTrue (time <= project.TimeOfLastDirty, "A7");
Assert.IsTrue (String.Empty != project.Xml, "A8");
return;
}
Assert.AreEqual (true, project.BuildEnabled, "A1");
Assert.AreEqual (String.Empty, project.DefaultTargets, "A2");
Assert.AreEqual (String.Empty, project.FullFileName, "A3");
Assert.AreEqual (false, project.IsDirty, "A4");
Assert.AreEqual (false, project.IsValidated, "A5");
Assert.AreEqual (engine, project.ParentEngine, "A6");
Assert.IsTrue (time <= project.TimeOfLastDirty, "A7");
Assert.IsTrue (String.Empty != project.Xml, "A8");
Assert.Fail ("Expected InvalidProjectFileException");
}
[Test]
@@ -371,14 +374,14 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='T' Inputs='Test\resources\TestTasks.cs' Outputs='Test\resources\TestTasks.dll'>
<Target Name='T'>
<Message Text='text' />
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
TestLogger tl = new TestLogger ();
MBT.TestMessageLogger tl = new MBT.TestMessageLogger();
engine.RegisterLogger (tl);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
@@ -386,8 +389,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.Build ("T");
project.Build ("T");
Assert.AreEqual (2, tl.TargetStartedEvents, "A1");
Assert.AreEqual (2, tl.TargetFinishedEvents, "A2");
Assert.AreEqual (2, tl.TargetStarted, "A1");
Assert.AreEqual (2, tl.TargetFinished, "A2");
Assert.AreEqual (2, tl.TaskStarted, "A3");
Assert.AreEqual (2, tl.TaskFinished, "A4");
}
[Test]
@@ -398,14 +403,14 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='T' Inputs='Test\resources\TestTasks.cs' Outputs='Test\resources\TestTasks.dll'>
<Target Name='T'>
<Message Text='text' />
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
TestLogger tl = new TestLogger ();
MBT.TestMessageLogger tl = new MBT.TestMessageLogger ();
engine.RegisterLogger (tl);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
@@ -413,12 +418,13 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.Build (new string [1] { "T" }, null, BuildSettings.None);
project.Build (new string [1] { "T" }, null, BuildSettings.None);
Assert.AreEqual (2, tl.TargetStartedEvents, "A1");
Assert.AreEqual (2, tl.TargetFinishedEvents, "A2");
Assert.AreEqual (2, tl.TargetStarted, "A1");
Assert.AreEqual (2, tl.TargetFinished, "A2");
Assert.AreEqual (2, tl.TaskStarted, "A3");
Assert.AreEqual (2, tl.TaskFinished, "A4");
}
[Test]
[Category ("NotWorking")]
public void TestBuild4 ()
{
Engine engine;
@@ -426,14 +432,14 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
string documentString = @"
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='T' Inputs='Test\resources\TestTasks.cs' Outputs='Test\resources\TestTasks.dll'>
<Target Name='T'>
<Message Text='text' />
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
TestLogger tl = new TestLogger ();
MBT.TestMessageLogger tl = new MBT.TestMessageLogger ();
engine.RegisterLogger (tl);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
@@ -441,8 +447,10 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.Build (new string [1] { "T" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets);
project.Build (new string [1] { "T" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets);
Assert.AreEqual (1, tl.TargetStartedEvents, "A1");
Assert.AreEqual (1, tl.TargetFinishedEvents, "A2");
Assert.AreEqual (1, tl.TargetStarted, "A1");
Assert.AreEqual (1, tl.TargetFinished, "A2");
Assert.AreEqual (1, tl.TaskStarted, "A3");
Assert.AreEqual (1, tl.TaskFinished, "A4");
}
[Test]
@@ -924,9 +932,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
p1.RemoveItemGroup (null);
}
// The "BuildItemGroup" object specified does not belong to the correct "Project" object.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The \"BuildItemGroup\" object specified does not belong to the correct \"Project\" object.")]
[ExpectedException (typeof (InvalidOperationException))]
[Category ("NotWorking")]
public void TestRemoveItemGroup2 ()
{
@@ -959,9 +967,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.RemoveItem (null);
}
// The object passed in is not part of the project.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The object passed in is not part of the project.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestRemoveItem2 ()
{
Engine engine;
@@ -973,9 +981,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.RemoveItem (new BuildItem ("name", "include"));
}
// The "BuildItemGroup" object specified does not belong to the correct "Project" object.
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The \"BuildItemGroup\" object specified does not belong to the correct \"Project\" object.")]
[ExpectedException (typeof (InvalidOperationException))]
public void TestRemoveItem3 ()
{
Engine engine;
@@ -1037,7 +1045,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
}
[Test]
[Category ("NotWorking")]
public void TestResetBuildStatus ()
{
Engine engine;
@@ -1060,9 +1067,11 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.Build ("T");
project.ResetBuildStatus ();
project.Build (new string [1] { "T" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets);
project.ResetBuildStatus ();
project.Build (new string [1] { "T" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets);
Assert.AreEqual (2, tl.TargetStartedEvents, "A1");
Assert.AreEqual (2, tl.TargetFinishedEvents, "A1");
Assert.AreEqual (3, tl.TargetStartedEvents, "A1");
Assert.AreEqual (3, tl.TargetFinishedEvents, "A1");
}
[Test]
@@ -1444,6 +1453,42 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual (0, include.Count, "A2");
}
[Test]
public void TestBatchedMetadataRef5 ()
{
string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""BatchingTestTask"" AssemblyFile=""Test/resources/TestTasks.dll"" />
<ItemGroup>
<Coll1 Include=""A1""><Name>Abc</Name></Coll1>
<Coll1 Include=""A2""><Name>Def</Name></Coll1>
<Coll1 Include=""A3""><Name>Xyz</Name></Coll1>
<Coll2 Include=""B1""><Name>Bar</Name></Coll2>
</ItemGroup>
<Target Name=""ShowMessage"">
<Message Text=""Coll1: @(Coll1->'Foo%(Name)Bar')"" />
<BatchingTestTask Sources=""@(Coll1->'Foo%(Name)Bar')"" >
<Output TaskParameter=""Output"" ItemName=""FinalList"" />
</BatchingTestTask>
</Target>
</Project>";
Engine engine = new Engine (Consts.BinPath);
Project project = engine.CreateNewProject ();
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
project.LoadXml (projectString);
bool result = project.Build ("ShowMessage");
if (!result) {
logger.DumpMessages ();
Assert.Fail ("A1: Build failed");
}
logger.DumpMessages ();
BuildItemGroup include = project.GetEvaluatedItemsByName ("FinalList");
Assert.AreEqual (3, include.Count, "A2");
}
[Test]
public void TestInitialTargets ()
{
@@ -1475,6 +1520,211 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
}
}
[Test]
public void TestRequiredTask_String1 ()
{
CheckProjectForRequiredTests ("RequiredTestTask_String", "@(NonExistant)",
false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String");
}
[Test]
public void TestRequiredTask_String2 ()
{
CheckProjectForRequiredTests ("RequiredTestTask_String", "$(NonExistant)",
false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String");
}
[Test]
public void TestRequiredTask_TaskItem1 ()
{
Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItem", "@(NonExistant)",
false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem");
}
[Test]
public void TestRequiredTask_TaskItem2 ()
{
Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItem", "$(NonExistant)",
false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem");
}
[Test]
public void TestRequiredTask_TaskItemArray1 ()
{
Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItems", "@(NonExistant)",
true, "Build failed");
BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
Assert.AreEqual (1, group.Count, "A2");
Assert.AreEqual ("count: 0", group [0].FinalItemSpec, "A3");
}
[Test]
public void TestRequiredTask_TaskItemArray2 ()
{
Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItems", "$(NonExistant)",
true, "Build failed");
BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
Assert.AreEqual (1, group.Count, "A2");
Assert.AreEqual ("count: 0", group [0].FinalItemSpec, "A3");
}
[Test]
public void TestRequiredTask_TaskItemArray3 ()
{
Project p = CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "$(NonExistant)",
true, "Build failed");
BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
Assert.AreEqual (1, group.Count, "A2");
Assert.AreEqual ("count: 0", group [0].FinalItemSpec, "A3");
}
// full solution test
//[Test]
public void TestBuildSolutionProject ()
{
string basepath = Path.Combine ("Test", Path.Combine ("resources", "Project01"));
string [] project_dirs = new string [] {
Path.Combine (basepath, "Lib4"),
Path.Combine (basepath, "Lib3"),
Path.Combine (basepath, "Lib2"),
Path.Combine (basepath, "Lib1"),
Path.Combine (basepath, "Project01")
};
string debug_extn = Consts.RunningOnMono () ? ".dll.mdb" : ".pdb";
// List of expected output files
// Lib3
string [] [] project_files = new string [5][] {
new string [] { "Lib4.dll", "Lib4" + debug_extn },
new string [] { "Lib3.dll" , "Lib3" + debug_extn },
// Lib2
new string [] {
"Lib2.dll", "Lib2" + debug_extn,
"lib2_folder/Lib2.deploy.txt",
Path.Combine ("fr-CA", "Lib2.resources.dll"),
Path.Combine ("fr-FR", "Lib2.resources.dll"),
"Lib4.dll", "Lib4" + debug_extn
},
// lib1
new string [] {
// lib1 files
"Lib1.dll", "Lib2" + debug_extn,
"Lib1.deploy.txt",
Path.Combine ("fr-CA", "Lib1.resources.dll"),
Path.Combine ("fr-FR", "Lib1.resources.dll"),
Path.Combine ("en-US", "Lib1.resources.dll"),
// lib2 files
"Lib2.dll", "Lib2" + debug_extn,
"lib2_folder/Lib2.deploy.txt",
Path.Combine ("fr-CA", "Lib2.resources.dll"),
Path.Combine ("fr-FR", "Lib2.resources.dll"),
// lib3 files
"Lib3.dll", "Lib3" + debug_extn,
"Lib4.dll", "Lib4" + debug_extn
},
new string [] {
"Project01.exe",
"Project01" + (Consts.RunningOnMono () ? ".exe.mdb" : ".pdb"),
// lib1 files
"Lib1.dll", "Lib1" + debug_extn,
"Lib1.deploy.txt",
Path.Combine ("fr-CA", "Lib1.resources.dll"),
Path.Combine ("fr-FR", "Lib1.resources.dll"),
Path.Combine ("en-US", "Lib1.resources.dll"),
// lib2 files
"Lib2.dll", "Lib2" + debug_extn,
"lib2_folder/Lib2.deploy.txt",
Path.Combine ("fr-CA", "Lib2.resources.dll"),
Path.Combine ("fr-FR", "Lib2.resources.dll"),
"Lib4.dll", "Lib4" + debug_extn,
}
};
// Cleanup
for (int i = 0; i < project_dirs.Length; i ++) {
string bin_path = Path.Combine (project_dirs [i], Path.Combine ("bin", "Debug"));
string obj_path = Path.Combine (project_dirs [i], Path.Combine ("obj", "Debug"));
DeleteAllInDir (bin_path);
DeleteAllInDir (obj_path);
}
Engine engine = new Engine (Consts.BinPath);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
engine.GlobalProperties = new BuildPropertyGroup ();
engine.GlobalProperties.SetProperty ("TreatWarningsAsErrors", "false");
Project project = engine.CreateNewProject ();
project.Load (Path.Combine (basepath, "Project01.sln.proj"));
bool result = project.Build ();
if (!result) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
// We check only the output dir, not the 'obj'
string debug = Path.Combine ("bin", "Debug");
for (int i = 0; i < project_dirs.Length; i++) {
CheckFilesExistInDir (Path.Combine (project_dirs [i], debug),
project_files [i]);
}
}
void DeleteAllInDir (string path)
{
if (!Directory.Exists (path))
return;
foreach (string file in Directory.GetFiles (path))
File.Delete (file);
Directory.Delete (path, true);
}
void CheckFilesExistInDir (string dir, params string [] files)
{
foreach (string file in files) {
string path = Path.Combine (dir, file);
Assert.IsTrue (File.Exists (path),
String.Format ("Expected to find file {0}", path));
}
}
Project CheckProjectForRequiredTests (string taskname, string property_arg, bool expected_result, string error_msg)
{
string projectString = String.Format (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<UsingTask TaskName=""{0}"" AssemblyFile=""Test/resources/TestTasks.dll"" />
<Target Name=""foo"">
<{0} Property=""{1}"">
<Output TaskParameter=""Output"" ItemName=""OutItem""/>
</{0}>
</Target>
</Project>", taskname, property_arg);
Engine engine = new Engine (Consts.BinPath);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
Project project = engine.CreateNewProject ();
project.LoadXml (projectString);
try {
Assert.AreEqual (expected_result, project.Build (), error_msg);
} finally {
logger.DumpMessages ();
}
return project;
}
static void CheckBuildItem (BuildItem item, string name, string [,] metadata, string finalItemSpec, string prefix)
{
Assert.AreEqual (name, item.Name, prefix + "#1");
@@ -234,5 +234,141 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.Targets.CopyTo (t, 0);
t [0].RemoveTask (null);
}
[Test]
public void TestTargetOutputs1 ()
{
Engine engine;
Project project;
string documentString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
<fruit Include=""apple""/>
<fruit Include=""rhubarb""/>
<fruit Include=""apricot""/>
</ItemGroup>
<Target Name=""Main"">
<CallTarget Targets=""foo"">
<Output TaskParameter=""TargetOutputs"" ItemName=""AllOut""/>
</CallTarget>
<CallTarget Targets=""foo"">
<Output TaskParameter=""TargetOutputs"" ItemName=""AllOut""/>
</CallTarget>
<Message Text=""AllOut: @(AllOut)""/>
</Target>
<Target Name=""foo"" Outputs=""@(FooItem)"">
<Message Text=""foo called""/>
<CreateItem Include=""%(fruit.Identity)"">
<Output TaskParameter=""Include"" ItemName=""FooItem""/>
</CreateItem>
<Message Text=""FooItem: @(FooItem)""/>
</Target>
</Project>";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
bool result = project.Build ("Main");
if (!result) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
try {
Assert.AreEqual (3, logger.NormalMessageCount, "Expected number of messages");
logger.CheckLoggedMessageHead ("foo called", "A1");
logger.CheckLoggedMessageHead ("FooItem: apple;rhubarb;apricot", "A2");
logger.CheckLoggedMessageHead ("AllOut: apple;rhubarb;apricot;apple;rhubarb;apricot", "A3");
Assert.AreEqual (0, logger.NormalMessageCount, "Extra messages found");
Assert.AreEqual (2, logger.TargetStarted, "TargetStarted count");
Assert.AreEqual (2, logger.TargetFinished, "TargetFinished count");
Assert.AreEqual (8, logger.TaskStarted, "TaskStarted count");
Assert.AreEqual (8, logger.TaskFinished, "TaskFinished count");
} catch (AssertionException) {
logger.DumpMessages ();
throw;
}
}
[Test]
public void TestTargetOutputsIncludingMetadata ()
{
Engine engine;
Project project;
string documentString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
<fruit Include=""apple""><md>a</md></fruit>
<fruit Include=""rhubarb""><md>b</md></fruit>
<fruit Include=""apricot""><md>c</md></fruit>
</ItemGroup>
<Target Name=""Main"">
<CallTarget Targets=""foo"">
<Output TaskParameter=""TargetOutputs"" ItemName=""AllOut""/>
</CallTarget>
<CallTarget Targets=""foo"">
<Output TaskParameter=""TargetOutputs"" ItemName=""AllOut""/>
</CallTarget>
<Message Text=""AllOut: @(AllOut) metadata: %(AllOut.md)""/>
</Target>
<Target Name=""foo"" Outputs=""@(FooItem)"">
<Message Text=""foo called""/>
<CreateItem Include=""@(fruit)"">
<Output TaskParameter=""Include"" ItemName=""FooItem""/>
</CreateItem>
<Message Text=""FooItem: @(FooItem) metadata: %(FooItem.md)""/>
</Target>
</Project>";
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
bool result = project.Build ("Main");
if (!result) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
try {
logger.CheckLoggedMessageHead ("foo called", "A1");
logger.CheckLoggedMessageHead ("FooItem: apple metadata: a", "A2");
logger.CheckLoggedMessageHead ("FooItem: rhubarb metadata: b", "A3");
logger.CheckLoggedMessageHead ("FooItem: apricot metadata: c", "A4");
logger.CheckLoggedMessageHead ("AllOut: apple;apple metadata: a", "A5");
logger.CheckLoggedMessageHead ("AllOut: rhubarb;rhubarb metadata: b", "A6");
logger.CheckLoggedMessageHead ("AllOut: apricot;apricot metadata: c", "A7");
Assert.AreEqual (0, logger.NormalMessageCount, "Extra messages found");
Assert.AreEqual (2, logger.TargetStarted, "TargetStarted count");
Assert.AreEqual (2, logger.TargetFinished, "TargetFinished count");
Assert.AreEqual (10, logger.TaskStarted, "TaskStarted count");
Assert.AreEqual (10, logger.TaskFinished, "TaskFinished count");
} catch (AssertionException) {
logger.DumpMessages ();
throw;
}
}
}
}
Loaded 100 of 817 files, more files were not shown because too many files have changed in this diff. Show more