Compare commits

..
652 Commits
Author SHA1 Message Date
Rodrigo Kumpera 66187b25b6 Use wrappers for accessing socket errors. Cygwin does not have some errors in errno.h. Fixes Windows build. 2011-07-29 13:42:25 -03:00
Rodrigo Kumpera f3deab1057 OSX won't expose IPV6_PKTINFO unless __APPLE_USE_RFC_3542 is defined. 2011-07-28 15:23:36 -03:00
Rodrigo Kumpera 5a9f5defc3 Handle a race on thread cleanup.
* mini.c (mini_thread_cleanup): Under some rare cases it's
	possible to have a NULL lmf.
2011-07-28 15:23:33 -03:00
Alex Corrado e43a74ae3f 2.10.3 2011-07-27 19:07:46 -04:00
Jérémie Laval 06cd95ea65 Same test for TaskCompletionSource 2011-07-27 19:52:01 -04:00
Jérémie Laval 7d088a3f17 Ensure that Task is in a correct initial state before starting it for real 2011-07-27 19:36:40 -04:00
Jérémie Laval 0ddabfc4ab Test that futures throw Exception through Result property when they are Faulted 2011-07-27 19:35:50 -04:00
Jérémie Laval 8078626d49 Add test for various AggregateException ctor exception situations 2011-07-27 18:32:05 -04:00
Jérémie Laval ffad7f7365 Move innerExceptions internal null check at the right place. 2011-07-27 18:21:36 -04:00
Jérémie Laval da2f5156b2 Add testcase to ensure unobserved exception on Task are correctly propagated 2011-07-27 18:12:23 -04:00
Jérémie Laval e3578fe451 Makes AggregateException ToString output closer to .NET one 2011-07-27 18:03:28 -04:00
Jérémie Laval 036c395d3c Fix AggregateException behavior 2011-07-27 18:03:24 -04:00
Jérémie Laval 474417efb7 Allow using a worker number that is greater than Environment.ProcessorCount for parallel loops. 2011-07-27 16:24:08 -04:00
Atsushi Eno 23263e537f Fix wsdl import wrt element qname (!= type name). 2011-07-27 21:05:56 -07:00
Jeffrey Stedfast c98cedfc91 Don't invoke libc uname() on non-Unix systems 2011-07-26 18:41:49 -04:00
Mark Probst 2228af8148 [sgen] Use the proper object size when scanning arrays from a card table.
Using the block object size is incorrect since we might scan beyond
the end of the array.
2011-07-26 18:28:23 +02:00
Mark Probst c6bbff5b5e [sgen] Make the card table on AMD64 correct for 64 bit nursery addresses. 2011-07-26 18:25:46 +02:00
Mark Probst 1b58ec73aa [sgen] Make mono_sgen_safe_object_get_size() handle forwarded objects.
This is sometimes called on forwarded objects from the major collector
during finalization.  Now it doesn't crash anymore.
2011-07-26 18:24:09 +02:00
Miguel de Icaza f49164bf76 Fix invocation to syslog 2011-07-25 19:10:07 -04:00
Atsushi Eno 1ae6c346f6 Fix bug #16: use Owner node instead of Parent. Patch by Martin Potter. 2011-07-26 04:25:00 +09:00
Sebastien Pouliot 45064beb94 Fixed decoding of PKCS/CMS message with detached ContentInfo. Pull request from Pablo Ruiz Garcia <[email protected]> 2011-07-25 10:32:46 -04:00
Duane Wandless 8bd7d107a8 Fix crash on Lion when exiting 2011-07-24 15:59:41 -03:00
Geoff Norton d465c35811 Fix configure check for darwin to support all variants 2011-07-24 15:59:40 -03:00
Zoltan Varga fcff387c6a Fix a crash in the soft-float decompose code when a branch following an fcompare is optimized away. Fixes #705186. 2011-07-24 20:45:24 +02:00
Atsushi Eno 513122c74e Avoid possible duplicate xmlns output. Fixes xsp-based hosting somehow. 2011-07-22 14:04:08 +09:00
Atsushi Eno d68521e673 Fix bug #703910 - implement Order support in XmlSerializer. 2011-07-21 04:58:51 +09:00
Marek Safar c5302ba6b6 Merge pull request #135 from eue/mono-2-10
-checked command-line option
2011-07-20 01:10:43 -07:00
Martinho Fernandes 70352e16a9 Test for bug #706877 2011-07-20 09:02:23 +01:00
Martinho Fernandes 150ea5489d [Fix] Command-line option -checked now works (bug #706877)
The -checked option was not being considered in the BuilderContext.
Now it is set on construction of BuilderContext to the value from RootContext.
2011-07-20 09:01:24 +01:00
Atsushi Eno dd4afcfa02 fix build regarding ContentType. 2011-07-19 10:03:37 +09:00
Atsushi Eno a15e2d0bec support action parameter in SOAP 1.2 content type. Close pull request #133. 2011-07-19 02:30:11 +09:00
Rodrigo Kumpera 1e7567b332 Merge pull request #132 from ngraziano/fb497cbb6503c2a0913fddba700079608bcd8892
"make dist" do not work in branch mono-2-10
2011-07-18 07:19:38 -07:00
Atsushi Eno 1dba37de1c Fix bug 704813: just ignore members of type IEnumerable`1 without Add(). 2011-07-16 06:51:45 -07:00
Rodrigo Kumpera bfdd13a52c If a thread abort is fatal, print the exception before dying. 2011-07-15 18:16:36 -03:00
Rodrigo Kumpera a26b65f6b3 Improve stacktraces when facing a runtime invoke wrapper.
* mini-exceptions.c (mono_handle_exception_internal_first_pass):
	Don't trim the trace list if we find a filter clause from a wrapper.
	This makes stacktraces across MRI's work.
	Extract trace trimming into a macro to reduce code duplication.
2011-07-15 18:10:40 -03:00
Rodrigo Kumpera 36f12fc250 Avoid a .cctor on the initialization path. 2011-07-12 19:50:46 -03:00
Rodrigo Kumpera 8c253ee6c3 Add shared_perfcounters option to enable minimal. 2011-07-12 19:50:44 -03:00
Nicolas Graziano fb497cbb65 Correct the include files Platform is not in test. 2011-07-12 16:01:05 +02:00
Rodrigo Kumpera 11bacf8e1b Do DISABLE_PORTABILITY more agressively. 2011-07-12 01:35:35 -03:00
Zoltan Varga 2599353bc0 Add a test for 7cb704d9a9. 2011-07-12 03:19:10 +02:00
Zoltan Varga 9f92b788d8 Avoid register allocation problems when a try clause is nested inside a handler block. 2011-07-12 02:09:27 +02:00
Zoltan Varga c584c82e0d Fix the length of r4const on arm. 2011-07-11 17:11:00 +02:00
Zoltan Varga aa4803c5a4 Fix caching in mono_marshal_get_array_address (). 2011-07-11 00:25:52 +02:00
Zoltan Varga 816556dbb8 Use TARGET_ANDROID instead of PLATFORM_ANDROID in one place. 2011-07-11 00:25:50 +02:00
Zoltan Varga d9ecc66fb6 Really fix the -Wno-unused-but-set-variable check. 2011-07-11 00:25:49 +02:00
Zoltan Varga f333e91d0a Clean up the cross-compile configure.in code. Add a TARGET_ANDROID define. 2011-07-11 00:25:49 +02:00
Rodrigo Kumpera f87620d145 Fix signal chaining to handle a stupid previous handler. 2011-07-09 13:40:43 -03:00
Rodrigo Kumpera 8bd567de14 Arm has MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX. This gives us nice stacktraces on unhandles exceptions. 2011-07-09 13:40:36 -03:00
Rodrigo Kumpera 28a61a5d55 Disable the exception thread under iOS since it's neither needed nor working. 2011-07-09 13:40:29 -03:00
Atsushi Eno d25c23dc46 Full equivalence comparison is unnecessary for MessageEncoder ContentType.
based on https://github.com/mono/mono/pull/130
2011-07-09 06:52:43 +09:00
Jeffrey Stedfast 481881bdf7 Reverted previous commit, struct sizes vary way too much between platforms 2011-07-06 18:20:20 -04:00
Jeffrey Stedfast 44ab43948a Use a struct utsname when calling uname() instead of an 8K buffer 2011-07-06 18:07:34 -04:00
Jeffrey Stedfast 643c0f0cba Add System/Platform.cs to *System*.dll.sources 2011-07-06 13:30:06 -04:00
Jeffrey Stedfast da0d698fce Make internal Platform class static 2011-07-06 12:43:49 -04:00
Jeffrey Stedfast 6f1458dea4 Load the correct type on MacOSX (as opposed to iOS) 2011-07-06 12:04:34 -04:00
Jeffrey Stedfast 72e554c612 Implemented a shared way to detect MacOSX for System.dll 2011-07-05 17:50:21 -04:00
Jeffrey Stedfast e54a124e71 Doh, do proper OSX detection 2011-07-05 17:00:16 -04:00
Jeffrey Stedfast 62e6bd03f6 Use runtime checks to decide to use CoreFoundation.CFNetwork.GetDefaultProxy() 2011-07-05 16:30:50 -04:00
Jeffrey Stedfast be2e765af8 On MonoTouch, call CoreFoundation.CFNetwork.GetDefaultProxy() to get the default proxy 2011-07-05 13:56:51 -04:00
Marek Habersack c5b95f4bbb [asp.net] Added FormsAuthentication.Timeout 4.0 property 2011-07-01 00:01:19 +02:00
Jb Evain b8e85ce171 Fix handling of null in the non generic implementation of EqualityComparer. Fixes 703027. 2011-06-30 01:25:34 +02:00
Jackson Harper a2b093a9a1 We can accidently swallow out of FD errors here since this function is called from a threadpool thread. 2011-06-28 23:25:15 -04:00
Atsushi Eno 8481eefe9f Implement support for Stream param with WebHttpBinding raw content format. 2011-06-28 20:45:37 +09:00
Atsushi Eno 9f612740f7 Implement support for generic data contract type name with "{x}". 2011-06-28 18:03:49 +09:00
Jb Evain cb4b62c04b Fix queryable enumerable expression transformation 2011-06-23 00:33:09 +02:00
Jb Evain c51e257674 Don't emit null queryable constants when rewriting linq queries, fix #701187 2011-06-23 00:20:13 +02:00
Sebastien Pouliot 40ca71a120 Merge pull request #119 from konrad-kruczynski/SslStreamNoTimeout
Removed hard coded timeout for SslStreamBase.
2011-06-22 06:25:06 -04:00
Michael Hutchinson cc81b58a0e Fix the cairo dllmap on OS X 2011-06-20 14:48:19 +01:00
XTZGZoReX 70640f232b Socket: Fixed a security issue when default-initialized ArraySegment structs are passed in.
This is the same security issue that was recently addressed in MS.NET.
2011-06-19 19:02:34 -04:00
Gonzalo Paniagua Javier 949e910102 Fix crash when there's a \' in the arguments.
Fixes crash when calling Process.Start on a file with a ' in the path
	when UseShellExecute is set to false.

	Patch by Tom Philpot.
2011-06-15 15:36:23 -04:00
Sebastien Pouliot 395aae632d Fix remaining moon-unit failures wrt Sockets changes
* System.Net.Sockets/Socket_2_1.cs: Ensure RemoteEndPoint is always
available after ConnectAsync (connected or not, allowed or not).
Ensure the Connect event is fired even if denied by policy.
2011-06-15 15:36:09 -04:00
Sebastien Pouliot ce9ff91f78 Fix copy-paste error in git 17085447
* System.Net.Sockets/Socket_2_1.cs: Fix some moved code (from
SocketAsyncEventArgs.cs) so should the references to RemoteEndPoint
still point to the SocketAsyncEventArgs instance. Fix some moon-unit
test failures
2011-06-15 15:36:09 -04:00
Zoltan Varga f1861e5cbe Apply a workaround for a gcc 4.6 problem on arm. 2011-06-15 17:31:35 +02:00
Atsushi Eno 79bca55588 Set "Encoder" property when Message was read from MessageEncoder. 2011-06-14 19:19:06 +09:00
Atsushi Eno 3e48da364b finally implement Message.ToString() as in expected form.
Regressions on this method has caused several unpredictable errors,
so I avoided this for somewhat long time...
2011-06-14 18:46:12 +09:00
Atsushi Eno 8b88042311 Flush some ongoing changes for XmlSerializer support in svcutil. 2011-06-14 18:01:07 +09:00
Rodrigo Kumpera 352e7d076d Allow AssemblyRef flags to have at least ECMA's values. Fixes #684613. 2011-06-13 16:38:59 -03:00
Atsushi Eno d4a6887c31 Fix 2.0 build. 2011-06-13 21:36:47 +09:00
Atsushi Eno 6813d3f09b Implement OnWriteBodyContents() and add message buffer support for RawMessage. 2011-06-13 20:07:53 +09:00
Marek Habersack 81d20479d4 [asp.net] Construct properly rooted paths when assigning values from resources 2011-06-13 12:39:23 +02:00
Zoltan Varga 1ff53bb1ba Add an assert to detect TLS mismatches between the aot compilation and runtime environment. 2011-06-12 18:47:17 +02:00
Sebastien Pouliot 927a76eb30 Fix namespace and avoid looping once ctor is found 2011-06-12 12:25:23 -04:00
Sebastien Pouliot 050abd469f Refactor MonoMac's MarkNSObjects substep so it can be reused in other products 2011-06-12 12:25:04 -04:00
Jb Evain 127c3bf6e0 update tuner 2011-06-12 12:24:41 -04:00
Jb Evain cbd9da1acf update tuner 2011-06-12 12:24:14 -04:00
Zoltan Varga 71b1425fd5 Fix the check for the -Wno-unused-but-set-variable gcc option. 2011-06-11 15:35:06 +02:00
Zoltan Varga 89424f5b25 Disable the -Wunused-by-set-variable warning supported by newer gcc versions. 2011-06-11 15:35:06 +02:00
Rodrigo Kumpera 86d31a6e3f Fix darwin-arm build. 2011-06-09 13:55:23 -03:00
Zoltan Varga 84265522ed Fix a corner case where an inlined bblock which had its next_bb set was the last bblock in a method. Fixes #693905. 2011-06-04 15:24:38 +02:00
Jonathan Pryor 662a9ac8f7 Allow Android'd support_boehm=no to work.
The AC_ARG_ENABLE(boehm, ..., ..., support_boehm=yes) resulted in
support_boehm always being 'yes', even for `--host=arm-linux-androidabi`,
which was not the intention. Using `support_boehm=${support_boehm:-yes}`
generates correct behavior.
2011-06-03 17:19:43 -04:00
Jonathan Pryor 33068b3d07 Simplify building with the Android NDK.
Check --host against *-*-linux-android* for Android-specific configure fixes,
and improve **/Makefile.am to simplify Android support:

	./configure \
		--build=`./config.guess` \
		--host=armv5-linux-androideabi \
		--target=armv5-linux-androideabi \
		--enable-nls=no --with-mcs-docs=no --enable-mcs-build=no \
		CC="/path/to/ndk/arm-linux-androideabi-gcc --sysroot=/path/to/sysroot" \
		AR="..." AS="..." CPP="..." CXX="..." LD="..." RANLIB="..." STRIP="..."
		CFLAGS="-DARM_FPU_NONE=1" CXXFLAGS="-DARM_FPU_NONE=1"

See also Android NDK docs/STANDALONE-TOOLCHAIN.html.

The Android NDK/bionic is "interesting", in that it's lacking header files and
macros normally present on Linux which otherwise break the build (e.g. no
<link.h> which breaks Boehm support).  Using --host with an android target
works around the known issues, simplifying the building of libmonosgen-2.0.so
with the Android NDK toolchain.
2011-06-03 16:58:08 -04:00
Atsushi Eno db9f31cbd1 Support RemoteEndpointMessageProperty. 2011-06-03 19:47:40 +09:00
Zoltan Varga 5b3336a997 Fix the previous change. 2011-06-03 12:29:17 +02:00
Zoltan Varga 6920d7ce86 Fix NOMAP32BIT support in specific trampolines. 2011-06-02 23:42:46 +02:00
Rodrigo Kumpera 1da10df16c Handle a vtable layout corner case.
class.c (mono_class_inflate_generic_method_full_checked): Don't
	inflate a method if the provided context won't change it.
	This change, in particular, avoid inflating a generic method
	of a non-generic class if the context has class only vars.

	This fixes #696593 as the above was causing the vtable of
	Class3 ending up with an inflated Class1::Method<> that
	comes from inflated Class2<object> parent.
	Then the parent override pass would collect a non-inflated
	Class1::Method<> overide that would then not match the one
	on the vtable causing Class3 to have an abstract method on
	its vtable and thus failing to load.

	Big explanation means tricky change, might break tons of stuff.
2011-06-01 15:04:34 -03:00
Atsushi Eno 7f2cf89aeb Support WebHttpBinding configuration. 2011-05-31 20:58:05 +09:00
Atsushi Eno 3e629f2ac7 Ref parameter was not covered by ParameterInfo.IsOut. Fixed bug #696784. 2011-05-31 18:55:09 +09:00
Rodrigo Kumpera 3c5a13fa39 Properly handle field RVA under moving collector.
* reflection.c (typebuilder_setup_fields): Alloc RVA data
	on the image mempool so it works with a moving collector.

	Fixes #696817
2011-05-30 18:34:03 -03:00
Rodrigo Kumpera 46c26749eb Fix sgen under xen 2011-05-30 12:23:35 -03:00
Atsushi Eno a2d8112081 Add test for XmlMembersMapping.TypeName and .Namespace (not very useful yet...) 2011-05-27 17:30:12 +09:00
Atsushi Eno bb331ddde1 Fill type info in MessagePartDescription from XmlSerializer-based wsdl importer.
It still needs some fixes to import message elements.
2011-05-27 17:27:01 +09:00
Rodrigo Kumpera 300bc2d4b0 Fix mul_imm under amd64 2011-05-25 15:09:28 -03:00
Marek Habersack f88fba3cbd [asp.net] Don't throw an exception if a session item being released does not have a lock.
It can happen when the item is being released after its associated session has ended.
2011-05-24 11:14:33 +02:00
Atsushi Eno 7b58e280a5 Support named wildcard in UriTemplate matching. Fixed bug #693996. 2011-05-23 20:32:11 +09:00
Atsushi Eno 8dd637646f Look for KnownTypeAttributes on known types (recursively). Fixed bug #695203. 2011-05-23 19:29:28 +09:00
Atsushi Eno 77625cbc89 Allow DocumentType in ImportNode().
http://lists.ximian.com/pipermail/mono-devel-list/2011-May/037575.html
2011-05-19 13:18:20 +09:00
Marek Habersack b122da385a [asp.net] Ignore JavaScript blocks enclosed in HTML comments 2011-05-19 03:37:44 +02:00
Marek Habersack eac15568e2 [runtime] When shadow-copying assemblies, use the io portability function to find the file.
This is necessary in situations when managed code pases case-insenstive file name and the
file on disk uses different case. stat(2) would return an error in such situation and, in effect,
the stat structure would get invalid/random values in its fields.
2011-05-18 22:05:40 +02:00
Atsushi Eno fb67d391a3 Check invalid recursion of xs:group use. Fixed bug #650117. 2011-05-18 01:11:34 +09:00
Marek Habersack 7129d57c22 [asp.net] Fix for bug #650847. Output both tagged and untagged UpdatePanel names in AJAX responses.
Also, update panels which rendered empty string are included in the output.
2011-05-16 16:15:03 +02:00
Atsushi Eno 9e88fe782a Do not import xs:any member as XmlElement[]. Create a wrapper class instead.
Part of bugfix #670945.
2011-05-16 18:47:11 +09:00
Atsushi Eno 91de42214b (manually) Merge pull request #101 from occ/master
Decimal support to XmlBinaryDictionaryReader
2011-05-16 16:41:27 +09:00
Zoltan Varga 02b82fb567 Avoid a crash in Field:GetRawConstantValue () if the field type couldn't be loaded. Fixes #693894. 2011-05-15 13:05:14 +02:00
Atsushi Eno 9fc2d82c3b Implement XmlSerializerMessageContractImporter, round 2.
This time it is XmlSerializer-based, got it somewhat working.
2011-05-14 01:30:21 +09:00
Atsushi Eno 1aebe941ef Do not take host part into consideration on comparing URLs.
It blocks access by different host name (e.g. localhost vs. IP).
This was part of bugfix #687580 (forgot to commit).
2011-05-13 21:55:30 +09:00
Atsushi Eno 9c1b923e99 Implement WsdlContractConversionContext, and ignore message importer for now. 2011-05-13 21:48:41 +09:00
Atsushi Eno 6adda4d4c0 Revert previous XmlSerializerMessageContractImporter implementation.
XsdDataContractImporter is not XmlSerializer-based, while this class is.
2011-05-11 18:42:45 +09:00
Atsushi Eno 5a8f29cbcc Add PipeException. fixed bug #692987 by Eberhard Beilharz. 2011-05-11 16:56:58 +09:00
Atsushi Eno aa2208afee Fixed orders in XmlSchemaObjectTable and got some S.R.Serialization tests working. 2011-05-11 16:37:04 +09:00
Atsushi Eno a1e3732cef CanImport() just returns false, without throwing error. 2011-05-10 22:04:10 +09:00
Atsushi Eno 8bb3b4db45 support import of xs:anyType, as well as make couple of minor fixes. 2011-05-10 21:47:58 +09:00
Atsushi Eno 240c0124a6 Fix common issue in MetadataSet - call MoveToContent() while iterating nodes. 2011-05-10 20:00:38 +09:00
Atsushi Eno 52965a2b9d Add new MetadataSetTest and fix couple of minor issues. 2011-05-10 19:36:26 +09:00
Atsushi Eno bed33dd66b Revive this test by implementing mock web server. 2011-05-10 19:36:16 +09:00
Atsushi Eno c0f3997eaf Add (not-working) callback instance context mode test and FIXME comment. 2011-05-10 19:36:05 +09:00
Atsushi Eno 29adf41cc2 Update XsdDataContractImporter.CanImport and implement ImportXmlType. 2011-05-10 17:42:03 +09:00
Atsushi Eno 0f6b274a8e ongoing XmlSerializerMessageContractImporter work.
It is part of bugfix #670945.
2011-05-09 23:00:39 +09:00
Atsushi Eno 34b7d3a84d Multiple schemas in wsdl could share same SourceUri, so check more identity.
Part of bugfix #670945.
2011-05-09 19:12:09 +09:00
Atsushi Eno 3afbf58c92 Allow xsi:nil for void. Fixed client side of bug #687580. 2011-05-09 13:52:09 +09:00
Atsushi Eno 9193bf8f3f Now our HttpListener can listen to wildcard prefix safely.
Fixed server part of bug #687580.
2011-05-09 13:43:12 +09:00
Rodrigo Kumpera 2b487789c8 Workaround io-layer crashing when the runtime exit without cleaning up everything.
* handles.c (handle_cleanup): When the runtime exit(), not
	everything is shutdown and the main thread might be waiting
	on other threads to finish. On this case, io-layer cleanup
	with assert as a mutex will be in use.
	The work-around is to be lenient to busy resources during
	shutdown.
2011-05-07 00:13:11 +02:00
Lluis Sanchez 6b6ce9bd43 [Web Services] Fix regression caused by previous commit
Fixes a regression caused by the implementation of support
for optional parameters. GlobalIndex was not being set
when using SOAP RPC protocol.
2011-05-06 18:45:30 +02:00
Veerapuram Varadhan fbe4e20182 [ado.net]bugfix:688773 - Assign default value to columns that does not
exist in the row that is being imported.
2011-05-06 00:06:23 +05:30
Veerapuram Varadhan d753eb1861 [ado.net]bugfix:681916 - Based on patch by Scott <[email protected]>
- Handle null values for parameter types varbinary(max) and/or image
2011-05-06 00:05:31 +05:30
Veerapuram Varadhan aac2016aa9 [mono]bugfix:663287 - Validate the type of value against underlyingtype
instead of nullableType.
2011-05-06 00:03:42 +05:30
Veerapuram Varadhan 2ec26f2e77 [ado.net][OracleClient] - Fixes calling size_t native parameters by
passing UIntPtr reference types and hence, solves 32/64 bit and
little/big-endian issues.
2011-05-05 23:51:14 +05:30
Veerapuram Varadhan 9e48c8a2b0 [bugfix][ado.net]Fixes 663914 - Restore original column data for
unchanged columns during deserialization.
2011-05-05 23:41:39 +05:30
Marek Habersack f1ab82a7e8 [corlib] Do not cache disposed resource sets. 2011-05-04 23:33:11 +02:00
Marek Habersack c4a3ecad74 [asp.net] Do not retrieve script's URL in RegisterScriptReference if script.Path is set. 2011-05-04 23:33:04 +02:00
Martin Baulig 844d678cba Add socket timeouts to the soft debugger.
SDB now support setting a send/receive timeout on the client's side
of the communication socket.  To make this work, the server sends
a special 'keepalive' event when using receive timeouts.

There's a new method VirtualMachine.SetSocketTimeouts() to enable
this feature.
2011-05-03 13:53:37 +02:00
Rodrigo Kumpera d3c5cc1fe5 Add regression test for #691057 2011-05-03 02:58:48 -03:00
Rodrigo Kumpera 01cf5ded25 Fix a couple of issues on Mono.Simd.
* local-propagation.c (mono_local_deadce): Don't perform
	reverse copyprop on simd insert ops. The backend requires
	dreg and sreg1 to match.

	* mini-x86.c (mono_arch_output_basic_block): Fix insert_r8_slow
	for the X element.

	Fixes a few bugs due to #691057
2011-05-03 01:23:20 -03:00
Zoltan Varga 399a6c779e Implement BSTR icalls even when COM is disabled. Fixes #690255. 2011-05-03 01:03:43 +02:00
Gonzalo Paniagua Javier 516cbf29c4 Don't set NoDelay twice. 2011-05-02 12:12:09 +02:00
Jb Evain 63fc3530b9 Fix non net_4_0 profiles build 2011-05-02 11:58:52 +02:00
Jb Evain 0ae09ac40d Properly check the maxstacksize asked for the Thread 2011-05-02 11:46:09 +02:00
Zoltan Varga c9cb0a918b Fix support for parameters with generic constraints in Type.IsAssignableFrom (). Fixes #691119. 2011-05-02 09:41:18 +02:00
Geoff Norton c538edd457 Avoid doubly declaring some types in the 2.1 profile for mobile 2011-04-30 11:48:59 -04:00
Gonzalo Paniagua Javier 718f02e0d3 Fix prefix selection
We were picking the wrong prefix when the URL matched the path.
	Fixes bug #688860.
2011-04-30 11:34:54 +02:00
Gonzalo Paniagua Javier f3560b3f22 Support FTP + RETR + proxy
Fixes bug #690887.
2011-04-30 11:08:55 +02:00
Gonzalo Paniagua Javier 8b18364cfb Missed this in the backport 2011-04-30 06:59:20 +02:00
Geoff Norton e7ff9bcf14 Remove debug spew 2011-04-29 17:52:33 -04:00
Geoff Norton 546a888f91 [boehm] Avoid a ENOMEM when allocating across an unallocated page
A very rare allocation pattern could cause the boehm free list to call
the GC_unmap_gap function, which actually calls down into munmap().
Darwins virtual memory manager will return a KERN_INVALID_ADDRESS
which is translated into a ENOMEM, if mprotect attempts to change
the protection of a range which includes an unallocated page.
We address this by just mmap() back to ANON, instead of actually
unallocating the page.
2011-04-29 16:23:15 -04:00
Gonzalo Paniagua Javier b0c3795ac4 [webclient] Process uri.UserInfo when present
If there are no crendetials, the Uri might have them.
	Based on a patch by QuickJack.
	Fixes bug #688007.
2011-04-29 11:55:17 +02:00
Geoff Norton 19f4433ef2 Avoid a needless buffer copy that is susceptible to overflow 2011-04-28 23:05:15 -04:00
Zoltan Varga b09e63d792 Fix loading from volatile base addresses in the LLVM backend. Fixes #690020. 2011-04-28 23:46:42 +02:00
Zoltan Varga 5e04bc52bb Revert "Modify fixup_cattrs () to handle a corner case where a cattr is created using a MonoCMethod instead of a ConstructorBuilder. Fixes #689533."
This reverts commit 046ff98055.

This seems to break smcs.exe.
2011-04-28 22:28:00 +02:00
Lluis Sanchez 2773f9f10a [Web.Services] Add support for optional parameters
Non-nullable web service parameters can be made optional by
adding an additional parameter with the same name and a
'Specified' suffix. This was supported when serializing
classes, but not when serializing web service parameters.
This might fix bug 688496.
2011-04-28 18:34:16 +02:00
Atsushi Eno cf183438ee Looks like xs:any is allowed under certain condition in XsdDataContractImporter.
But I don't understand why :(
2011-04-28 23:41:43 +09:00
Atsushi Eno c18ad33d44 moonlight does not like XmlSchemaType but nasty code in KnownTypeCollection :( 2011-04-28 22:10:06 +09:00
Atsushi Eno 9956130fa2 ...and do return Type for all known xs:* types in XsdDataContractImporter. 2011-04-28 20:33:47 +09:00
Atsushi Eno 50ad936a80 Do not reject xsd:* types that are not listed in KnownTypeCollection.
e.g. xs:token.
2011-04-28 20:09:05 +09:00
Atsushi Eno acb4203da5 support <service>-less wsdls in svcutil. Look for portTypes instead. 2011-04-28 19:54:48 +09:00
Atsushi Eno a6e6fbbeb3 Extend supported XmlDateTimeSerialization formats. Fixed bug #690475. 2011-04-28 17:37:33 +09:00
Atsushi Eno 02e0ab3df8 XmlSerializer code generator was generating wrong char literal.
Fixed bug #673019.
2011-04-28 15:44:18 +09:00
Gonzalo Paniagua Javier a66df5bf91 [socket] More BeginConnect (IPAddress []) work
When trying multiple addresses, the second and sucessive calls to
	BeginConnect(IPAddress) will cause an error which we would have to
	ignore and then retry. Since this behavior is not documented, we just
	close the socket and open a new one for retries is there is already a
	pending connect attempt.
2011-04-28 00:18:35 -04:00
Gonzalo Paniagua Javier ef49022f97 [Socket] Improved ConnectAsync
ConnectAsync() now uses the improved BeginConnect.
2011-04-28 00:18:35 -04:00
Atsushi Eno 4d2ff35b88 Remove non-existent test source (it is only in master). 2011-04-28 12:45:13 +09:00
Atsushi Eno 1e08457302 Handle fault messages in duplex callback channel. 2011-04-27 20:59:18 +09:00
Atsushi Eno 59dd3fcfe8 Use FindCritera/ResolveCriteria Duration properties for DiscoveryEndpoint timeout. 2011-04-27 15:43:46 +09:00
Atsushi Eno 35a659b435 Log UDP messages (using System.ServiceModel internals via IVT). 2011-04-27 15:43:39 +09:00
Gonzalo Paniagua Javier 01fff28591 If there's a delayed exception, clear 'ares' 2011-04-26 23:44:12 -04:00
Gonzalo Paniagua Javier acad9c91d0 Worked on linux, failed on OSX 2011-04-26 22:05:49 -04:00
Marek Habersack ea73a5a1e4 [asp.net] CreateChildControls is internal only when compiling system.web tests 2011-04-26 21:14:35 +02:00
Jérémie Laval 6c5f273c3f Fail gracefully when CancellationToken has been created uninitialized by user.
Also add corresponding unit test.
2011-04-26 17:03:26 +02:00
Jérémie Laval 512ca45eb9 Add CancellationToken unit tests 2011-04-26 17:03:26 +02:00
Jérémie Laval 67c3b641c2 Honors correctly canceled ctor parameter of CancellationToken 2011-04-26 17:03:26 +02:00
Gonzalo Paniagua Javier bb61f41996 Reset the blocking flag as soon as possible. 2011-04-26 11:03:00 -04:00
Gonzalo Paniagua Javier 8dfa7d2c7e [socket] Fixed other BeginConnect overloads
The BeginConnect overload taking an IPAddress[] was not really
	asynchronous.
2011-04-26 11:03:00 -04:00
Zoltan Varga 046ff98055 Modify fixup_cattrs () to handle a corner case where a cattr is created using a MonoCMethod instead of a ConstructorBuilder. Fixes #689533. 2011-04-26 13:26:54 +02:00
Atsushi Eno cde89bb093 Fix monodroid/monotouch build. 2011-04-26 19:39:10 +09:00
Gonzalo Paniagua Javier 9eb77b093b [Socket] Fix BeginConnect
Windows/Linux flagged the socket as writable even when connect() has
	not been called. On *BSD and OSX, this was not the case and we waited
	forever.

	Now, for blocking sockets, we make them blocking and call connect()
	before adding the socket to the wait pool.
2011-04-26 00:05:26 -04:00
Gonzalo Paniagua Javier 5e40958c3b In *AllLines use WriteLine instead of Write.
This fixes bug #689670.
2011-04-25 16:23:17 -04:00
Atsushi Eno 82b1e211f8 Log net.tcp transport messages too. 2011-04-25 18:31:01 +09:00
Atsushi Eno 3fd521bd7d Make our own simple log format actually diagnostics-compatible.
So MS ServiceTraceViewer.exe can open our log now.
2011-04-25 18:30:50 +09:00
Atsushi Eno cdc0fc4d45 Document MONO_WCF_TRACE environment variable. 2011-04-25 16:25:39 +09:00
Atsushi Eno 43c40b6f3d minor diagnostic log format brush up. 2011-04-25 16:15:08 +09:00
Atsushi Eno 2e5417f5bd Actual source directory changes after changing namespaces. 2011-04-25 15:57:59 +09:00
Atsushi Eno 247cef557f More nettcp namespace changes. 2011-04-25 15:57:49 +09:00
Atsushi Eno 0f328b26c0 Move NetTcp namespace to internal one. 2011-04-25 15:57:38 +09:00
Atsushi Eno 415027eedd Enable environment-controled output on non-moon profile too. Add error logging. 2011-04-25 15:38:39 +09:00
Miguel de Icaza 1223efd9ce Do not go beyond our string boundaries 2011-04-23 12:54:57 -04:00
Atsushi Eno 27e1844bb9 Log HTTP reply Message too. Make logging customizible on under the moon.
Logging is done only when requested by MOON_WCF_TRACE=[stdout|stderr]
environment variable.
2011-04-23 02:09:11 +09:00
Marek Habersack 054738b20f Fix compilation 2011-04-22 14:02:39 +02:00
Marek Habersack 58a60f9e5e [asp.net] Do nothing if null SessionStateStoreData is passed to SessionStateServerHandler.SetAndReleaseItemExclusive 2011-04-22 12:36:11 +02:00
Marek Habersack df413084ff [asp.net] Inform user about all exceptions thrown during HttpRuntime static initialization 2011-04-22 11:55:35 +02:00
Marek Habersack b029f4e97e [asp.net] Implemented composite scripts support in System.Web.Extensions 2011-04-22 11:55:15 +02:00
Zoltan Varga 4b98bcb536 Fix AOT support for isinst_with_cache wrappers. Fixes #687865. 2011-04-22 03:40:58 +02:00
Geoff Norton c597bb43ac We support hard breakpoints on arm, not sure why this is here at all 2011-04-21 15:00:42 -04:00
Atsushi Eno f66017dd16 Use XPathNavigator output in WCF diagnostics. Got sorta-valid message trace. 2011-04-21 21:12:48 +09:00
Atsushi Eno 0990c54b02 Fix wrapper elements. It should be <TraceData><DataItem>... 2011-04-21 21:09:48 +09:00
Atsushi Eno 1cf432ed50 XmlWriterTraceListener supports XPathNavigator as non-escaped xml output. 2011-04-21 20:56:09 +09:00
Marek Safar eb9c5951e6 [688891] Keep same TypeParameter ctor syntax 2011-04-21 10:11:11 +01:00
Marek Safar 6a1de942e0 [688891] Copy type parameters for base proxy method 2011-04-21 10:08:42 +01:00
Atsushi Eno b62fb2816f Use xmlns-ignoring XmlDocument derivation for config files. Fixed bug #641935. 2011-04-21 17:47:49 +09:00
Atsushi Eno d3a50832b1 RooArray types were rejected as unknown when it is at root. Fixed bug #688414. 2011-04-21 16:22:09 +09:00
Atsushi Eno d911500226 Get real fix for bug #687902. Revert request processor IDisposable.
and handle session shutdown when creating InstanceContext.
Also add note on DisposeInstance(), which got me stuck.
2011-04-20 19:15:15 +09:00
Atsushi Eno 657c31a31b Ongoing service channel closing fix and session management in ChannelDispatcher.
It is part of bugfix 687902.

To get the bug fixed, the new "using" sections in ChannelDispatcher.cs to
explicitly dispose channels. But this causes regression in PerSession-based
tests. So some new session management code is (likely) required as well.

It will also alter "mixed" MaxConcurrentCalls and MaxConcurrentSessions with
correct management code.
2011-04-20 16:57:58 +09:00
Miguel de Icaza 851c79f6e6 Prevent crash on scripts that do not contain the #! line 2011-04-19 22:52:39 -04:00
Zoltan Varga 3fedcf496b Allow storing managed pointers into 'native int' in the JIT, fsharp generates code without a conv.i. Fixes #688008. 2011-04-19 22:45:29 +02:00
Gonzalo Paniagua Javier 1562106ccd [HttpListener] Fix matching directories
/foo was not properly matched.
	Fixes bug #688353.
2011-04-19 13:56:39 -04:00
Marek Safar 90922a746d [687282] Fixes cross references of nested anonymous methods which don't start at parameters level block 2011-04-19 13:06:12 +01:00
Lluis Sanchez e54906aaf2 Fix ICollection.CopyTo in the Stack class 2011-04-19 13:51:55 +02:00
Gonzalo Paniagua Javier 6f9f05df58 [HttpWebRequest] Fix half-baked commit
Fixes bug #688100.
2011-04-18 10:57:21 -04:00
Marek Habersack ce3b0b7564 [asp.net] ScriptResourceHandler must correctly encode script literals. 2011-04-18 13:23:28 +02:00
Atsushi Eno a9777b31fc Empty XmlReader message caused failure on buffereed copy. 2011-04-18 17:22:21 +09:00
Zoltan Varga 7dcacbb5bf Fix Object.MemberwiseClone () on arrays. Fixes #688033. 2011-04-17 23:49:33 +02:00
Gonzalo Paniagua Javier 5f8f48145d [webclient] Only set the credentials when they are not null.
Setting the credentials to null makes FtpWebRequest throw.
	Fixes bug #688007.
2011-04-17 13:58:59 -04:00
Sebastien Pouliot b8052728ea backport pull request for 2.10.2 2011-04-17 10:07:12 -04:00
Marek Habersack 3f823404fc [asp.net] MinimizableAttributeTypeConverter only converts from strings.
It returns a boolean 'false' when the passed string matches (case-insensitively) 'false' or
is empty, returns 'true' otherwise.
All the other types (and a null value) cause it to throw the NotSupportedException.
2011-04-16 02:12:48 +02:00
Rolf Bjarne Kvinge e3658fe73e [corlib] Ensure Thread.ManagedThreadId is unique per thread.
This fixes bug #667329.

The problem was that ManagedThreadId was created from a per-appdomain
counter, but stored in a per-thread storage, so if two threads could
end up with the same ManagedThreadId if a second appdomain executed
on the second thread first.
2011-04-15 22:11:09 +02:00
Marek Habersack 3f43883b30 [asp.net] Fix for bug #685116. AJAX post-back which redirects the browser does not need a Page or ScriptManager instance 2011-04-15 21:57:20 +02:00
Atsushi Eno c9f2555f4a Prepare for HostNameComparisonMode support (i.e. incomplete).
This is for bugfix #687580.
2011-04-16 01:07:19 +09:00
Atsushi Eno 8fa55bb406 Return null for empty message in WebMessageFormatter. Useful eror messages. 2011-04-15 23:52:15 +09:00
Atsushi Eno ea78b00406 Some argument check in TextMessageEncoder. 2011-04-15 23:52:04 +09:00
Atsushi Eno fb2c69e852 Use correct MessageVersion instead of Default for empty response.
Part of bugfix #687580.
2011-04-15 21:32:05 +09:00
Atsushi Eno 26536ad29f Prefer immutable string return for ease of debugging in UriTemplate. 2011-04-15 20:04:30 +09:00
Atsushi Eno 24702d5e64 Fix regression for counter case to 6005f0a7.
http://localhost/x + X should not result in http://localhost/xX.
2011-04-15 16:45:34 +09:00
Atsushi Eno 79bf69008d Implement support for KnownTypeAttribute.MethodName. 2011-04-15 15:42:52 +09:00
Atsushi Eno 0d20226656 Flush XmlWriter and TextWriter so that incomplete changes are not lost. 2011-04-15 14:57:56 +09:00
Atsushi Eno e4f59e1fa0 One more step to enable WCF diagnostics in Logger, and add HttpReplyChannel log. 2011-04-15 14:48:11 +09:00
Gonzalo Paniagua Javier bf77046abc Clearing the queue messed up with the per-domain job count
Fixes bug #687399.
2011-04-14 15:25:59 -07:00
Marek Habersack 985f57d2b4 [asp.net] Fix for bug #685267. ClientScriptManager generates correct post-back event reference for cross-page post-backs. 2011-04-14 22:42:09 +02:00
Marek Habersack aca8c70648 [asp.net] Shorten code in WebConfigurationHost 2011-04-14 20:51:07 +02:00
Marek Habersack be8a6afd4a [asp.net] Fixed a thinko in one of the previous commits 2011-04-14 20:50:59 +02:00
Atsushi Eno b313b63718 Add ServiceKnownTypeAttributeTest. 2011-04-14 15:23:09 +09:00
Atsushi Eno 80238cef2f ServiceKnownTypeAttribute.MethodName was used way different to lookup method. 2011-04-14 14:58:03 +09:00
Martin Baulig 776a4cb2b5 Oooops, it's supposed to be 'if (!strcmp (...))' ! 2011-04-13 20:18:43 +02:00
Marek Habersack a96c5dd131 [asp.net] Make web.config path check test case-insensitive 2011-04-13 16:57:53 +02:00
Marek Habersack c79e051d35 [asp.net] A more effective way of looking for web.config 2011-04-13 16:57:46 +02:00
Marek Habersack 0adb5a6dbf [runtime,IO] Filesystem entries can only be sought for in directories, not files. 2011-04-13 16:57:40 +02:00
Atsushi Eno 64ba822460 Fix wrong TraceEventType values passed. 2011-04-13 02:23:18 +09:00
Martin Baulig db59c744af Ooops, also enable explicit nulls. 2011-04-12 07:02:07 +02:00
Zoltan Varga d0ecf17cec Avoid putting a seq point at the beginning of finally clauses, they already have one. Fixes #686269. 2011-04-11 23:18:31 +02:00
Zoltan Varga 86b0b2afed Revert "Add checks to ParameterBuilder.SetConstant () to avoid an assert in the runtime. Fixes #684438."
This reverts commit c5c488ec9d.

This seems to break IronRuby.
2011-04-11 19:38:52 +02:00
Martin Baulig db9d1fffba Add "soft breakpoint" support for ARM.
There is some broken hardware like the HTC Desire HD where we can't
use any signals for single-stepping and breakpoints.

See http://baulig.blogspot.com/2011/04/limiting-page-faults-on-htc-desire-hd.html
for details.

To work around this, we read from a variable instead us using trigger
pages.
2011-04-11 17:48:47 +02:00
Zoltan Varga c5c488ec9d Add checks to ParameterBuilder.SetConstant () to avoid an assert in the runtime. Fixes #684438. 2011-04-10 20:46:23 +02:00
Gonzalo Paniagua Javier 11cee69b5f [HttpWebRequest] Ignore Transfer-Encoding when there's no content.
If the transfer encoding was set to chunked, we tried to read even when
	the response might known to have no content. This led to timeouts.

	Fixes bug #686371.
2011-04-09 15:18:18 -04:00
Atsushi Eno 0dd62ba176 Implement 4.0 WebOperationContext.Create[Atom10|Json]Response() methods. 2011-04-08 21:40:01 +09:00
Atsushi Eno 40f9aba00f Add XmlSerializerFormatAttribute support in mobile profiles.
Unlike moonlight, XmlSerializer is in the framework lib (sys.xml), so we don't
have to split them out to Sys.Xml.Serialization.dll.
2011-04-08 16:01:11 +09:00
Atsushi Eno 643148f131 Temporarily disable InternalsVisibleTo(Sys.Xml.Serialization). 2011-04-08 13:46:47 +09:00
Gonzalo Paniagua Javier 099d0f0e34 Remove printf 2011-04-07 21:32:44 -04:00
Miguel de Icaza 9187dbc0d9 Revert broken patch 34f18b68 that caused random bugs in assembly loading, but could crash the runtime as well 2011-04-07 21:15:53 -04:00
Miguel de Icaza a9c68584df Add test to prevent future problems, this fixes the random MacOSX crashes with assembly loading, but likely everywhere else as well 2011-04-07 21:15:53 -04:00
Zoltan Varga 50dadb263b Revert "Disable SMP on arm until #683409 is fixed."
This reverts commit 29550902ee.

This is now longer needed as #683409 is fixed.
2011-04-07 22:20:24 +02:00
Zoltan Varga 1106b9be5f Pass HAVE_ARMV6 to libgc on darwin too. 2011-04-07 22:19:32 +02:00
Zoltan Varga ec6e3150f8 Add a membar to libgc's UNLOCK () on arm. Fixes #683409. 2011-04-07 22:16:29 +02:00
Atsushi Eno 824336a958 Split XmlMessagesFormatter out. It is for use in Sys.Xml.Serialization.dll.
XmlMessagesFormatter will be used in Sys.Xml.Serialization.dll and this
type should not be excluded by !NET_2_1 or !MOONLIGHT. It is not doable
if this class is in BaseMessagesFormatter.cs.
2011-04-08 00:22:38 +09:00
Atsushi Eno 5a414980ea Add InternalsVisibleTo(Sys.Xml.Serialization.dll) to Sys.ServiceModel in 2.1. 2011-04-08 00:13:03 +09:00
Atsushi Eno 7215e2b879 Fix moonlight_raw build in Sys.Xml.Serialization.dll (NIE!) 2011-04-07 23:29:28 +09:00
Atsushi Eno 12d359a6c4 DataContractSerializerOperationBehavior is done too. Fix moonlight_raw build. 2011-04-07 22:02:42 +09:00
Atsushi Eno 182883c4ba Some XmlSerializerFormatAttribute and XmlSerializerOperationBehavior refactoring. 2011-04-07 19:20:59 +09:00
Atsushi Eno 1ed5a802a9 HttpRequestChannel should also return CookieContainer in NET_2_1 profile.
Fixed bug #683642.
2011-04-07 12:34:54 +09:00
Gonzalo Paniagua Javier b0a314db2c [HttpWebResponse] Close and Dispose are different beasts.
After calling Close () on response you are still allowed to access its
	properties. Calling Dispose() causes the usual exception to be thrown
	when accessing the properties.

	Fixes bug #685368.
2011-04-06 23:02:03 -04:00
Zoltan Varga 4234f30930 Disable SMP on arm until #683409 is fixed. 2011-04-07 01:30:37 +02:00
MrUnleaded 12de169c29 Fix that corrects a mishandling of UInt64's. 2011-04-06 18:45:36 -04:00
Atsushi Eno cafcafe8d7 Looks like .NET accepts non-integer numbers as int. Smells bogus though. 2011-04-06 22:03:58 +09:00
Atsushi Eno 9dd0c9aaa0 auto-detect UTF16-LE too. 2011-04-06 20:22:11 +09:00
Marek Habersack 8e5e7a293e [DynamicData] Use different web.config for 2.0 and 4.0 tests 2011-04-06 11:07:17 +02:00
Gonzalo Paniagua Javier e430abe428 [eglib] The last argument can be empty and quoted.
Fixes bug #669303.
2011-04-06 02:04:59 -04:00
Atsushi Eno 8ed33a951d Fix build, looks like ArrayList is internally available in moon. 2011-04-05 23:07:34 +09:00
Jérémie Laval ef74fcb6bb Protect entering ReaderWriterLockSlim upgradable mode against async exceptions. 2011-04-05 15:25:34 +02:00
Marek Habersack 98cf1c90d4 [asp.net] Fix for bug #684803. XmlSiteMapProvider must take its root node into account when matching an URL. 2011-04-05 14:36:46 +02:00
Atsushi Eno aacbe2f237 Collection support in JSON serializer was actually for any IEnumerable. 2011-04-05 20:57:06 +09:00
Atsushi Eno 7ac57f726f Revert PushbackReader changes (was unnecessary and actually bogus). 2011-04-05 20:27:28 +09:00
Atsushi Eno 89fee7d373 null value also outputs "type='null' in WCF JSON writer. 2011-04-05 19:49:18 +09:00
Atsushi Eno 3d56703e92 Auto-detect text encoding from input stream for JsonReader. Fix DBCS pushback. 2011-04-05 18:24:02 +09:00
Atsushi Eno 53523879e8 IDictionary`2 serialization support was missing in DataContractJsonSerializer.
Fixed bug #685042.
2011-04-05 13:21:44 +09:00
Marek Safar 7290370f37 [666033] Fixes Mono.WebBrowser versioning
[backported by shana]
2011-04-04 18:46:08 +01:00
Jb Evain 5923bba0bf Fix net_2_0 build 2011-04-04 16:02:27 +02:00
Atsushi Eno c8a824af78 unlike told by docs.mono-android.net Trace does not exist in mobile profile. 2011-04-04 22:56:47 +09:00
Atsushi Eno bb3e8d2323 Add WCF diagnostics implementation (not working yet). 2011-04-04 20:58:44 +09:00
Kenneth Skovhede 2c74b21642 Fix the handling of the '%f' descriptor in DataConverter.Unpack (). Fixes #683712. 2011-04-03 06:33:52 +02:00
Marek Habersack 3e7bd993d8 [asp.net] 2.0 standalone tests must have the MONO_TESTS_IN_PROGRESS variable exported in the environment 2011-04-03 00:04:33 +02:00
Tomasz Kubacki ffbdeac062 [asp.net] HttpApplication.InitOnce must ensure that HttpApplication.Context does not return null.
HttpApplication.Context != null is assumed by System.Web.WebPages.WebPagesHttpModule Init method
2011-04-03 00:04:27 +02:00
Atsushi Eno e72666919a fix wrong attempt to add restricted headers in HttpRequestChannel. 2011-04-02 11:30:09 +09:00
Marek Habersack e57e16fee4 [asp.net] Store new heap size when shrinking it. Thanks to Rodrigo Kumpera for noticing it!
This should fix the IndexOutOfRangeError which occur after heap exceeds 8192 elements and is then
shrunk below that value.
2011-04-02 02:38:36 +02:00
Rodrigo Kumpera af23f3ee26 Fix thread restart under mach.
* sgen-gc.c (restart_threads_until_none_in_managed_allocator):
	On mach we used to simply call thread_suspend/thread_resume
	without updating the thread context, which would result in
	sgen getting hang.
2011-04-01 19:10:08 -03:00
Rodrigo Kumpera 1e137b7fcb Extract suspend code from mono_sgen_thread_handshake.
sgen-os-mach.c (mono_sgen_thread_handshake): Extract
	suspend code into new function mono_sgen_suspend_thread.
2011-04-01 19:01:58 -03:00
Rodrigo Kumpera 5340b41cd1 Use constant stack space for STW under darwin.
* sgen-gc.h: Since darwin doesn't use signals to
	stop the target threads, we must reserve space for
	register in SgenThreadInfo.

	* sgen-os-mach.c (mono_sgen_thread_handshake): Don't
	alloca inside the loop. Make sure each thread registers
	are copied to the right place.
2011-04-01 18:38:17 -03:00
Rodrigo Kumpera 11c5664fb4 Leverage SgenThreadInfo::mach_port.
* mach-support-*.c (mono_mach_arch_get_tls_value_from_thread):
	This function now receives pthread_t instead of mach_port
	as argument, so avoiding an expensive call to
	pthread_from_mach_thread_np.

	* sgen-os-mach.c (mono_sgen_thread_handshake): Loop over
	the registered threads insted of asking the kernel to enumerate
	them. Avoid calling pthread_from_mach_thread_np which takes
	a lock and is O(n) on the number of threads.
2011-04-01 18:18:02 -03:00
Rodrigo Kumpera 59d034e8a7 Store the mach port on SgenThreadInfo 2011-04-01 17:24:09 -03:00
Rodrigo Kumpera b178109c1e Fix win32 file name canonicalization.
* mono-path.c (mono_path_canonicalize): Properly canonicalize
	non UNC paths with an extra backslash. Eg:
	c:\foo\\bar was been canonicalized to c:\\foo\bar.

	This was breaking assembly loading in some rare cases.
2011-04-01 17:00:05 -03:00
Atsushi Eno a2a78ecc5d A bit less !NET_2_1 and !MOONLIGHT in Sys.ServiceModel.Web. 2011-04-02 04:11:09 +09:00
Atsushi Eno c540e335c3 Less !NET_2_1/!MOONLIGHT to improve SL4 WCF compatibility. 2011-04-01 20:45:47 +09:00
Marek Habersack b7aaf47762 [asp.net,routing] Fix for bug #682869. RouteCollection.MapPageRoute is a 4.0 thing 2011-04-01 13:41:04 +02:00
Marek Habersack b80dca6c9b [wcf] Unbreak the build (Assembly.IsDynamic is a 4.0 thing) 2011-04-01 13:34:51 +02:00
Marek Habersack 3dd79d0752 [mvc3] Part of fix for bug #683339. Override more NameValueCollection methods.
Without those overrides, merging collections in System.Web.HttpParamsCollection fails.
2011-04-01 11:55:34 +02:00
Marek Habersack a8cb34edbf [system] Part of fix for bug #683339. NameValueCollection.Add (NameValueCollection) must call the Get* overloads instead of BaseGet*
Otherwise classes wrapping NameValueCollection will not be able to intercept the Add call which leads to errors in MVC3's
FormCollection.
2011-04-01 11:55:28 +02:00
Alan McGovern 812ee3308e [log profiler] Keep correct stats about gchandles
We were not keeping track of allocated/destroyed/alive gchandles in the
log profiler. It only ever reported the number of handles alive at the
end of the profiling run and that was misreported as the output claimed
this was the number of gchandles created.
2011-04-01 10:34:12 +01:00
Atsushi Eno 53c2bea069 Implement ConfigurationName support for ChannelFactory.
It is required for MoonlightDrtViewer bugfixing.
2011-04-01 18:25:10 +09:00
Peter Gerbrandt e56d2c760b Fix contract description for contracts with deep inheritance hierarchy. 2011-04-01 14:21:00 +09:00
Louis Salin 3e9df709c8 TraceData and TraceEvent methods must pass a new instance of TraceEventCache 2011-03-31 09:09:41 -04:00
Louis Salin 1bd073b713 implement getter and setter for HostContext property 2011-03-31 09:09:40 -04:00
Gonzalo Paniagua Javier e60acb3ab0 Remove printf's 2011-03-30 22:27:25 -04:00
Gonzalo Paniagua Javier 6c94fea797 Revert "Fix a typo in Directory.GetFiles ()"
This reverts commit 5bbd6c23f8.
2011-03-30 21:04:35 -04:00
Zoltan Varga a4ae5ad77a Add some checks to the ActivationServices:AllocateUninitializedClassInstance () icall to avoid instantiating interfaces/abstract types. 2011-03-30 16:05:32 +02:00
Martin a8ef691b71 [asp.net] Fix for bug #658184. AuthorizationRule restores its Action when unmerging. 2011-03-30 12:21:54 +02:00
Marek Habersack 047b8446d4 [DataAnnotations] Implemented the Validator and CustomValidationAttribute 4.0 classes 2011-03-30 10:19:44 +02:00
Rodrigo Kumpera 66b152ffe0 Cast p to char* since the offset is in byte units. 2011-03-30 00:44:32 -03:00
Zoltan Varga 7f3f7f3d28 Fix the previous change. 2011-03-30 05:26:42 +02:00
Zoltan Varga fcd76072e0 Call SleepEx in a loop in the Thread.Sleep () icall, to avoid a race when the sleep is interrupted. Fixes #683519. 2011-03-30 05:07:47 +02:00
Vincent Povirk b4e8b39a6e System.Windows.Forms.Mime: Use freedesktop.org only on Unix platforms. 2011-03-29 21:10:51 -04:00
Gonzalo Paniagua Javier e22f04bbdc Reset BytesTransferred on every reuse. 2011-03-29 13:46:38 -04:00
Ankit Jain ebab6e9fad [xbuild] Allow skipping target framework moniker lookup.
* tools/xbuild/xbuild/4.0/Microsoft.Common.targets
(GetReferenceAssemblyPaths): Don't look up framework directories
for $(TargetFrameworkMoniker) is $(_TargetFrameworkDirectories) is
already defined. This can be used to override moniker lookups.
2011-03-29 18:48:35 +05:30
Gonzalo Paniagua Javier fe220bb14f Fix vasprintf() for empty strings.
James Bellinger entered bug #682963 and he ended up debugging it and
	providing the solution.
2011-03-28 23:25:18 -04:00
Andrew Jorgensen 2af17e6d19 mono-sgen-gdb.py should be installed conditionally 2011-03-28 16:37:38 -06:00
Gonzalo Paniagua Javier 5bbd6c23f8 Fix a typo in Directory.GetFiles ()
The mask never matched the attributes and all files were discarded.
	This fixes bug #683203.
2011-03-28 17:48:41 -04:00
Andrew Jorgensen 320abe5356 Bump to 2.10.2 2011-03-28 12:27:26 -06:00
Zoltan Varga cee9574eec Remove some unused fields from MonoDynamicGenericClass. 2011-03-28 15:01:24 +02:00
Atsushi Eno 6cc6d1f172 Cosmetic corcompare-based updates in Sys.SM.Web. 2011-03-28 21:18:17 +09:00
Atsushi Eno fd0bfb7e2e Looks like WCF serializer supports XmlNode, so we do as well.
for details: http://msdn.microsoft.com/en-us/library/aa347876.aspx

Fixed bug #682957.
2011-03-28 17:11:30 +09:00
Zoltan Varga 8f8e0a9b6e Fix a case where class->instance_size was not set for dynamic classes. 2011-03-28 08:25:01 +02:00
Atsushi Eno 71f131be40 null JSON type must be handled in JsonWriter. 2011-03-26 21:28:06 +09:00
Atsushi Eno c96c5db231 Do not always assume ascii == 1 byte in JsonWriter. Fix utf-16 usage. 2011-03-26 21:01:37 +09:00
Atsushi Eno 4e0819daab XStreamingElement should be covered in WriteTo(). It's not derived from XNode. 2011-03-26 19:27:14 +09:00
Atsushi Eno 07ddd5f698 Nowadays, XmlDeclaratoin.WriteTo() writes PI instead of raw.
This resulted in invalid output to JsonWriter (via JsonReaderWriterFactory).
2011-03-26 19:15:42 +09:00
Marek Habersack 9ec474d427 [asp.net] HtmlForum.Name rendering updates + test updates 2011-03-25 22:49:51 +01:00
Marek Habersack 0810ccda41 [asp.net] Fix for bug #681553. Look for direct child controls before calling up on the NamingContainer 2011-03-25 14:22:52 +01:00
Rodrigo Kumpera f7a4dbc112 Avoid an infinite loop on broken utf16.
* gutf8.c (g_utf16_to_utf8): Increase the input counter
	when encountering broken surrogates head or tails to
	make sure we don't end in an infinite loop.
2011-03-24 23:21:46 -04:00
Gonzalo Paniagua Javier a247e53faa Avoid 'comparison always true...' 2011-03-24 23:21:10 -04:00
Gonzalo Paniagua Javier c86ebb4da5 Merge branch 'threadpool-2-10' into mono-2-10 2011-03-24 23:00:15 -04:00
Marek Habersack b225c4736c [asp.net] Fix for bug #681164. Page.InitOutputCache ignores calls with duration <= 0
It is ok to ignore such calls for two reasons - the cache with duration <= 0 will not
be effective anyway and the @OutputCache directive throws an exception for duration <= 0
2011-03-24 23:35:18 +01:00
Atsushi Eno 992872bb5d Fix serialization test build that depended on compiler contravariance bug. 2011-03-24 18:05:16 +09:00
Gonzalo Paniagua Javier a4d5c71207 .gitignore 2011-03-23 17:09:08 -04:00
Gonzalo Paniagua Javier 958ce2ba14 [windows] Avoid creating a thread in init 2011-03-23 17:08:52 -04:00
Gonzalo Paniagua Javier 82e0de5779 [windows] Make the connect hack work again. 2011-03-23 17:08:43 -04:00
Gonzalo Paniagua Javier 6e20527322 Revert "Replace old connect hack with _pipe on windows."
This reverts commit 1691837400.
2011-03-23 17:08:36 -04:00
Gonzalo Paniagua Javier 9c4c7d85e0 Revert "Remove unneeded function and use same code for win/lin"
This reverts commit 59c30ca79c.
2011-03-23 17:08:27 -04:00
Gonzalo Paniagua Javier c52ce4b572 Remove unneeded function and use same code for win/lin 2011-03-23 17:08:04 -04:00
Gonzalo Paniagua Javier 5b9892f071 Replace old connect hack with _pipe on windows. 2011-03-23 17:05:38 -04:00
Gonzalo Paniagua Javier 60f34bbaed --version shows kqueue now. 2011-03-23 16:57:15 -04:00
Gonzalo Paniagua Javier ff39c58bac [threadpool] Don't start all the IO threads on first request.
The IO threadpool behaves as the regular one now: threads are created
	on demand up to the default and then they are throttled based on load
	unless Set(Min|Max)Threads is used.

	Fix the stack size for threadpool threads when Set(Min|Max)threads is
	used.
2011-03-23 16:57:15 -04:00
Gonzalo Paniagua Javier 249e6665eb Some changes to the threadpool
-Reduce stack size for IO threads.
	-Create threads on demand up to min_threads, then throttle.
2011-03-23 16:57:15 -04:00
Gonzalo Paniagua Javier 3cd7aaf9c8 [threadpool] Add support for kqueue asynch. IO. 2011-03-23 16:57:15 -04:00
Gonzalo Paniagua Javier 40d02e9a1d [threadpool] Split the socket code in separate files. 2011-03-23 16:57:14 -04:00
Miguel de Icaza 725ac8d811 Make this OSX specific instead 2011-03-23 10:12:20 -04:00
Marek Habersack b34102015d [runtime] Fix compilation 2011-03-23 10:12:16 -04:00
Miguel de Icaza b311360048 OSX, Win32: Implements support for DriveInfo
This implements support for DriveInfo for OSX and Windows.

On OSX we use statfs system call that provides the filesystem
type information that we need.   On Linux, we continue to fallback
to mtab parsing
2011-03-23 01:56:58 -04:00
Miguel de Icaza 20808baa2c Add OSX support to the io-layer: supports getting a list of mounted file systems, and OSX-specific file system types 2011-03-23 01:56:47 -04:00
Miguel de Icaza b78ad6ad48 Add Environment.IsMacOS for handling OSX specific bits in corlib 2011-03-23 01:56:39 -04:00
Marek Habersack b93091c617 [asp.net] Fix for bug #681421. Use VirtualPathProvider.CombineVirtualPaths
The method is used by the parsers to look up dependencies, sources, controls
and master pages.
2011-03-22 21:29:17 +01:00
Marek Habersack d6b8fed5be [asp.net] Use List <string> instead of ArrayList to keep assembly locations in TemplateParser 2011-03-22 21:29:11 +01:00
Marek Habersack f12d23c5cc [asp.net] Use List <string> instead of ArrayList to keep file dependencies 2011-03-22 21:29:04 +01:00
Jb Evain f7bbde7bb5 Fix output of local variable names in debugging symbols 2011-03-22 16:00:29 -04:00
Geoff Norton 0e15d77a17 Set SO_REUSEADDR on listening sockets 2011-03-22 15:52:08 -04:00
Gonzalo Paniagua Javier 4e01dad1f8 [HttpListener] request.Url.Original string matches MS now.
Fixes bug #681548.
2011-03-22 12:57:12 -04:00
Gonzalo Paniagua Javier 406d680f31 [HttpListener] Match exceptions from MS on cleanup.
When the listener is aborted or closed, we get different exceptions
	depending on whether there's a GetContext() call in progress or not.
2011-03-22 12:56:51 -04:00
Zoltan Varga 7bde20118b Implement OperatingSystem.ServicePack. Fixes #681552. 2011-03-22 17:16:28 +01:00
Gonzalo Paniagua Javier 3a7370aefc [threadpool] Avoid the infame assert in mono-wsq.
Fixes bug #677746.
2011-03-22 11:52:18 -04:00
Gonzalo Paniagua Javier 2087d7c1a1 [msvc] New mono.def 2011-03-22 11:22:21 -04:00
Gonzalo Paniagua Javier ed57d90570 [HttpListener] Fix keep-alive connections
We were removing the connection in the wrong place.
	Also unbind the context in other error situations like a read failure
	after the headers are in.
2011-03-22 11:22:21 -04:00
Gonzalo Paniagua Javier fc3f496d1b [windows] Update create-defs.pl
Library is now mono-2.0, exclude mono_gc_pthread_* from the output.
2011-03-22 11:22:21 -04:00
Atsushi Eno 39ece5f8c7 Remove unexpected CWL. 2011-03-22 15:35:36 +09:00
Gonzalo Paniagua Javier b5b8d4a42e [windows] Wrong LoadLibrary being called.
We were calling LoadLibraryA instead of the W version.
2011-03-21 23:27:48 -04:00
Gonzalo Paniagua Javier 792bd0b4e3 [windows] Get rid of a lot of warnings 2011-03-21 23:27:47 -04:00
Gonzalo Paniagua Javier e8e244f839 [windows] Avoid creating a thread in init. 2011-03-21 18:16:59 -04:00
Veerapuram Varadhan bb58f668b3 [bugfix][ado.net odbc]Fixes #676368 - make it thread safe to release
underlying statement handles and check for the validity of the same
before attempting to release them.  Fixes random crashes.
2011-03-22 01:08:22 +05:30
Zoltan Varga ecdf344983 Fix the length of 'break' on ppc. 2011-03-21 20:07:57 +01:00
Jérémie Laval 6623fc543d Revert fcbb5717c1 and implement it differently.
The commit had the good idea but since some values of the enumeration overlap it broke the correct behavior. Instead we now turn off the extra options and use the previous way to check.
2011-03-21 13:30:52 +01:00
Geoff Norton 1e38c9d065 Add some missing types to the mobile profile 2011-03-20 21:53:26 -04:00
Jb Evain 30719eac23 [linker] always preserve System.MonoCQItem 2011-03-20 20:27:29 +01:00
Miguel de Icaza be791133e9 Merged compile fix from master 2011-03-18 22:22:14 -04:00
Rafael Munitic ba41a4afc3 Must pass null to overloaded constructor instead of wrapper lambda (TaskCompletionSource can use overloaded constructors and it will pass null in function argument) 2011-03-18 18:22:24 -04:00
Rafael Munitic 7001015c8a Continuation options should be checked as flags 2011-03-18 18:20:12 -04:00
Rafael Munitic cb86a2cae2 If the function is null Wait will not get called and will not check if Future is in faulted state/raise the exception 2011-03-18 18:19:42 -04:00
Koushik Dutta 2023fd51cf Fix bug where if a task is Start-ed with a specific scheduler,
that scheduler is ignored if it is in a thread owned by another
scheduler. Tasks should not be locked to the scheduler that
owns the calling thread.

Fix bug where TryExecuteTask does not actually try to execute
the task. Instead, TryExecuteTaskInline is called, which is
abstract. The TpScheduler implementation, the default, then
calls the internal method Task.Execute which then actually
executes the task. The problem with this is that only 3rd
party schedulers, can't actually execute a task, thus making
extending TaskScheduler impossible. (Unless they use some
serious Mono specific reflection hacks as I am now.)
2011-03-18 17:59:52 -04:00
Mark Sciabica ee0c82f938 Fix exception handling on windows x64. 2011-03-18 18:00:34 +01:00
Atsushi Eno f66c15fa4c XamlType lookup from xml name failed when [XmlnsDefinition] is involved. 2011-03-18 15:59:30 +09:00
Gonzalo Paniagua Javier 870a168078 Fix the host name returned in GetHostEntry.
GetHostEntry() was setting the HostName to the last IP address returned
	for the requested host name.
2011-03-18 01:27:12 -04:00
Zoltan Varga f1e5ff5830 Switch to the domain of the assembly in question while executing CMD_ASSEMBLY_GET_TYPE, so referenced assemblies are found. Fixes #679586. 2011-03-17 20:08:04 +01:00
Rodrigo Kumpera ec56b2399e Revert "[io-layer] Handle process waits when SHM is disabled."
This reverts commit 2bb69090d7.
2011-03-17 18:05:30 +01:00
Rodrigo Kumpera 98567347b0 Revert "[io-layer] Make my previous patch signal safe."
This reverts commit c183437b77.
2011-03-17 18:05:16 +01:00
Gonzalo Paniagua Javier d1ef9e9bc0 [asp.net] Return the correct Mime type for 304. 2011-03-17 12:50:08 -04:00
Marek Habersack 1d15cb6eab [asp.net] Test for bug #655474 2011-03-17 16:37:49 +01:00
Marek Habersack 2f6c884c39 [asp.net] Fix for bug #655474. Don't assume an Uri being serialized is an absolute one 2011-03-17 16:20:23 +01:00
Marek Habersack 3007742461 [asp.net] Test compilation fix for System.Web.Extensions 2011-03-17 16:20:06 +01:00
Marek Habersack dd02160e29 Removed debug noise 2011-03-17 15:41:33 +01:00
Marek Habersack 04ceb5cec2 [asp.net] Fix for bug #678473. Do not map paths of absolute file paths when passed to HttpRequest.WriteFile 2011-03-17 15:36:46 +01:00
Marek Habersack 4c251cb528 [asp.net] Fix for bug #670714. Menu is rendered correctly in 4.0 now (highlighting works) 2011-03-17 15:12:46 +01:00
Atsushi Eno f29c6b4014 Fix build; remove extra !NET_2_1. 2011-03-17 21:15:50 +09:00
Atsushi Eno 5d3bd4296d net.tcp Sized message with non-binarysession encoding should work now.
(Untested checkin.)
2011-03-17 20:05:43 +09:00
Atsushi Eno 7b4e9fe3b3 Support encoding record other than binary session in TCP channel frame reader. 2011-03-17 19:29:56 +09:00
Gonzalo Paniagua Javier e127fbdbc8 [Threadpool] Handle multiple calls to cleanup
Don't fail if mono_thread_pool_cleanup() is called more than once.
	Fixes bug #678662.
2011-03-17 02:00:10 -04:00
Marek Habersack da38ea1a3c [asp.net] Fix for bug #670874. Match request URLs against precompiled dictionary using absolute paths. 2011-03-17 01:53:37 +01:00
Zoltan Varga 80b18e5e78 Fix the title of the Mono.Debugger.Soft assembly monodoc. 2011-03-17 01:28:04 +01:00
Marek Habersack b08fcbf349 [asp.net] Fixes bug #676008. HtmlForm 'name' attribute rendering fixes.
The 'name' attribute is rendered using the static ID of 'aspnetForm' if
the form is in a naming container other than the Page control. Inside Page,
the form's ID is rendered. The attribute is output in .NET 4.0 only if control
rendering compatibility is less than 4.0
2011-03-17 00:56:34 +01:00
Gonzalo Paniagua Javier 4448207b46 [io-layer] Don't use Get/SetLastError after wapi shutdown.
handle_cleanup() is called at exit and might try to clean things up
	twice, causes a WSANOTUNITIALISED and then a segmentation fault trying
	to use a pthread key that has already been freed.
2011-03-16 16:12:01 -04:00
Gonzalo Paniagua Javier c183437b77 [io-layer] Make my previous patch signal safe. 2011-03-16 13:45:16 -04:00
Marek Habersack 0bc62c64f2 [asp.net] Fix for bug #668696. Handle recursive locks gracefully. 2011-03-16 16:19:05 +01:00
Zoltan Varga f9f20656d9 Fix support for generic virtual thunks in full-aot. 2011-03-16 14:44:38 +01:00
Zoltan Varga 1cf96c874c Add a cache for virtual generic thunks to avoid freeing those created by AOT. 2011-03-16 14:40:41 +01:00
Atsushi Eno 2e938cedc3 Enable behaviors in mobile profiles for WebHttpBinding. 2011-03-16 20:54:57 +09:00
Atsushi Eno 8aae8a860c Enable more behavior interface member in NET_2_1. 2011-03-16 20:52:50 +09:00
Atsushi Eno 72c9964603 Enable more behaviors use in NET_2_1 land, toward WebHttpBinding. 2011-03-16 20:43:24 +09:00
Atsushi Eno 045c255762 Implement more encodings than binary frame with dictionary, in TCP manager.
(not known to not regress in nunit tests..)
2011-03-16 20:34:05 +09:00
Atsushi Eno 441e34087e Fix MessageID element name in discovery contracts. 2011-03-16 20:31:37 +09:00
Jérémie Laval b754115f2b Don't throw an exception when task array is empty in WaitAll and throw in case a null element is encountered in it.
Fix for #679183
2011-03-16 09:34:38 +01:00
Jérémie Laval 94398a1154 Correctly implement enumerating CyclicDequeue.
Fix #679174
2011-03-16 09:33:29 +01:00
Atsushi Eno cf3968f176 Add endpoint behavior support in NET_2_1, which involved not a few additions. 2011-03-16 17:22:25 +09:00
Gonzalo Paniagua Javier 6101dfa1e7 Fix g_get_charset for windows.
Patch by Horst Kakuschke that fixes bug #660412.
2011-03-16 02:00:39 -04:00
Gonzalo Paniagua Javier 2bb69090d7 [io-layer] Handle process waits when SHM is disabled.
When SHM is disabled, handle SIGCHLD and either fill the info for the
	process handle or just wait for the process to avoid zombies.
	Fixes bug #668867.
2011-03-16 01:51:55 -04:00
Jason Cohen 32c89f8e51 [asp.net] Fix for bug #678705. Menu list rendered properly closes the list now. 2011-03-16 02:31:34 +01:00
Bassam Tabbara 733baa249e [asp.net] Fix for bug #667513. Implement support for PathInfo in Route.GetRouteData 2011-03-16 01:11:58 +01:00
Jb Evain 1fc9d8bd0b Handle conversion to System.Enum 2011-03-15 22:20:00 +01:00
Gonzalo Paniagua Javier c596b87264 [Semaphore] Remove warnings 2011-03-15 16:29:02 -04:00
Veerapuram Varadhan 51ede8ef25 [bugfix]672113 - Make a copy of constraint columns array 2011-03-15 20:24:10 +05:30
Atsushi Eno 92d8d69c21 avoid NRE on non-binary encoding use in TcpTransport. 2011-03-15 21:07:25 +09:00
Gonzalo Paniagua Javier 7ccc860767 Appdomain refs can be NULL in pop_refs
This fixes a bunch of test I broke with my previoius commit.
2011-03-14 22:51:21 -04:00
Kornél Pál a19eee8543 [asp.net] Fix for bug #650695. Implements the System.Web.{HttpNotFoundHandler,HttpNotImplementedHandler} classes. 2011-03-14 23:47:18 +01:00
Zoltan Varga f00f059724 Avoid calling class cctors during JITting when the same class needs initialization more than once during a method. Fixes #679467. 2011-03-14 23:09:33 +01:00
Gonzalo Paniagua Javier db74186f65 [HttpListener] Avoid contention
-Lock-free reads from registered listeners.
	-Don't register the context until *all* the setup steps are done.
2011-03-14 18:00:11 -04:00
Lucas Meijer d6b8f09a9b Implmement a private BinaryFormatter.DefaultSurrogateSelector, which enables embedders who want to make a sandbox, to specify a default surrogate selector, which is required to get System.Serialization be able to operate within a CoreCLR environment. 2011-03-14 17:34:20 -04:00
Geoff Norton be077e583a Fix the mobile build 2011-03-14 16:11:24 -04:00
Geoff Norton 0a8951258f Fix the mobile build 2011-03-14 15:43:29 -04:00
Mark Probst adaeb6075b Merge branch 'sgen-disable-gc' into mono-2-10 2011-03-14 19:25:31 +01:00
Mark Probst be796b9980 [sgen] Debug options for disabling minor and/or major collection. 2011-03-14 19:21:17 +01:00
Gonzalo Paniagua Javier 6c25b86257 Add new ignore file. 2011-03-14 14:09:17 -04:00
Gonzalo Paniagua Javier 1d602e9364 [threads] appdomain_refs push/pop speedup
Replace the GSList with an array to avoid malloc/free on every push/pop
	call.
2011-03-14 14:03:22 -04:00
Gonzalo Paniagua Javier a8985dc3ec Cache NewLine per AppDomain. 2011-03-14 14:02:00 -04:00
Gonzalo Paniagua Javier 1756d9ea31 [threadpool] Added dynamic concurrent queue implementation
Replace the big lock around the list+array used to queue work items
	with a dynamic concurrent queue to reduce contention.
2011-03-14 14:02:00 -04:00
Atsushi Eno 63e2c4a403 Enable DTD attdecl processing in mobile profile. 2011-03-15 00:46:23 +09:00
Peter Gerbrandt 35c7e0b062 Apply DataContractSerializerOperationBehavior. 2011-03-14 12:18:46 +09:00
Ankit Jain e49c454e06 [xbuild] Microsoft.Common.targets - import Before/After targets files.
With this, Microsoft.Common.targets will import
$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*
at the beginning of the file and
$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*
at the end of the file.

So, this would import all files from (eg.):
$prefix/lib/mono/xbuild/4.0/Microsoft.Common.targets/ImportBefore/

This can be disabled by setting the bool properties -
$(ImportByWildcardBeforeMicrosoftCommonTargets) and
$(ImportByWildcardAfterMicrosoftCommonTargets).
2011-03-12 02:14:20 +05:30
Ankit Jain 1b676d2766 [xbuild] Throw ArgumentNullException if target name is null 2011-03-12 02:14:18 +05:30
Ankit Jain a0e8d07f2b [xbuild] Emit list of projects in the .sln.proj
Emit list of projects in the solution as @(ProjectReference) items
in the generated .sln.proj file. This would be useful for extending
solution builds.
2011-03-12 02:14:17 +05:30
Ankit Jain 9aee6ad25d [xbuild] Don't report Imports ignored because of false conditions. 2011-03-12 02:14:15 +05:30
Ankit Jain f00c5a545b [xbuild] xbuild/Main.cs - remove unnecessary catch/throw. 2011-03-12 02:14:13 +05:30
Ankit Jain 7d67acee8b [xbuild] Set ProjectFile and TargetName metadata on target outputs.
Set "MSBuildProjectFile" and "MSBuildTargetName" metadata on target outputs.
2011-03-12 02:14:12 +05:30
Ankit Jain 30cf8768c4 [xbuild] Handle unknown exceptions.
Re-throw any unknown exceptions.
* Project.cs: Log the exception, doing it here also, so that direct
project.Build(..) call failures also get logged.
* Engine.cs: Log the unknown exception only if the build is running.
This allows for the case when Project.Build caught it and ended the
build.
2011-03-12 02:14:10 +05:30
Ankit Jain 64c827f318 [xbuild] Function names are case insensitive. 2011-03-12 02:14:08 +05:30
Ankit Jain f13dcb35bf [xbuild] Evaluate Import with MSBuildThisFile* properties set. 2011-03-12 02:14:07 +05:30
Ankit Jain 85f294ee2f [xbuild] Fix test on windows.
AssignTargetPathTest.TestLink : Fix test on windows
2011-03-12 02:14:05 +05:30
Ankit Jain 0e091a62fa [xbuild] Clean up test logs.
Remove unnecessary debug spew for tests that pass.
2011-03-12 02:14:03 +05:30
Gonzalo Paniagua Javier 42e4086945 Add to .gitignore 2011-03-11 02:03:46 -05:00
Gonzalo Paniagua Javier 7590b8bb30 [HttpListener] Paranoid cleanup 2011-03-11 02:00:33 -05:00
Gonzalo Paniagua Javier 455746a0ce Test for both Set-Cookie and Set-Cookie2 2011-03-11 01:59:28 -05:00
Gonzalo Paniagua Javier 371bc51b1c [HttpWebRequest] Only uppercase known methods 2011-03-11 01:59:20 -05:00
Gonzalo Paniagua Javier badc22bbae [Socket] Remove more auto-delegates 2011-03-11 01:59:11 -05:00
Gonzalo Paniagua Javier 2d7a5669d2 [Timer] Use static CB for invoking timer callbacks. 2011-03-11 01:59:05 -05:00
Gonzalo Paniagua Javier 89209acd58 [Socket] Minimize allocations of delegates 2011-03-11 01:58:55 -05:00
Gonzalo Paniagua Javier 9a4bd9308e [HttpListener] Avoid blocking in FlushInput 2011-03-11 01:58:40 -05:00
Gonzalo Paniagua Javier 3527ec8621 [HttpListener] Plug leak. 2011-03-11 01:47:00 -05:00
Gonzalo Paniagua Javier e812234121 Support NLS when opening assemblies on windows.
Patch by Horst Kakuschke that fixes bug #673793.
2011-03-10 22:16:25 -05:00
Geoff Norton b8397a6eeb Fix ARCH_STORE_REGS on arm 2011-03-10 16:28:22 -05:00
Gonzalo Paniagua Javier be0b6c8933 [HttpListener] Close idle connections on Stop()
Idle connections that never received any data or had ever been
	associated to a listener are properly closed now when the endpoint is
	closed or the last listener they used is closed.
	Fixes a bunch of tests in System.ServiceModel.
2011-03-10 13:02:58 -05:00
Duane Wandless cbd4fef05a GetApplicableRule returns NULL in TimeZoneInfo.cs yet the code does not always handle a NULL return value.
This change fixes this issue and allows timezones like China Standard Time to work.
2011-03-10 22:12:39 +08:00
Rodrigo Kumpera 4f2774fa80 mono_gc_alloc_mature must check if the object needs to be registered for finalization 2011-03-10 13:13:14 +01:00
Lucas Meijer cf967de406 backport of ee5a8cf9d09d525741e94b380bba411c6915026a, still under the mit x11 license. 2011-03-10 12:15:24 +01:00
Gonzalo Paniagua Javier 5167cc3dae [HttpListener] Memory use reductions 2011-03-10 00:45:22 -05:00
Atsushi Eno 12ce3d1370 In some collection case, xsi:type is explicitly written. Try to copy that behavior. 2011-03-10 14:35:23 +09:00
Gonzalo Paniagua Javier fa5e96cdf7 [HttpWebRequest] Support 4.0 Host property. 2011-03-09 22:34:23 -05:00
Zoltan Varga 18eb35983b Use mono_field_get_type () in one place to fix a crash. Fixes #678269. 2011-03-10 01:11:10 +01:00
Zoltan Varga b80343fd5b Mark threads created when calling from native code into the runtime as background threads. Fixes #678164. 2011-03-10 01:02:10 +01:00
Levi Bard 34f18b6876 [Fix] Make path building on windows behave the same as stock mono+glib.
* src/gpath.c: Make path building on windows behave the same as stock mono+glib.

License: MIT/X11
2011-03-09 16:38:34 -05:00
Gonzalo Paniagua Javier c690aa95bc IO threads have their own name 2011-03-09 16:11:54 -05:00
Gonzalo Paniagua Javier 9f33f58799 Some changes to the threadpool
-Reduce stack size for IO threads.
	-Create threads on demand up to min_threads, then throttle.
2011-03-09 16:08:46 -05:00
Andrew Jorgensen e30eeacd70 Fix up devel packages in spec file 2011-03-09 11:19:55 -07:00
Atsushi Eno 3e9fccb813 Some attempts to make KnownTypeCollection parallel access safe. 2011-03-09 22:51:18 +09:00
Atsushi Eno e25503422b Remove old windows threading workaround. 2011-03-09 21:20:38 +09:00
Marek Safar 69e64f8d72 [677550] Fixes fixed buffer regressions 2011-03-09 08:30:21 +00:00
Atsushi Eno 1585b98d92 Auto detect BOM-less utf-16 and utf-32. Fixed bug #674580. 2011-03-09 15:57:21 +09:00
Peter Gerbrandt c60c84c55d Implement support for QNameIndex (0xBC) in attribute nodes. 2011-03-09 14:00:22 +09:00
Atsushi Eno 1eae886946 Temporarily disable InternalsVisibleTo(System.ServiceModel).
until mcs (in 2-10 or later release) fixes the issue.
2011-03-09 10:21:39 +09:00
Gonzalo Paniagua Javier 4b7ca990ad Avoid null refs when capacity set to 0
This fixes bug #676060.
2011-03-08 18:06:11 -05:00
Miguel de Icaza aabd50d5ad [System.Json] Fix loader.
The current loader failed with some Json strings due to the implementation
of the BufferedStreamReader.   Removed that implementation completely,
and instead depend on the StreamReader to do the actual BOM detection.

This removes the JavaScriptObjectDeserializer.cs file
2011-03-08 18:00:27 -05:00
Miguel de Icaza f56f2a679c Make print take an object 2011-03-08 18:00:20 -05:00
Gonzalo Paniagua Javier e3ec5dcffb Turn the method to upper case.
Fixes bug #675731.
2011-03-08 17:35:52 -05:00
Gonzalo Paniagua Javier b428261ea6 No need to create an extra instance of Worker. 2011-03-08 12:35:05 -05:00
Atsushi Eno 7711cbf01a In XNodeWriter, extra xmlns was written and often rejected for duplicate decls.
Fixed bug #675620.
2011-03-08 23:54:23 +09:00
Atsushi Eno ce550ab14b Merge branch 'mono-2-10' of github.com:mono/mono into mono-2-10 2011-03-08 22:08:59 +09:00
Atsushi Eno 6d67acf0d0 More xml output fixes in XmlSyndicationContent and SydicationElementExtension.
They have couple of complicated xml outputs in both GetReader(AtContent)
and Write(Contents)To methods... check new tests for details.
2011-03-08 22:06:49 +09:00
Ankit Jain 82f415e01a [xbuild] Implement FileLogger . Fix #676650 .
* FileLogger.cs: Implement

Add corresponding command line args for file loggers.
Update man page.
2011-03-08 18:29:34 +05:30
Ankit Jain 4b9f33b4d5 [xbuild] ConsoleLogger - parse params only on Initialize. 2011-03-08 18:29:34 +05:30
Ankit Jain bf997c57b6 [xbuild] LogExtensions.LogError - disambiguate.
* LogExtensions.cs(LogError): Rename the 'filename' overload to ..
(LogErrorWithFilename): .. this.
* Engine.cs: Track api changes.
2011-03-08 18:29:33 +05:30
Ankit Jain 4395aab675 [xbuild] Set @(CollectedBuildOutput) for projects build from .sln . 2011-03-08 18:29:33 +05:30
Ankit Jain aad5ac41fa [xbuild] Add missing api for Target.
* Target.cs (Outputs): Add new public property by this name. And rename
old one to ..
(OutputsAsITaskItems): .. this.
2011-03-08 18:29:32 +05:30
Ankit Jain 9a743feb99 [xbuild] Fix bug #676671. Raise AnyEvent . 2011-03-08 18:29:32 +05:30
Ankit Jain 353b636e4a [xbuild] Add hooks for extending .sln builds.
Add hooks in the .sln.proj generated from .sln files.

1. It imports
   "$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportBefore\*"
   and
   "$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter\*"
   This is done only in case of 4.0 projects, as imports with wildcard
   is a 4.0 feature.

2. And it imports before.Foo.sln.targets and after.Foo.sln.targets from
   the same dir as the .sln file.
2011-03-08 18:29:31 +05:30
Ankit Jain 50f46f1fac [xbuild] Update man page with info about FrameworkList.xml 2011-03-08 18:29:31 +05:30
Ankit Jain 6e597dfd63 [xbuild] Add support for wildcards in Import.
With 4.0 profile, <Import ..> can have wildcards. This works correctly
with our multiple MSBuildExtensionsPath also.

If the import references $(MSBuildExtensionsPath) property, then the
each extension path is used to resolve the import, and the search
stop as soon as an import is found.

If such an import uses wildcard, then the search stops at the
extension path in which *atleast one* file got imported.
And the import fails if any invalid project file is encountered.

This commit also heavily refactors the Import code to simplify
in the face of the new features, and improves error detection
and reporting.

ImportTest.cs: Add test for wildcards.
2011-03-08 18:29:30 +05:30
Ankit Jain 1a357d9f4e [xbuild] ImportedProject - remove unnecessary catch/throw
Remove the catch { throw; }, this truncated the stack also.
2011-03-08 18:29:30 +05:30
Ankit Jain 12692327a1 [xbuild] ImportCollections.TryGetImport and other fixes 2011-03-08 18:29:29 +05:30
Ankit Jain e166179eb8 [xbuild] Expression.ParseAs<T> - new method 2011-03-08 18:29:29 +05:30
Ankit Jain 294900133a [xbuild] DirectoryScanner.HasWildcard - new method 2011-03-08 18:29:28 +05:30
Ankit Jain df939989d8 [xbuild] Log build errors and raise events even if a build fails. 2011-03-08 18:29:28 +05:30
Ankit Jain a1c49cd4e9 [xbuild] Add support for Before/AfterTargets.
A target 'foo' can have BeforeTargets or AfterTargets attributes,
which list the targets before or after, 'foo' should be run.
This is a 4.0 feature.

* Project.cs (ProcessBeforeAndAfterTargets): New.
* Target.cs: Run the before/after targets in the correct order.

* TargetTest.cs (TestBeforeAndAfterTargets): New.
2011-03-08 18:29:27 +05:30
Ankit Jain b374152512 [xbuild] Fix warnings. 2011-03-08 18:29:27 +05:30
Ankit Jain bbc79f7b41 [xbuild] Fix assembly name comparison when resolving references.
AssemblyResolver.cs (AssemblyNamesCompatible): If either of the
references don't have a public key token, then ignore that.
2011-03-08 18:29:26 +05:30
Ankit Jain 841b593bd9 [xbuild] Vbc task - make error column check a little non-specific. 2011-03-08 18:29:26 +05:30
Ankit Jain 49805cb00d [xbuild] Exec task - add support for custom error/warning regex.
Add 4.0 api, CustomErrorRegularExpression and
CustomWarningRegularExpression.
2011-03-08 18:29:25 +05:30
Atsushi Eno 0256398770 Couple of fixes around XmlSyndicationContent.GetReaderAtContent().
- The returned XmlReader is positioned at the beginning of the element.
- XmlSyndicationContent.GetReaderAtContent() returns XmlReader that begins
  with the "wrapper" which is dummy Atom 1.0 content element.
2011-03-08 18:58:40 +09:00
Atsushi Eno 38855bc712 Remove wrong buffer size check in XmlTextReader.ReadChrs(). 2011-03-08 15:28:08 +09:00
Atsushi Eno 017b4ed819 Make sure to call MoveToContent() to correctly determine node type.
Fix "Dictionary deserialization from xml with indent" issue.
2011-03-08 14:54:11 +09:00
Geoff Norton d47c02350c Add 2 missing 4.0 APIs to the MOBILE profile 2011-03-07 21:27:51 -05:00
Atsushi Eno 4b4f74955d DateTimeOffset child elements have fixed namespace. 2011-03-08 11:03:47 +09:00
Gonzalo Paniagua Javier 211be59492 Host name is the same when querying localhost
The host name is set to the queried host name when it is the local
	machine name. Fixes bug #676260.
2011-03-07 18:51:30 -05:00
Zoltan Varga 55a91737da Fix the previous change. 2011-03-07 18:04:02 +01:00
Zoltan Varga 568b8cf74d Fix out-of-tree builds. 2011-03-07 18:01:15 +01:00
Atsushi Eno bee257b69b Empty element is valid here in silverlight secrity element. 2011-03-08 01:51:39 +09:00
Atsushi Eno 36353034c9 XmlReader.ReadToNextSibling() saved wrong Depth and failed to proceed.
Fixed bug #676020.
2011-03-08 00:49:27 +09:00
Atsushi Eno b4b3b7b978 Forgot to add the actual new client proxy. 2011-03-08 00:43:23 +09:00
Zoltan Varga 550ca25837 Avoid an assert when returning nullable null's from sdb invokes. Fixes #676587. 2011-03-07 12:02:16 +01:00
Atsushi Eno 5cb757c95b Set ProhibitDtd = false on uri-based Load(). Fixed bug #676009. 2011-03-07 17:09:44 +09:00
Atsushi Eno c6fb9f9494 Couple of fixed to support new DateTimeOffset serialization in .NET WCF. 2011-03-07 16:46:56 +09:00
Atsushi Eno 1c664cbb1e Forgot to add test xml files. 2011-03-07 14:00:52 +09:00
Atsushi Eno dcc8112e68 Fixed xsd derived simpleType cast failures on uint. Fixed bug #676993. 2011-03-07 13:58:15 +09:00
Peter Gerbrandt 7f8aafbe7d Support for the same interface as service contract and as callback contract. 2011-03-07 12:53:19 +09:00
Atsushi Eno 837bf42ce7 Replace SRE-based client proxy generator with RealProxy.
Now PE verified workaround should be unnecessary.
2011-03-07 12:32:21 +09:00
Zoltan Varga 084a76ecea Install a mono-sgen-gdb.py as well. 2011-03-04 17:33:45 +01:00
Zoltan Varga 3da978e41b Log all sdb log messages to the log file instead of stdout. 2011-03-04 13:30:04 +01:00
Geoff Norton e8c3443bd3 When running in a linked environment, this file might not exist 2011-03-03 17:54:47 -05:00
Zoltan Varga 14b494ed61 Disable testbundle for powerpc too. 2011-03-03 16:35:53 +01:00
Zoltan Varga ef214d3a25 Resurrect THREAD_DEBUG. 2011-03-03 11:30:14 +01:00
Zoltan Varga 5038f10bb6 Change an #ifdef DEBUG to THREAD_DEBUG(). Fixes #676615. 2011-03-03 11:25:48 +01:00
Rodrigo Kumpera fd2b90b73b Reset iid of unloaded generic interfaces correctly.
* class.c (mono_get_unique_iid): Don't store
	the iid of generic instances on their GTD image
	since they can be unloaded before.

	* metadata.c (free_generic_class): Reset the iid
	used by interfaces.
2011-03-02 15:14:40 +01:00
Atsushi Eno 7225ae8eed Remove wrong overrides in RequestChannelBase in discovery. 2011-03-02 20:29:29 +09:00
Andrew Jorgensen 4f8349919a add xbuild-frameworks to rpm 2011-03-01 09:57:01 -07:00
Zoltan Varga 0214f7431a Use stdint.h for VS 2010 and later. 2011-03-01 16:34:40 +01:00
Marek Safar dbdcec54b4 [675777] Remove invalid zero based optimization 2011-03-01 08:59:02 +00:00
Geoff Norton 87cc02a04a Fix the build when using DESTDIR 2011-02-28 19:26:26 -05:00
Rodrigo Kumpera f5bba434cd Handle demormalized object and string types.
* metadata.c (do_mono_metadata_parse_type): NET 1.1
	assemblies can have string and object encoded in a denormalized
	way.

	Fixes #675464.
2011-02-28 22:02:05 +01:00
Rodrigo Kumpera 7048e3f49e Handle CompareTo(long) and huge numbers.
* BigInteger.cs (CompareTo): Handle numbers
	larger than 64bits.

	Fixes #674120
2011-02-28 14:57:35 +01:00
Ankit Jain ac1ad54ded [xbuild] ToolTask - make error column check a little non-specific. 2011-02-28 17:01:38 +05:30
Ankit Jain a1953b3f77 [xbuild] Make Engine.DefaultToolsVersion 2.0 .
Engine.DefaultToolsVersion is used when a project is unable
to determine a suitable ToolsVersion to use. Change this fallback
version to 2.0 . This allows vs2005 (.net 2.0) projects which
don't have ToolsVersion explicitly set, to build. Newer projects
set ToolsVersion by default.
2011-02-28 17:01:37 +05:30
Ankit Jain b100e0eed6 [xbuild] ResolveAssemblyReference - log task parameters 2011-02-28 17:01:35 +05:30
Ankit Jain 24e787e9ff [xbuild] ResolveAssemblyReference - add missing api. 2011-02-28 17:01:33 +05:30
Ankit Jain 916943ce1a [xbuild] GetReferenceAssemblyPaths - add missing license header. 2011-02-28 17:01:31 +05:30
Ankit Jain 93a4e248be [xbuild] Add support for multi-targeting arbitrary frameworks.
ToolsVersion 4.0 supports targeting arbitrary frameworks defined
by FrameworkList.xml files and referenced by $(TargetFrameworkMoniker),
which is of the format:
 Identifier,Version=<version>[,Profile=<profile>]

built as:
 $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)[,Profile=$(TargetFrameworkProfile)]

eg. '.NETFramework,Version=v4.0' .

Frameworks are searched for in (order):

  1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
  2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
  3. MSBuild property $(TargetFrameworkRoot)
  4. $prefix/lib/mono/xbuild-frameworks (default location)

.NET frameworks 2.0/3.0/3.5/4.0 have corresponding FrameworkList.xml
files now, which allows projects to target them. Custom frameworks like
MonoDroid can install suitable FrameworkList.xml files, and projects
can target them using the correct $(TargetFrameworkIdentifier) and
$(TargetFrameworkVersion).

Update man page.
2011-02-28 17:01:30 +05:30
Ankit Jain 8494641805 [xbuild] ToolTask - add missing api
* Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
(GetProcessStartInfo): Add missing api. This allows more control
over the execution of the tool.
2011-02-28 17:01:28 +05:30
Ankit Jain 82b37d914c [xbuild] Add missing property to Error/Warning tasks. 2011-02-28 17:01:26 +05:30
Ankit Jain 8c579dfce2 [xbuild] Add $(MSBuildToolsRoot) reserved property. 2011-02-28 17:01:24 +05:30
Ankit Jain 95af93f266 [xbuild] Remove property if Output TaskParameter is null.
If the TaskParameter for Output of a task is null, then remove
the corresponding property.
Add relevant test.
2011-02-28 17:01:22 +05:30
Geoff Norton 41b1fe814e Cache the result of the pthread_specific disassembly when checking for fast tls on darwin 2011-02-25 16:42:20 -05:00
Geoff Norton ac1e8e16a2 Fix the mobile build 2011-02-25 11:41:10 -05:00
Marek Habersack e8a578407b [asp.net] Fix for bug #671753. Route.GetVirtualPath must take ambient values into account. 2011-02-25 13:18:10 +01:00
Steve Bjorg 450b0f1c4a added units tests for TextReader ReadLine() and ReadToEnd() 2011-02-25 01:52:29 -05:00
Steve Bjorg d2b840c9fc TextReader.Null should return "" on ReadToEnd() 2011-02-25 01:51:39 -05:00
Miguel de Icaza ad9ddef21a Fix build 2011-02-25 01:49:02 -05:00
Miguel de Icaza 5c1fe2fedb [TerminfoDriver] be more tolerant to failures, and fallback gracefully, instead of aborting 2011-02-24 23:59:53 -05:00
Miguel de Icaza 268adea870 Do not throw exceptions, instead return a sensible value, fixes 656468 2011-02-24 23:36:33 -05:00
Atsushi Eno 70910f3f04 Fix 2.0 test build (disable it). 2011-02-25 12:38:51 +09:00
Zoltan Varga 02f2d4dbf7 Fix previous arm patch. 2011-02-25 03:20:32 +01:00
Miguel de Icaza dcec5908af Add default implementations to ReadLine() and ReadToEnd() to TextReader, fixes 655934 2011-02-24 16:52:00 -05:00
Zoltan Varga 85e594b968 Fix stop_debugger_thread () on windows. Shutdown both ends of the connection socket since shutting down only the receive part doesn't seem to work on windows. Wait for the debugger thread to exit in a loop, since we don't use condvars on windows. 2011-02-24 19:15:14 +01:00
Geoff Norton c08e02bc59 Enable ARMv6 for arm*-darwin 2011-02-24 12:22:34 -05:00
Martin Baulig a92669fc05 Fix bug #669836:
Treat exceptions that are caught by mono_runtime_invoke()
as unhandled in SDB.
2011-02-24 17:43:34 +01:00
Ankit Jain 0cce6b2bf5 [xbuild] Rename method to make it more consistent.
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
(GetAssemblyNameFromFile): Rename to ..
(TryGetAssemblyNameFromFile): .. this, to make it consistent with
the similar method TryGetAssemblyNameFromFullName .
Track api changes.
* Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs:
Track api changes.
2011-02-24 18:31:49 +05:30
Ankit Jain 9f29e21ade [xbuild] Fix bug #674630.
Handle errors in trying to create AssemblyName from invalid
full names.
2011-02-24 18:31:45 +05:30
Zoltan Varga 93dd831a8b Only use memory barriers on arm when running on armv6 or later. 2011-02-24 13:56:15 +01:00
Marek Safar b860a9145c [674224] Type parameter constraint can resolve to nested type before it has been imported 2011-02-24 08:14:57 +00:00
Atsushi Eno c69896b97b Simple InstanceContext.Extensions implementation by David Schmitt.
Fixed bug #674057.
2011-02-24 14:40:52 +09:00
Atsushi Eno 094614ba92 Do not write empty items in Probe message. 2011-02-24 14:36:36 +09:00
Atsushi Eno 2bbbccf106 To header rewrite only happens in Adhoc mode.
Update contracts to comply with that and make it consistent between versions.
2011-02-24 14:36:24 +09:00
Atsushi Eno 37589e862a Pass Actor. use IsNullOrEmpty() instead of "!= String.Empty". 2011-02-24 14:29:45 +09:00
Atsushi Eno 80890aa751 Another fix to not write null header. Add UniqueId deserialization workaround. 2011-02-24 14:29:34 +09:00
Jonathan Pryor 05745bacdf Enable UDP Sockets on MOBILE platforms.
Fixes runtime part of #666736.
2011-02-23 23:03:13 -05:00
Zoltan Varga 26bbac8c8a Disallow EventType.Step in EnableEvents (). Fixes #674490. 2011-02-24 01:07:51 +01:00
Miguel de Icaza b60927f21f Fix win32 build 2011-02-23 14:21:01 -05:00
Ankit Jain a77fdbe8b5 [xbuild] Fix bug #674337.
Use appropriate path separator for handling environment variable
MSBuildExtensionsPath.
2011-02-23 21:29:37 +05:30
Jérémie Laval 81f2bb71ed Allow people to optionally fallback to the old scheduler with an environment variable 2011-02-23 14:44:59 +00:00
Jérémie Laval 3d1b4715eb Remove ctors in TpScheduler
This also remove the capping of the ThreadPool, problem needs to be fixed in the pool itself.
2011-02-23 14:44:58 +00:00
Jérémie Laval df12cf48c6 Make TryExecuteTaskInline a bit smarter 2011-02-23 14:44:57 +00:00
Jérémie Laval 4e37530b60 Refactor common code block of TpScheduler and SyncContextScheduler in SchedulerProxy 2011-02-23 14:44:57 +00:00
Jérémie Laval 95513a6be4 Kill old IScheduler interface.
We still use the ParticipateUntil facility of IScheduler internally and provide a default implementation for pure TaskScheduler
2011-02-23 14:44:56 +00:00
Jérémie Laval 8415e77fbe When finding best worker number in Parallel loops use current TaskScheduler instead of default TaskScheduler 2011-02-23 14:44:56 +00:00
Jérémie Laval 3e593ba735 Adapt TpScheduler to the new API in TaskScheduler 2011-02-23 14:44:55 +00:00
Jérémie Laval ddd9443f26 Cache callback delegate in TpScheduler when passing Task to QueueUserWorkItem 2011-02-23 14:44:55 +00:00
Jérémie Laval d0c67f7e87 Don't create a new lambda everytime when queuing Task via ThreadPool QueueUserWorkItem 2011-02-23 14:44:54 +00:00
Jérémie Laval b2e391a309 Try to execute task inline when they are ready to run and we wait on them with no timeout 2011-02-23 14:44:53 +00:00
Jérémie Laval 3d4f602354 Threadpool Task scheduler 2011-02-23 14:44:53 +00:00
Jérémie Laval 2b62b097df Create PLinq query tasks attached to their eventual task parent by default 2011-02-23 14:44:52 +00:00
Jérémie Laval b816837188 When choosing the number of Task to create for a PLinq query, check if we are already in a running Task 2011-02-23 14:44:52 +00:00
Jérémie Laval c084efc79e Implement properly TaskScheduler's FromCurrentSynchronizationContext 2011-02-23 14:44:51 +00:00
Jérémie Laval 07791b1406 Adapt Parallel.For stealing to all processor flavors 2011-02-23 14:44:51 +00:00
Jérémie Laval 9ba41cadd2 Allow multiple invocation of Task Execute method to allow short-circuiting without breaking deque ordering 2011-02-23 14:28:43 +00:00
Miguel de Icaza ca02c72ecb Avoid warnings, should fix OpenSUSE builds 2011-02-22 19:30:48 -05:00
Andrew Jorgensen f5b2849d72 Version 2.10.1 2011-02-22 14:16:00 -07:00
Ankit Jain 8c4808fc36 [xbuild] Add new reserved properties $(MSBuildThisFile*).
Also, fixes bug #668955.

Add new reserved properties $(MSBuildThisFile*).
Unlike the $(MSBuildProjectFile), the *This* properties are evaluated
in the context where they were used. Eg. if such a property was
referenced in a PropertyGroup, then it would refer to the file
containing the that definition, and *not* the main project file.
It applies to items and tasks/targets also.

* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildChoose.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs:
Add DefinedInFileName property.

* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:
Add a stack to keep track the "current" file, which is used to set
the $(MSBuildThisFile*) properties. Update the properties on
Push/Pop.

* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs:
Push/Pop the "current" file, when evaluating a property/item/etc.

* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:
Push/Pop the "current" file, when building. This ensures that the
references in the target definition get evaluated correctly.

* Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs:
Add corresponding test.
2011-02-23 01:38:40 +05:30
Rodrigo Kumpera ed23f897c4 Properly check arguments in List<T> ICollection.CopyTo.
* List.cs (ICollection.CopyTo): Properly check
	the array argument to match MS semantics.

	Fixes #672907
2011-02-22 18:51:20 +01:00
Ankit Jain b636b093d2 [xbuild] Use the env var $MSBuildExtensionsPath before trying other paths.
Change the order of the "search paths", so that the environment
variable can always override it.
Update the man page to reflect the change.
2011-02-22 21:39:00 +05:30
Zoltan Varga e433c33f9f Fix the passing of the mrgctx argument in case of a virtual->nonvirtual optimization. Fixes #672446. 2011-02-22 15:30:33 +01:00
Hib Eris 21528f97be Fix gsize for 64-bit Windows 2011-02-22 14:41:14 +01:00
Zoltan Varga a7c3c38901 Avoid returning TRUE from mono_domain_finalize () if it is interrupted by sdb. Fixes #673592. 2011-02-22 05:36:34 +01:00
Zoltan Varga 5766da53da Fix arm thunk creation in dynamic methods. Fixes #673828. 2011-02-22 00:51:50 +01:00
Marek Habersack 3e6f82d10c [transactions] When cloning a transaction make sure to copy all the stuff that matters.
The volatiles and durables lists must be copied even if they are empty. The calling code
might still be accessing them via the original transaction (as is the case with Orchard+NHibernate)
2011-02-21 23:38:23 +01:00
Marek Habersack 01e4a9bb55 [asp.net] Fix for bug #669807. Cache session item locks as the item might be cleared before the lock needs to be released. 2011-02-21 19:50:33 +01:00
Geoff Norton e09f898428 Implement proper TSD lookup for arm-darwin 2011-02-21 13:37:06 -05:00
Geoff Norton 1d3ed22ab2 OSX 10.6 properly respected signal handlers before invoking the crash reporter 2011-02-20 23:01:50 -05:00
Zoltan Varga abdc66ca35 Implement mono_memory_barrier () and OP_MEMORY_BARRIER for ARM. 2011-02-20 03:23:33 +01:00
Zoltan Varga affd549250 Make the var/mvar caches per-image, since the generic params they refer to can be freed on domain unload. Fixes part of #672939. 2011-02-20 01:54:34 +01:00
Zoltan Varga a98ce10d71 Revert "[Win64] Compilation fix for eglib in win64"
This reverts commit 97bc578e86.
2011-02-19 23:27:25 +01:00
Zoltan Varga 432ed84634 Reorganize the way jump_target_hash is stored in the JIT. Free entries in jump_target_hash which point inside a dynamic method when it is freed. Fixes #669815. 2011-02-19 22:24:06 +01:00
Geoff Norton b2eaffda65 Avoid leaking a mach_port every time we query the counters 2011-02-19 12:22:19 -05:00
Miguel de Icaza 78a1ca7417 Backport support for add support for new PerformanceCounter("Process", "% Processor Time", "<process id as string>" on OS X 2011-02-19 12:03:32 -05:00
Gonzalo Paniagua Javier 7372ca74ef [eglib] Move definition of GPid to eglib-config.h
This new patch moves the definition of GPid from glib.h to eglib-config.h and
	determines the the type of pid_t in configure.

	Pach from Hib Eris that fixes bug #670076.
2011-02-19 11:50:46 -05:00
Gonzalo Paniagua Javier 97bc578e86 [Win64] Compilation fix for eglib in win64
Compiling for 64 bit windows breaks on incorrect gsize.
	Patch by Hib Eris that fixes bug #673581.
2011-02-19 11:43:54 -05:00
Miguel de Icaza adc1bd510c [594642] System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces fix for MacOS X 2011-02-19 11:06:00 -05:00
Gonzalo Paniagua Javier 5ef11410bd Fix the check for version and PublicKeyToken
When loading an assembly we were comparing Version(0,0,0,0) with null
	and a 0 length PKT with an actual one when those two cases are the
	default.
	Fixes bug #661461.
2011-02-19 10:14:12 -05:00
Rodrigo Kumpera 843a59e2ab Handle overrides on events when retrieving cattrs.
* MonoCustomAttrs.cs (GetBase): Special case events
	when retrieving the base event to lookup cattrs.

	* AttributeTest.cs: Add regression test.

	Fixes #662867
2011-02-18 23:38:28 +01:00
Mark Probst 9bd2159a5f [sgen] Fix some debug functions. 2011-02-18 23:18:09 +01:00
Zoltan Varga 0b63e96ade Set cfg->uses_rgctx_reg in another code path too on arm, to fix --regression generics.exe. 2011-02-18 23:09:51 +01:00
Zoltan Varga 17a13200f8 Work around a gcc bug on arm. 2011-02-18 23:06:32 +01:00
Rodrigo Kumpera b48e7b5988 Handle gsharing and marshal by ref.
* method-to-ir.c (mono_emit_method_call_full): Non virtual
	marshal by ref methods with gsharing context must always
	be called using indirect calls.

	Fixes #665893
2011-02-18 17:14:27 +01:00
Atsushi Eno ba4c090467 Fix infinite loop in DiscoveryMessageSequence equality comparison. 2011-02-18 16:32:57 +09:00
Atsushi Eno b9b1ae5876 Do not try to serialize null header item. 2011-02-18 16:23:58 +09:00
Atsushi Eno 223d09ec41 Fix wrong element name (AppSequenceType->AppSequence). 2011-02-18 16:14:08 +09:00
Atsushi Eno e72dcebf98 Almost eliminate wrong use of Constants.WsaNamespace.
They should be addressing-version-aware.
2011-02-18 16:11:16 +09:00
Atsushi Eno 980810dc82 EndpointAddressAugust2004 was not serialized correctly.
Well, Actually unified the implementation with 10.
2011-02-18 15:54:52 +09:00
Rodrigo Kumpera 6d7b16c0d2 Make sure we keep a root for the delegates when calling them.
* method-to-ir.c (mono_emit_method_call_full): Make sure
	we keep a root for delegates when calling them using the
	fast delegate dispatch.

	Fixes #667921
2011-02-17 21:59:44 +01:00
Marek Habersack d8d5da5c30 [asp.net,mvc3] Fix for bug #668655. Implemented a few more NameValueCollection method overloads. 2011-02-17 19:37:05 +01:00
Atsushi Eno 931c55c115 get out from NET_4_0. 2011-02-17 22:20:56 +09:00
Atsushi Eno dcd3787a52 Couple of corcompare fixes. 2011-02-17 21:09:50 +09:00
Atsushi Eno 995d298d00 Only use non-null values in ServiceAuthorizationBehavior. 2011-02-17 21:09:40 +09:00
Atsushi Eno 582c628f21 Fill a couple of missing ServiceAuthorizationElement implementation. 2011-02-17 21:09:29 +09:00
Atsushi Eno 10e94f0efa HTTP authentication in HttpListener had dropped during refactoring. Now it's back. 2011-02-17 21:09:19 +09:00
Geoff Norton f45ca2b65e Fix ARCH_STORE_REGS on arm to save r0->r12 properly 2011-02-16 16:10:31 -05:00
Geoff Norton c9231c0248 Remove dead code 2011-02-16 15:04:47 -05:00
Atsushi Eno b5491e25d9 MakXsdDataContractExporter refactoring to generally use SerializationMap.XmlName.
Fixed bug #670539.
2011-02-17 00:56:59 +09:00
Hib Eris ea0673de2b Decorate _image_base__ with __MINGW_LSYMBOL
This fix is needed in compiling for x86_x64.
2011-02-16 15:22:26 +01:00
Atsushi Eno f8d7872cc4 Don't reject serialization map for existing different (but same-purpose) type. 2011-02-16 18:50:02 +09:00
Atsushi Eno ead615dca5 To header seems mandatory in April2005, so fill it. 2011-02-16 18:19:14 +09:00
Atsushi Eno 4ed4702907 April2005 AppSequence needs default constructor for deserialization. 2011-02-16 18:19:03 +09:00
Atsushi Eno be750c099d xsi:type parsing is wrong in default namespace resolution.
Fixed case #3 in bug #652331.
2011-02-16 18:04:18 +09:00
Atsushi Eno 4b82e7b3b2 Operation interface methods also have ServiceKnownType attributes. 2011-02-16 17:07:10 +09:00
Atsushi Eno 1e17218a2d KnownTypeCollection; recursively registered type was not added to the collection while it is "registered" state. 2011-02-16 16:06:15 +09:00
Jérémie Laval 423f895412 Implement TaskFactory.FromAsync 2011-02-15 18:38:29 +00:00
Ankit Jain d6070f1383 [xbuild] Fix bug #671700, resource naming in presence of "Link".
AssignTargetPath.cs: If 'Link' metadata is present, then use that
as the target path.

Add relevant test.
2011-02-15 20:18:36 +05:30
Marek Safar f1e818a76f [671878] Fixes IKVM ordering of catch clauses 2011-02-15 14:33:14 +00:00
Atsushi Eno a28a9520b5 Async MessageContract pattern needs more sophisticated contract validity check.
It totally killed discovery.
2011-02-15 23:25:31 +09:00
Atsushi Eno 6907827b05 Message headers are now serialized and deserialized for MessageHeaderDescription. 2011-02-15 23:15:32 +09:00
Atsushi Eno 6ea68b9128 ServiceDescription.cs does not exist in moonlight, so move TypeExtension. 2011-02-15 22:38:20 +09:00
Atsushi Eno 7c37c423e1 MessageHeaderDescription were not filled in message contract. Reject wrong contracts. 2011-02-15 22:13:25 +09:00
Atsushi Eno 8854623440 implement some ServiceHostBase public methods that already existed internally. 2011-02-15 22:13:18 +09:00
Atsushi Eno 7b088dc2a4 When the callback contract type is the same as the contract, do not block replies. 2011-02-15 15:51:44 +09:00
Atsushi Eno e19f4be52c EndpointAddress could be empty on opening the factory. 2011-02-15 15:51:38 +09:00
Atsushi Eno 20b58344cc PeeDuplex ChannelFactory must be opened in prior to create channels. 2011-02-15 15:51:32 +09:00
Atsushi Eno c310cd6556 add private setter for message serialization.
Not sure if it is hack or required-to-do though.
2011-02-15 15:51:26 +09:00
Veerapuram Varadhan fc074bb4fa [bugfix]667855 - Fix handling of oracle raw data type appropriately. 2011-02-15 01:25:00 +05:30
Gonzalo Paniagua Javier a7bfba4549 [HttpListener] UserHostName includes the port. 2011-02-14 14:38:26 -05:00
Gonzalo Paniagua Javier a65b6c7523 [HttpWebRequest] EndGetResponse already does this. 2011-02-14 14:38:26 -05:00
Gonzalo Paniagua Javier 7730c00a02 [HttpWebRequest] Use the timeout in GetResponse()
The timeout was not being used in GetResponse.
	Fixes bug #603794.
2011-02-14 14:38:26 -05:00
701 changed files with 22966 additions and 4968 deletions

No files matched your search

+125 -10
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.10)
AM_INIT_AUTOMAKE(mono,2.10.3)
AM_MAINTAINER_MODE
API_VER=2.0
@@ -78,6 +78,7 @@ esac
host_win32=no
target_win32=no
platform_android=no
case "$host" in
*-mingw*|*-*-cygwin*)
AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
@@ -172,6 +173,41 @@ case "$host" in
with_sigaltstack=no
use_sigposix=yes
;;
*-*-linux-android*)
host_win32=no
platform_android=yes
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
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"
libdl="-ldl"
libgc_threads=pthreads
use_sigposix=yes
with_tls=pthread
with_sigaltstack=no
with_static_mono=no
# Android doesn't support boehm, as it's missing <link.h>
support_boehm=no
with_gc=sgen
# isinf(3) requires -lm; see isinf check below
LDFLAGS="$LDFLAGS -lm"
# Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
# PAGE_SIZE; breaks mono/io-layer/collection.c
# Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
# to bypass the underscore linker check, can't work when cross-compiling
mono_cv_uscore=yes
;;
*-*-linux*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
@@ -248,12 +284,12 @@ case "$host" in
if test "x$cross_compiling" = "xyes"; then
has_broken_apple_cpp=yes
fi
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin10.0.0, but
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin*, but
dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
case "$host" in
dnl Snow Leopard config.guess reports as this
i*86-*-darwin10*)
dnl Snow Leopard and newer config.guess reports as this
i*86-*-darwin*)
BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
@@ -294,6 +330,7 @@ AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
@@ -443,6 +480,20 @@ if test x"$GCC" = xyes; then
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
ORIG_CFLAGS=$CFLAGS
# Check for the normal version, since gcc ignores unknown -Wno options
CFLAGS="$CFLAGS -Wunused-but-set-variable"
AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
AC_TRY_COMPILE([], [
void main () { }
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
else
# The Sun Forte compiler complains about inline functions that access static variables
# so disable all inlining.
@@ -657,7 +708,7 @@ DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping.],
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping, shared_perfcounters.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -782,6 +833,11 @@ if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
AC_MSG_NOTICE([Disabled Assembly remapping.])
fi
if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
AC_DEFINE(DISABLE_SHARED_PERFCOUNTERS, 1, [Disable shared perfcounters.])
AC_MSG_NOTICE([Disabled Shared perfcounters.])
fi
AC_MSG_CHECKING(for visibility __attribute__)
AC_TRY_COMPILE([], [
void __attribute__ ((visibility ("hidden"))) doit (void) {}
@@ -813,6 +869,9 @@ if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
dnl
dnl Boehm GC configuration
dnl
@@ -1560,6 +1619,12 @@ if test x$target_win32 = xno; then
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
fi
havekqueue=no
AC_CHECK_FUNCS(kqueue, , AC_MSG_CHECKING(for kqueue in sys/event.h)
AC_TRY_LINK([#include <sys/event.h>],
[ kqueue(); ],
AC_DEFINE(HAVE_KQUEUE, 1, [Have kqueue]) AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)))
dnl ******************************
dnl *** Checks for SIOCGIFCONF ***
dnl ******************************
@@ -2262,8 +2327,10 @@ case "$host" in
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -DARM_FPU_NONE=1"
CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__ -DHAVE_ARMV6=1"
jit_wanted=true
# libgc's gc_locks.h depends on this
NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6"
sgen_supported=true
;;
arm*-linux*)
@@ -2296,12 +2363,12 @@ case "$host" in
esac
if test "x$host" != "x$target"; then
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
case "$target" in
powerpc64-ps3-linux-gnu)
TARGET=POWERPC64
arch_target=powerpc64
AC_DEFINE(TARGET_PS3, 1, [...])
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
# It would be better to just use TARGET_POWERPC64, but lots of code already
# uses this define
AC_DEFINE(__mono_ppc64__, 1, [...])
@@ -2314,7 +2381,6 @@ if test "x$host" != "x$target"; then
TARGET=POWERPC64
arch_target=powerpc64
AC_DEFINE(TARGET_XBOX360, 1, [...])
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
# It would be better to just use TARGET_POWERPC64, but lots of code already
# uses this define
sizeof_register=8
@@ -2324,12 +2390,49 @@ if test "x$host" != "x$target"; then
TARGET=AMD64
arch_target=amd64
AC_DEFINE(TARGET_AMD64, 1, [...])
AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
;;
armv7l-unknown-linux-gnueabi*)
# TEGRA
TARGET=ARM;
arch_target=arm;
AC_DEFINE(TARGET_ARM, 1, [...])
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -DARM_FPU_VFP=1 -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
;;
armv5tel-unknown-linux-gnueabi*)
TARGET=ARM;
arch_target=arm;
AC_DEFINE(TARGET_ARM, 1, [...])
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
with_tls=pthread
;;
armv5-*-linux-androideabi*)
TARGET=ARM;
arch_target=arm;
AC_DEFINE(TARGET_ARM, 1, [...])
AC_DEFINE(TARGET_ANDROID, 1, [...])
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DARM_FPU_NONE=1"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offset
# in mono-compiler.h
with_tls=pthread
;;
*)
AC_MSG_WARN([Cross compiling is only supported for targets matching 'powerpc64-{ps3,xbox360}-linux-gnu'])
AC_MSG_ERROR([Cross compiling is not supported for target $target])
esac
fi
@@ -2561,6 +2664,18 @@ if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_bui
AC_MSG_RESULT($fpu)
CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
unset fpu
AC_MSG_CHECKING(for ARMV6)
AC_TRY_RUN([
int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; }
], armv6=yes, armv6=no)
AC_MSG_RESULT($armv6)
if test ${armv6} = yes; then
AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
# libgc's gc_locks.h depends on this
NESTED_LIBGC_FLAGS="$NESTED_LIBGC_FLAGS -DHAVE_ARMV6"
fi
fi
if test ${TARGET} = unknown; then
+2
View File
@@ -3,3 +3,5 @@
/config
/.cvsignore
/*.pc
/gdb/mono-sgen-gdb.py
/mono-sgen-gdb.py
+8 -2
View File
@@ -21,8 +21,10 @@ pkgconfigdir = $(libdir)/pkgconfig
if SUPPORT_SGEN
SGENPCFILE=monosgen-2.pc
SGENGDBFILE=mono-sgen-gdb.py
else
SGENPCFILE=
SGENGDBFILE=
endif
if JIT_SUPPORTED
@@ -38,11 +40,15 @@ pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc mon
endif
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc $(SGENPCFILE)
system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc system.web.mvc2.pc monosgen-2.pc mono-sgen-gdb.py
mono_DATA = config \
browscap.ini
gdbdir = $(bindir)
gdb_DATA = gdb/mono-gdb.py
mono-sgen-gdb.py: gdb/mono-gdb.py
cp $< $@
gdb_DATA = gdb/mono-gdb.py $(SGENGDBFILE)
+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="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
<dllmap dll="libcups" target="libcups.dylib" os="osx"/>
<dllmap dll="i:kernel32.dll">
+36 -10
View File
@@ -40,23 +40,34 @@ AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
platform_darwin=no
platform_android=no
case $host in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
PATHSEP='\\'
SEARCHSEP=';'
OS="WIN32"
PIDTYPE='void *'
;;
*-*darwin*)
platform_darwin=yes
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
*-*-linux-android*)
platform_android=yes
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
*)
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
PIDTYPE='int'
;;
esac
@@ -84,12 +95,16 @@ AC_SUBST(CFLAGS)
AC_SUBST(PATHSEP)
AC_SUBST(SEARCHSEP)
AC_SUBST(OS)
AC_SUBST(PIDTYPE)
AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strndup strlcpy getpwuid_r strtok_r rewinddir vasprintf)
AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x )
AC_CHECK_LIB(iconv, iconv_open, LIBS="$LIBS -liconv")
@@ -130,16 +145,7 @@ AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localch
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)
if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
GPOINTER_TO_UINT="((guint)(long) (ptr))"
GINT_TO_POINTER="((gpointer)(glong) (v))"
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
GSIZE="long"
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
G_GINT64_FORMAT='"ld"'
else
if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint) (ptr))"
GPOINTER_TO_UINT="((guint) (ptr))"
GINT_TO_POINTER="((gpointer) (v))"
@@ -148,6 +154,26 @@ else
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
G_GINT64_FORMAT='"lld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
GPOINTER_TO_UINT="((guint)(long) (ptr))"
GINT_TO_POINTER="((gpointer)(glong) (v))"
GUINT_TO_POINTER="((gpointer)(gulong) (v))"
GSIZE="long"
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
G_GINT64_FORMAT='"ld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
GPOINTER_TO_INT="((gint)(long long) (ptr))"
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
GINT_TO_POINTER="((gpointer)(long long) (v))"
GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
GSIZE="long long"
GSIZE_FORMAT='"I64u"'
G_GUINT64_FORMAT='"I64u"'
G_GINT64_FORMAT='"I64i"'
else
AC_MSG_ERROR([unsupported pointer size])
fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+4
View File
@@ -61,6 +61,10 @@ INCLUDES = -I$(srcdir)
if HOST_WIN32
libeglib_la_LIBADD = -lm $(ICONV_LIBS) -lpsapi
else
if PLATFORM_ANDROID
libeglib_la_LIBADD = -llog
endif
endif
libeglib_static_la_LIBADD = $(libeglib_la_LIBADD)
+2
View File
@@ -42,4 +42,6 @@ typedef signed @GSIZE@ gssize;
#define G_BREAKPOINT()
#endif
typedef @PIDTYPE@ GPid;
#endif
+2 -3
View File
@@ -62,8 +62,6 @@ typedef int pid_t;
#undef G_HAVE_STRNDUP
#define G_HAVE_GETOPT_H 1
int vasprintf(char **ret, const char *fmt, va_list ap);
/* disable the following warnings
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
* C4127: conditional expression is constant
@@ -71,4 +69,5 @@ int vasprintf(char **ret, const char *fmt, va_list ap);
#pragma warning(disable:4100 4127)
#endif
#endif
typedef void * GPid;
#endif
+5 -5
View File
@@ -47,14 +47,14 @@ g_dir_open (const gchar *path, guint flags, GError **error)
GDir *dir;
gunichar2* path_utf16;
gunichar2* path_utf16_search;
WIN32_FIND_DATA find_data;
WIN32_FIND_DATAW find_data;
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
dir = g_new0 (GDir, 1);
path_utf16 = u8to16 (path);
path_utf16_search = g_malloc ((wcslen(path_utf16) + 3)*sizeof(gunichar2));
path_utf16_search = g_malloc ((wcslen((wchar_t *) path_utf16) + 3)*sizeof(gunichar2));
wcscpy (path_utf16_search, path_utf16);
wcscat (path_utf16_search, L"\\*");
@@ -72,7 +72,7 @@ g_dir_open (const gchar *path, guint flags, GError **error)
g_free (path_utf16_search);
g_free (path_utf16);
while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0)) {
while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0)) {
if (!FindNextFileW (dir->handle, &find_data)) {
if (error) {
gint err = errno;
@@ -91,7 +91,7 @@ g_dir_open (const gchar *path, guint flags, GError **error)
const gchar *
g_dir_read_name (GDir *dir)
{
WIN32_FIND_DATA find_data;
WIN32_FIND_DATAW find_data;
g_return_val_if_fail (dir != NULL && dir->handle != 0, NULL);
@@ -111,7 +111,7 @@ g_dir_read_name (GDir *dir)
dir->next = NULL;
return dir->current;
}
} while ((wcscmp (find_data.cFileName, L".") == 0) || (wcscmp (find_data.cFileName, L"..") == 0));
} while ((wcscmp ((wchar_t *) find_data.cFileName, L".") == 0) || (wcscmp ((wchar_t *) find_data.cFileName, L"..") == 0));
dir->next = u16to8 (find_data.cFileName);
return dir->current;
+5
View File
@@ -33,9 +33,14 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef _MSC_VER
#include <direct.h>
#endif
#ifdef G_OS_WIN32
int mkstemp (char *tmp_template);
#endif
+4
View File
@@ -39,9 +39,13 @@
#ifdef G_OS_WIN32
#include <io.h>
#define open _open
#ifndef S_ISREG
#define S_ISREG(x) ((x & _S_IFMT) == _S_IFREG)
#endif
#ifndef S_ISDIR
#define S_ISDIR(x) ((x & _S_IFMT) == _S_IFDIR)
#endif
#endif
int mkstemp (char *tmp_template)
{
+7 -11
View File
@@ -13,14 +13,6 @@
#pragma include_alias(<eglib-config.h>, <eglib-config.hw>)
#else
#include <stdint.h>
/* For pid_t */
#ifndef WIN32
#include <unistd.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#endif
#endif
#include <eglib-config.h>
@@ -48,6 +40,12 @@
G_BEGIN_DECLS
#ifdef G_OS_WIN32
/* MSC and Cross-compilatin will use this */
int vasprintf (char **strp, const char *fmt, va_list ap);
#endif
/*
* Basic data types
*/
@@ -677,7 +675,7 @@ gunichar *g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read,
#define u8to16(str) g_utf8_to_utf16(str, (glong)strlen(str), NULL, NULL, NULL)
#ifdef G_OS_WIN32
#define u16to8(str) g_utf16_to_utf8(str, (glong)wcslen(str), NULL, NULL, NULL)
#define u16to8(str) g_utf16_to_utf8((gunichar2 *) (str), (glong)wcslen((wchar_t *) (str)), NULL, NULL, NULL)
#else
#define u16to8(str) g_utf16_to_utf8(str, (glong)strlen(str), NULL, NULL, NULL)
#endif
@@ -720,8 +718,6 @@ typedef enum {
G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6
} GSpawnFlags;
typedef pid_t GPid;
typedef void (*GSpawnChildSetupFunc) (gpointer user_data);
gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, gchar **standard_error, gint *exit_status, GError **error);
+4 -3
View File
@@ -80,7 +80,7 @@ g_unsetenv(const gchar *variable)
{
gunichar2 *var;
var = u8to16(variable);
SetEnvironmentVariableW(var, TEXT(""));
SetEnvironmentVariableW(var, L"");
g_free(var);
}
@@ -98,14 +98,15 @@ g_path_is_absolute (const char *filename)
{
g_return_val_if_fail (filename != NULL, FALSE);
if (filename[0] != '\0' && filename[1] != '\0')
if (filename[1] == ':' && filename[2] != '\0' &&
if (filename[0] != '\0' && filename[1] != '\0') {
if (filename[1] == ':' && filename[2] != '\0' &&
(filename[2] == '\\' || filename[2] == '/'))
return TRUE;
/* UNC paths */
else if (filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '\0')
return TRUE;
}
return FALSE;
}
+1 -1
View File
@@ -53,7 +53,7 @@ g_module_open (const gchar *file, GModuleFlags flags)
gunichar2 *file16;
file16 = u8to16(file);
module->main_module = FALSE;
module->handle = LoadLibrary (file16);
module->handle = LoadLibraryW (file16);
g_free(file16);
if (!module->handle) {
g_free (module);
+3 -1
View File
@@ -68,7 +68,9 @@ g_build_path (const gchar *separator, const gchar *first_element, ...)
g_string_append_len (result, s, p - s);
if (next && *next){
if (strncmp (separator, result->str + strlen (result->str) - slen, slen))
int reslen = strlen (result->str);
if (reslen >= slen && strncmp (separator, result->str + reslen - slen, slen))
g_string_append (result, separator);
for (; strncmp (next, separator, slen) == 0; )
+2 -2
View File
@@ -57,7 +57,7 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **error)
} else if (quote_char) {
if (c == quote_char) {
quote_char = '\0';
if (fresh && g_ascii_isspace (*ptr)){
if (fresh && (g_ascii_isspace (*ptr) || *ptr == '\0')){
g_ptr_array_add (array, g_string_free (str, FALSE));
str = g_string_new ("");
}
@@ -225,7 +225,7 @@ g_shell_unquote (const gchar *quoted_string, GError **error)
}
} else if (*p == '\\'){
char c = *(++p);
if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == 0))
if (!(c == '$' || c == '"' || c == '\\' || c == '`' || c == '\'' || c == 0 ))
g_string_append_c (result, '\\');
if (c == 0)
break;
+2 -1
View File
@@ -79,6 +79,7 @@ gchar ***_NSGetEnviron();
extern char **environ;
#endif
#ifndef G_OS_WIN32
static int
safe_read (int fd, gchar *buffer, gint count, GError **error)
{
@@ -185,7 +186,7 @@ create_pipe (int *fds, GError **error)
}
return TRUE;
}
#endif /* G_OS_WIN32 */
gboolean
g_spawn_command_line_sync (const gchar *command_line,
gchar **standard_output,
+6 -6
View File
@@ -300,13 +300,13 @@ g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gs
gboolean
g_get_charset (G_CONST_RETURN char **charset)
{
if (my_charset == NULL) {
#ifdef G_OS_WIN32
static char buf[14];
sprintf (buf, "CP%u", GetACP ());
*charset = buf;
is_utf8 = FALSE;
static char buf [14];
sprintf (buf, "CP%u", GetACP ());
my_charset = buf;
is_utf8 = FALSE;
#else
if (my_charset == NULL){
/* These shouldn't be heap allocated */
#if HAVE_LOCALCHARSET_H
my_charset = locale_charset ();
@@ -316,12 +316,12 @@ g_get_charset (G_CONST_RETURN char **charset)
my_charset = "UTF-8";
#endif
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
#endif
}
if (charset != NULL)
*charset = my_charset;
#endif
return is_utf8;
}
+3 -1
View File
@@ -71,7 +71,7 @@ utf8_to_utf16_len (const gchar *str, glong len, glong *items_read, GError **erro
ret = 0;
/* Common case */
for (in_pos = 0; in_pos < len && str [in_pos] < 0x80; in_pos++)
for (in_pos = 0; in_pos < len && (guchar) str [in_pos] < 0x80; in_pos++)
ret ++;
if (in_pos == len) {
@@ -338,6 +338,7 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
} else {
surrogate = 0;
/* invalid surrogate pair */
++in_pos;
continue;
}
} else {
@@ -354,6 +355,7 @@ g_utf16_to_utf8 (const gunichar2 *str, glong len, glong *items_read, glong *item
else if (ch >= 0xD800 && ch <= 0xDBFF)
surrogate = ch;
else if (ch >= 0xDC00 && ch <= 0xDFFF) {
++in_pos;
/* invalid surrogate pair */
continue;
}
+2 -1
View File
@@ -17,7 +17,7 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
len = vsnprintf(NULL, 0, fmt, ap2);
#endif
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
if (len >= 0 && (buf = malloc ((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
@@ -28,3 +28,4 @@ int vasprintf(char **ret, const char *fmt, va_list ap)
va_end(ap2);
return len;
}
+12
View File
@@ -20,6 +20,8 @@ RESULT
test_buildpath ()
{
char *s;
char *buffer = "var/private";
char *dir = "/";
s = g_build_path ("/", "hola///", "//mundo", NULL);
if (strcmp (s, "hola/mundo") != 0)
@@ -99,6 +101,16 @@ test_buildpath ()
return FAILED ("must get a non-NULL return");
if (s [0] != 0)
return FAILED ("must get an empty string");
// This is to test the regression introduced by Levi for the Windows support
// that code errouneously read below the allowed area (in this case dir [-1]).
// and caused all kinds of random errors.
dir = "//";
dir++;
s = g_build_filename (dir, buffer, NULL);
if (s [0] != '/')
return FAILED ("Must have a '/' at the start");
g_free (s);
return OK;
}
+8
View File
@@ -250,6 +250,14 @@
#endif
}
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
#ifdef HAVE_ARMV6
/* Memory barrier */
__asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
#endif
*(addr) = 0;
}
# define GC_CLEAR_DEFINED
# endif /* ARM32 */
# ifdef CRIS
inline static int GC_test_and_set(volatile unsigned int *addr) {
+8 -1
View File
@@ -2131,7 +2131,14 @@ void GC_unmap_gap(ptr_t start1, word bytes1, ptr_t start2, word bytes2)
len -= free_len;
}
# else
if (len != 0 && munmap(start_addr, len) != 0) ABORT("munmap failed");
if (len != 0) {
/* Immediately remap as above. */
void * result;
result = mmap(start_addr, len, PROT_NONE,
MAP_PRIVATE | MAP_FIXED | OPT_MAP_ANON,
zero_fd, 0/* offset */);
if (result != (void *)start_addr) ABORT("mmap(...PROT_NONE...) failed");
}
GC_unmapped_bytes += len;
# endif
}
+11 -1
View File
@@ -1038,7 +1038,7 @@ method. The right option, unfortunately, requires experimentation.
When using Mono with the SGen garbage collector this environment
variable can be used to turn on various debugging features of the
collector. The value of this variable is a comma separated list of
words.
words. Do not use these options in production.
.RS
.ne 8
.TP
@@ -1063,6 +1063,13 @@ This clears the nursery at GC time instead of doing it when the thread
local allocation buffer (TLAB) is created. The default is to clear
the nursery at TLAB creation time.
.TP
\fBdisable-minor\fR
Don't do minor collections. If the nursery is full, a major collection
is triggered instead, unless it, too, is disabled.
.TP
\fBdisable-major\fR
Don't do major collections.
.TP
\fBconservative-stack-mark\fR
Forces the GC to scan the stack conservatively, even if precise
scanning is available.
@@ -1403,6 +1410,9 @@ be used when writing messages like this: Console.Error:MyProgramName.
See the System.Diagnostics.DefaultTraceListener documentation for more
information.
.TP
\fBMONO_WCF_TRACE\fR
This eases WCF diagnostics functionality by simply outputs all log messages from WCF engine to "stdout", "stderr" or any file passed to this environment variable. The log format is the same as usual diagnostic output.
.TP
\fBMONO_XEXCEPTIONS\fR
This throws an exception when a X11 error is encountered; by default a
message is displayed but execution continues
+72 -5
View File
@@ -41,8 +41,32 @@ Validate the project file against the schema
.B \//validate:<schema>
Validate the project file against the specified schema
.TP
.B \//consoleloggerparameters:<params>
Parameters for the console logger : PerfomanceSummary, NoSummary, NoItemAndPropertyList
.B \//consoleloggerparameters:<params> , /clp:<params>
Parameters for the console logger : PerfomanceSummary, Summary, NoSummary, NoItemAndPropertyList, Verbosity
.TP
.B \//filelogger[n] , /fl[n]
Logs the output to a file, named 'msbuild.log' by default. If the optional number 'n' is
specified, then it logs to 'msbuild[n].log' . Parameters for this logger, including
the log file name can be specified via a corresponding /flp[n] option. Default verbosity
for file loggers is 'detailed. 'n' can be between 1-9.
.TP
.B \//fileloggerparameters[n]:<params> , /flp[n]:<params>
Parameters for a file logger. This implies a corresponding /fl[n]. 'n' can be between
1-9, and is used to add upto 10 file loggers. Parameters can be, besides the ones available
for console logger:
.RS
.TP
.I LogFile=<file>
File to which the build log will be written.
.TP
.I Append
If this is used, then the log file is appended to, else a new one will be created.
.TP
.I Encoding=<encoding>
Encoding to use for the log file, eg. UTF-8, ASCII.
.TP
Eg: xbuild foo.csproj /flp:Verbosity=normal "/flp1:LogFile=build.log;Append;Encoding=ASCII"
.RE
.TP
.B \//nologo
Don't show the initial xbuild banner
@@ -73,8 +97,8 @@ to $prefix/lib/mono/xbuild . When used in Import, like:
xbuild tries various values for the msbuild property $(MSBuildExtensionsPath), in order:
1. /Library/Frameworks/Mono.framework/External/xbuild on Mac OSX.
2. Paths specified in the environment variable $MSBuildExtensionsPath.
1. Paths specified in the environment variable $MSBuildExtensionsPath.
2. /Library/Frameworks/Mono.framework/External/xbuild on Mac OSX.
3. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
4. $prefix/lib/mono/xbuild (default location)
@@ -82,6 +106,49 @@ Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve
location. This is a xbuild-only feature.
This is also applicable for the properties $(MSBuildExtensionsPath32) and $(MSBuildExtensionsPath64),
and the environment variables have the corresponding names - MSBuildExtensionsPath32/64 .
.TP
.I "XBUILD_FRAMEWORK_FOLDERS_PATH"
With ToolsVersion 4.0, projects can target arbitrary frameworks referenced by TargetFrameworkMoniker,
which is of the format:
Identifier,Version=<version>[,Profile=<profile>]
Eg. ".NETFramework,Version=v4.0"
The 3 parts of the moniker are given by the msbuild properties:
$(TargetFrameworkIdentifier), $(TargetFrameworkVersion) and $(TargetFrameworkProfile)
This moniker maps to a framework description file on disk:
<framework_root>/Identifier/Version/[Profile]/RedistList/FrameworkList.xml
This file is used to determine the path where to find the framework assemblies for this particular framework.
Framework root here is configurable and is resolved in the following order:
.nf
1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
3. MSBuild property $(TargetFrameworkRoot)
4. $prefix/lib/mono/xbuild-frameworks (default location)
.fi
XBuild tries the paths given above, in order, till it finds a FrameworkList.xml for the moniker.
Running with /v:detailed or higher verbosity will show the various paths that it tries.
The FrameworkList.xml itself just has a root element like:
<FileList Name=".NET Framework 3.5" TargetFrameworkDirectory="..\\..\\..\\..\\3.5" IncludeFramework="v3.0">
</FileList>
Here the TargetFrameworkDirectory attribute specifies the directory where the assemblies for
this particular framework can be found. If this is not set, then the parent of the folder
containing the xml file is taken as the framework directory.
IncludeFramework attribute specifies the version of a framework (under the *same* $(TargetFrameworkIdentifier))
which should be included in the final list of Target framework directories.
.TP
.I "XBUILD_COLORS"
If this variable is set, it contains a string of the form
@@ -119,7 +186,7 @@ looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
.SH SEE ALSO
.BR mono(1), mcs(1)
.SH COPYRIGHT
Copyright (C) 2009 Novell, Inc (http://www.novell.com)
Copyright (C) 2011 Novell, Inc (http://www.novell.com)
.SH MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
+4 -16
View File
@@ -166,33 +166,21 @@ namespace IKVM.Reflection.Emit
{
return 0;
}
if (x.tryOffset >= y.handlerOffset && x.tryOffset + x.tryLength <= y.handlerOffset + y.handlerLength)
{
return -1;
}
if (y.tryOffset >= x.handlerOffset && y.tryOffset + y.tryLength <= x.handlerOffset + x.handlerLength)
{
return 1;
}
if (x.tryOffset == y.tryOffset && x.tryLength == y.tryLength)
else if (x.tryOffset == y.tryOffset && x.tryLength == y.tryLength)
{
return x.ordinal < y.ordinal ? -1 : 1;
}
if (x.tryOffset + x.tryLength <= y.tryOffset)
else if (x.tryOffset >= y.tryOffset && x.handlerOffset + x.handlerLength <= y.handlerOffset + y.handlerLength)
{
return -1;
}
if (y.tryOffset + y.tryLength <= x.tryOffset)
else if (y.tryOffset >= x.tryOffset && y.handlerOffset + y.handlerLength <= x.handlerOffset + x.handlerLength)
{
return 1;
}
if (x.tryOffset > y.tryOffset || (x.tryOffset == y.tryOffset && x.tryLength < y.tryLength))
{
return -1;
}
else
{
return 1;
return x.ordinal < y.ordinal ? -1 : 1;
}
}
}
@@ -654,6 +654,11 @@ namespace System.Windows.Forms
public int Init ()
{
int p = (int) Environment.OSVersion.Platform;
if ((p != 4) && (p != 6) && (p != 128))
// Not running on Unix.
return -1;
CheckFDOMimePaths ();
if (!fdo_mime_available)
@@ -35,14 +35,21 @@ namespace Microsoft.Build.BuildEngine {
internal class BuildChoose {
BuildWhen otherwise;
Project project;
XmlElement xmlElement;
//Project project;
//ImportedProject importedProject;
//XmlElement xmlElement;
List <BuildWhen> whens;
public BuildChoose (XmlElement xmlElement, Project project)
: this (xmlElement, project, null)
{
this.xmlElement = xmlElement;
this.project = project;
}
internal BuildChoose (XmlElement xmlElement, Project project, ImportedProject importedProject)
{
//this.xmlElement = xmlElement;
//this.project = project;
//this.importedProject = importedProject;
this.whens = new List <BuildWhen> ();
foreach (XmlNode xn in xmlElement.ChildNodes) {
@@ -65,6 +72,9 @@ namespace Microsoft.Build.BuildEngine {
otherwise = new BuildWhen (xe, project);
}
}
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
project != null ? project.FullFileName : null;
}
public void Evaluate ()
@@ -85,6 +95,8 @@ namespace Microsoft.Build.BuildEngine {
get { return whens; }
set { whens = value; }
}
internal string DefinedInFileName { get; private set; }
}
}
@@ -76,6 +76,9 @@ namespace Microsoft.Build.BuildEngine {
buildItems.Add (bi);
project.LastItemGroupContaining [bi.Name] = this;
}
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
project != null ? project.FullFileName : null;
}
public BuildItem AddNewItem (string itemName,
@@ -303,6 +306,8 @@ namespace Microsoft.Build.BuildEngine {
}
}
internal string DefinedInFileName { get; private set; }
internal bool FromXml {
get {
return itemGroupElement != null;
@@ -71,6 +71,9 @@ namespace Microsoft.Build.BuildEngine {
}
} else
this.propertiesByName = new Dictionary <string, BuildProperty> (StringComparer.InvariantCultureIgnoreCase);
DefinedInFileName = importedProject != null ? importedProject.FullFileName :
(project != null ? project.FullFileName : null);
}
public BuildProperty AddNewProperty (string propertyName,
@@ -287,7 +290,9 @@ namespace Microsoft.Build.BuildEngine {
propertiesByName [propertyName] = value;
}
}
internal string DefinedInFileName { get; private set; }
internal GroupingCollection GroupingCollection {
get { return parentCollection; }
set { parentCollection = value; }
@@ -33,13 +33,13 @@ 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.parentProject = parentProject;
this.groupingCollection = new GroupingCollection (parentProject);
if (whenElement == null)
throw new ArgumentNullException ("whenElement");
@@ -46,7 +46,7 @@ namespace Microsoft.Build.BuildEngine {
Type t = typeof (ConditionFunctionExpression);
string [] names = new string [] { "Exists", "HasTrailingSlash" };
functions = new Dictionary <string, MethodInfo> ();
functions = new Dictionary <string, MethodInfo> (StringComparer.InvariantCultureIgnoreCase);
foreach (string name in names)
functions.Add (name, t.GetMethod (name, BindingFlags.NonPublic | BindingFlags.Static));
}
@@ -60,10 +60,10 @@ namespace Microsoft.Build.BuildEngine {
public override bool BoolEvaluate (Project context)
{
if (!functions.ContainsKey (name))
throw new InvalidOperationException ();
throw new InvalidOperationException ("Unknown function named: " + name);
if (functions [name] == null)
throw new InvalidOperationException ();
throw new InvalidOperationException ("Unknown function named: " + name);
MethodInfo mi = functions [name];
object [] argsArr = new object [args.Count + 1];
@@ -197,8 +197,68 @@ namespace Microsoft.Build.BuildEngine {
public void ApplyParameter (string parameterName,
string parameterValue)
{
// FIXME: what we should do here? in msbuild it isn't
// changing "parameters" property
switch (parameterName) {
case "PerformanceSummary":
this.performanceSummary = true;
break;
case "Summary":
this.showSummary = true;
break;
case "NoSummary":
this.showSummary = false;
break;
case "NoItemAndPropertyList":
this.noItemAndPropertyList = true;
break;
default:
if (parameterName.StartsWith ("Verbosity="))
ParseVerbosity (parameterName);
break;
}
}
void ParseVerbosity (string s)
{
string key, value;
if (!TrySplitKeyValuePair (s, out key, out value))
throw new LoggerException ("Unknown Verbosity, should be set as 'Verbosity=<verbosity>'");
switch (value) {
case "q":
case "quiet":
Verbosity = LoggerVerbosity.Quiet;
break;
case "m":
case "minimal":
Verbosity = LoggerVerbosity.Minimal;
break;
case "n":
case "normal":
Verbosity = LoggerVerbosity.Normal;
break;
case "d":
case "detailed":
Verbosity = LoggerVerbosity.Detailed;
break;
case "diag":
case "diagnostic":
Verbosity = LoggerVerbosity.Diagnostic;
break;
default:
throw new LoggerException (String.Format ("Unknown verbosity - '{0}'", s));
}
}
bool TrySplitKeyValuePair (string pair, out string key, out string value)
{
key = value = null;
string[] parts = pair.Split ('=');
if (parts.Length != 2)
return false;
key = parts [0];
value = parts [1];
return true;
}
public virtual void Initialize (IEventSource eventSource)
@@ -220,6 +280,9 @@ namespace Microsoft.Build.BuildEngine {
eventSource.MessageRaised += MessageHandler;
eventSource.WarningRaised += WarningHandler;
eventSource.ErrorRaised += ErrorHandler;
if (!String.IsNullOrEmpty (parameters))
ParseParameters ();
}
public void BuildStartedHandler (object sender, BuildStartedEventArgs args)
@@ -607,21 +670,8 @@ namespace Microsoft.Build.BuildEngine {
private void ParseParameters ()
{
string[] splittedParameters = parameters.Split (';');
foreach (string s in splittedParameters ) {
switch (s) {
case "PerformanceSummary":
this.performanceSummary = true;
break;
case "NoSummary":
this.showSummary = false;
break;
case "NoItemAndPropertyList":
this.noItemAndPropertyList = true;
break;
default:
throw new ArgumentException ("Invalid parameter : " + s);
}
}
foreach (string s in splittedParameters )
ApplyParameter (s, null);
}
public virtual void Shutdown ()
@@ -779,8 +829,6 @@ namespace Microsoft.Build.BuildEngine {
if (value == null)
throw new ArgumentNullException ();
parameters = value;
if (parameters != String.Empty)
ParseParameters ();
}
}
@@ -57,7 +57,6 @@ namespace Microsoft.Build.BuildEngine {
{
Dictionary <string, bool> excludedItems;
List <ITaskItem> includedItems;
string[] splitExclude;
if (includes == null)
throw new ArgumentNullException ("Includes");
@@ -84,7 +83,7 @@ namespace Microsoft.Build.BuildEngine {
FileInfo[] fileInfo;
string name = include_item.ItemSpec;
if (name.IndexOf ('?') == -1 && name.IndexOf ('*') == -1) {
if (!HasWildcard (name)) {
if (!excludedItems.ContainsKey (Path.GetFullPath(name)))
includedItems.Add (include_item);
} else {
@@ -211,6 +210,11 @@ namespace Microsoft.Build.BuildEngine {
return fi;
}
}
public static bool HasWildcard (string expression)
{
return expression.IndexOf ('?') >= 0 || expression.IndexOf ('*') >= 0;
}
public DirectoryInfo BaseDirectory {
get { return baseDirectory; }
@@ -45,7 +45,7 @@ namespace Microsoft.Build.BuildEngine {
const string defaultTasksProjectName = "Microsoft.Common.tasks";
EventSource eventSource;
bool buildStarted;
ToolsetDefinitionLocations toolsetLocations;
//ToolsetDefinitionLocations toolsetLocations;
BuildPropertyGroup global_properties;
//IDictionary importedProjects;
List <ILogger> loggers;
@@ -73,7 +73,7 @@ namespace Microsoft.Build.BuildEngine {
public Engine (ToolsetDefinitionLocations locations)
: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
{
toolsetLocations = locations;
//toolsetLocations = locations;
}
public Engine (BuildPropertyGroup globalProperties)
@@ -86,7 +86,7 @@ namespace Microsoft.Build.BuildEngine {
: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
{
this.global_properties = globalProperties;
toolsetLocations = locations;
//toolsetLocations = locations;
}
// engine should be invoked with path where binary files are
@@ -229,6 +229,33 @@ namespace Microsoft.Build.BuildEngine {
IDictionary targetOutputs,
BuildSettings buildFlags, string toolsVersion)
{
bool result = false;
try {
StartEngineBuild ();
result = BuildProjectFileInternal (projectFile, targetNames, globalProperties, targetOutputs, buildFlags, toolsVersion);
return result;
} catch (InvalidProjectFileException ie) {
this.LogErrorWithFilename (projectFile, ie.Message);
this.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", projectFile, ie.ToString ()));
return false;
} catch (Exception e) {
if (buildStarted) {
this.LogErrorWithFilename (projectFile, e.Message);
this.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", projectFile, e.ToString ()));
}
throw;
} finally {
EndEngineBuild (result);
}
}
bool BuildProjectFileInternal (string projectFile,
string[] targetNames,
BuildPropertyGroup globalProperties,
IDictionary targetOutputs,
BuildSettings buildFlags, string toolsVersion)
{
if ((buildFlags & BuildSettings.DoNotResetPreviouslyBuiltTargets) != BuildSettings.DoNotResetPreviouslyBuiltTargets)
builtTargetsOutputByName.Clear ();
@@ -366,12 +393,25 @@ namespace Microsoft.Build.BuildEngine {
loggers.Clear ();
}
internal void StartProjectBuild (Project project, string [] target_names)
void StartEngineBuild ()
{
if (!buildStarted) {
LogBuildStarted ();
buildStarted = true;
}
}
void EndEngineBuild (bool succeeded)
{
if (buildStarted && currentlyBuildingProjectsStack.Count == 0) {
LogBuildFinished (succeeded);
buildStarted = false;
}
}
internal void StartProjectBuild (Project project, string [] target_names)
{
StartEngineBuild ();
if (currentlyBuildingProjectsStack.Count == 0 ||
String.Compare (currentlyBuildingProjectsStack.Peek ().FullFileName, project.FullFileName) != 0)
@@ -397,10 +437,7 @@ namespace Microsoft.Build.BuildEngine {
String.Compare (top_project.FullFileName, currentlyBuildingProjectsStack.Peek ().FullFileName) != 0)
LogProjectFinished (top_project, succeeded);
if (currentlyBuildingProjectsStack.Count == 0) {
LogBuildFinished (succeeded);
buildStarted = false;
}
EndEngineBuild (succeeded);
}
internal void ClearBuiltTargetsForProject (Project project)
@@ -518,16 +555,14 @@ namespace Microsoft.Build.BuildEngine {
public string DefaultToolsVersion {
get {
if (String.IsNullOrEmpty (defaultToolsVersion))
#if NET_4_0
return "4.0";
#elif NET_3_5
return "3.5";
#else
return "2.0";
#endif
return defaultToolsVersion;
// This is used as the fall back version if the
// project can't find a version to use
// Hard-coded to 2.0, so it allows even vs2005 projects
// to build correctly, as they won't have a ToolsVersion
// set!
return String.IsNullOrEmpty (defaultToolsVersion)
? "2.0"
: defaultToolsVersion;
}
set {
if (Toolsets [value] == null)
@@ -57,69 +57,87 @@ namespace Microsoft.Build.BuildEngine {
{
if (customEventRaised != null)
customEventRaised (sender, cbea);
FireAnyEvent (sender, cbea);
}
public void FireErrorRaised (object sender, BuildErrorEventArgs beea)
{
if (errorRaised != null)
errorRaised (sender, beea);
FireAnyEvent (sender, beea);
}
public void FireMessageRaised (object sender, BuildMessageEventArgs bmea)
{
if (messageRaised != null)
messageRaised (sender, bmea);
FireAnyEvent (sender, bmea);
}
public void FireWarningRaised (object sender, BuildWarningEventArgs bwea)
{
if (warningRaised != null)
warningRaised (sender, bwea);
FireAnyEvent (sender, bwea);
}
public void FireTargetStarted (object sender, TargetStartedEventArgs tsea)
{
if (targetStarted != null)
targetStarted (sender, tsea);
FireAnyEvent (sender, tsea);
}
public void FireTargetFinished (object sender, TargetFinishedEventArgs tfea)
{
if (targetFinished != null)
targetFinished (sender, tfea);
FireAnyEvent (sender, tfea);
}
public void FireBuildStarted (object sender, BuildStartedEventArgs bsea)
{
if (buildStarted != null)
buildStarted (sender, bsea);
FireAnyEvent (sender, bsea);
}
public void FireBuildFinished (object sender, BuildFinishedEventArgs bfea)
{
if (buildFinished != null)
buildFinished (sender, bfea);
FireAnyEvent (sender, bfea);
}
public void FireProjectStarted (object sender, ProjectStartedEventArgs psea)
{
if (projectStarted != null)
projectStarted (sender, psea);
FireAnyEvent (sender, psea);
}
public void FireProjectFinished (object sender, ProjectFinishedEventArgs pfea)
{
if (projectFinished != null)
projectFinished (sender, pfea);
FireAnyEvent (sender, pfea);
}
public void FireTaskStarted (object sender, TaskStartedEventArgs tsea)
{
if (taskStarted != null)
taskStarted (sender, tsea);
FireAnyEvent (sender, tsea);
}
public void FireTaskFinished (object sender, TaskFinishedEventArgs tfea)
{
if (taskFinished != null)
taskFinished (sender, tfea);
FireAnyEvent (sender, tfea);
}
public void FireAnyEvent (object sender, BuildEventArgs bea)
{
if (anyEventRaised != null)
anyEventRaised (sender, bea);
}
public event AnyEventHandler AnyEventRaised {
@@ -283,4 +301,4 @@ namespace Microsoft.Build.BuildEngine {
}
}
#endif
#endif
@@ -66,6 +66,20 @@ namespace Microsoft.Build.BuildEngine {
this.expressionCollection = new ExpressionCollection ();
}
public static T ParseAs<T> (string expression, ParseOptions options, Project project)
{
Expression expr = new Expression ();
expr.Parse (expression, options);
return (T)expr.ConvertTo (project, typeof (T));
}
public static T ParseAs<T> (string expression, ParseOptions options, Project project, ExpressionOptions exprOptions)
{
Expression expr = new Expression ();
expr.Parse (expression, options);
return (T)expr.ConvertTo (project, typeof (T), exprOptions);
}
// Split: Split on ';'
// Eg. Property values don't need to be split
//
@@ -3,8 +3,10 @@
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (C) 2005 Marek Sieradzki
// Copyright 2011 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
@@ -27,23 +29,125 @@
#if NET_2_0
using System;
using System.IO;
using System.Text;
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
public class FileLogger : ConsoleLogger {
StreamWriter sw;
string logfile;
string encoding = null;
IEventSource eventSource;
public FileLogger ()
{
base.Verbosity = LoggerVerbosity.Detailed;
}
// FIXME: add our handlers to the events
public override void Initialize (IEventSource eventSource)
{
this.eventSource = eventSource;
logfile = "msbuild.log";
bool append = false;
string key, value;
string[] splittedParameters = Parameters.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
foreach (string s in splittedParameters) {
if (String.Compare (s, "Append") == 0) {
append = true;
continue;
}
if (s.StartsWith ("Encoding")) {
if (!TrySplitKeyValuePair (s, out key, out value))
throw new LoggerException ("Encoding should be specified as: Encoding=<encoding>, eg. Encoding=UTF-8");
if (String.IsNullOrEmpty (value))
throw new LoggerException ("Encoding must be non-empty");
encoding = value;
continue;
}
if (s.StartsWith ("LogFile")) {
if (!TrySplitKeyValuePair (s, out key, out value))
throw new LoggerException ("LogFile should be specified as: LogFile=<encoding>, eg. LogFile=foo.log");
if (String.IsNullOrEmpty (value))
throw new LoggerException ("LogFile value must be non-empty");
logfile = value;
continue;
}
}
// Attach *our* HandleBuildStarted as the first one,
// as it needs to create the writer!
eventSource.BuildStarted += HandleBuildStarted;
base.Initialize (eventSource);
// Attach *our* HandleBuildFinished as the last one,
// as it needs to close the writer!
eventSource.BuildFinished += HandleBuildFinished;
CreateWriter (append);
}
void CreateWriter (bool append_to)
{
if (sw != null)
return;
if (!String.IsNullOrEmpty (encoding))
sw = new StreamWriter (logfile, append_to, Encoding.GetEncoding (encoding));
else
sw = new StreamWriter (logfile, append_to, Encoding.Default);
WriteHandler = sw.WriteLine;
}
void HandleBuildStarted (object sender, BuildStartedEventArgs args)
{
CreateWriter (true);
}
void HandleBuildFinished (object sender, BuildFinishedEventArgs args)
{
base.WriteHandler = null;
if (sw != null) {
sw.Close ();
sw = null;
}
}
bool TrySplitKeyValuePair (string pair, out string key, out string value)
{
key = value = null;
string[] parts = pair.Split ('=');
if (parts.Length != 2)
return false;
key = parts [0];
value = parts [1];
return true;
}
public override void Shutdown ()
{
base.WriteHandler = null;
if (sw != null) {
sw.Close ();
sw = null;
}
if (eventSource != null) {
eventSource.BuildStarted -= HandleBuildStarted;
eventSource.BuildFinished -= HandleBuildFinished;
}
base.Shutdown ();
}
}
}
#endif
#endif
@@ -180,8 +180,13 @@ namespace Microsoft.Build.BuildEngine {
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildPropertyGroup) {
bpg = (BuildPropertyGroup) evaluate_iterator.Value;
if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
bpg.Evaluate ();
project.PushThisFileProperty (bpg.DefinedInFileName);
try {
if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
bpg.Evaluate ();
} finally {
project.PopThisFileProperty ();
}
}
// if it wasn't moved by adding anything because of evaluating a Import shift it
@@ -197,8 +202,13 @@ namespace Microsoft.Build.BuildEngine {
while (evaluate_iterator != null) {
if (evaluate_iterator.Value is BuildItemGroup) {
big = (BuildItemGroup) evaluate_iterator.Value;
if (ConditionParser.ParseAndEvaluate (big.Condition, project))
big.Evaluate ();
project.PushThisFileProperty (big.DefinedInFileName);
try {
if (ConditionParser.ParseAndEvaluate (big.Condition, project))
big.Evaluate ();
} finally {
project.PopThisFileProperty ();
}
}
evaluate_iterator = evaluate_iterator.Next;
@@ -210,17 +220,22 @@ namespace Microsoft.Build.BuildEngine {
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;
project.PushThisFileProperty (bc.DefinedInFileName);
try {
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 ();
if (!whenUsed && bc.Otherwise != null &&
ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) {
bc.Otherwise.Evaluate ();
}
} finally {
project.PopThisFileProperty ();
}
}
@@ -3,8 +3,10 @@
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (C) 2006 Marek Sieradzki
// Copyright 2011 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
@@ -28,10 +30,13 @@
#if NET_2_0
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.XBuild.Utilities;
namespace Microsoft.Build.BuildEngine {
@@ -44,8 +49,14 @@ namespace Microsoft.Build.BuildEngine {
static string DotConfigExtensionsPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
Path.Combine ("xbuild", "tasks"));
const string MacOSXExternalXBuildDir = "/Library/Frameworks/Mono.framework/External/xbuild";
static string PathSeparatorAsString = Path.PathSeparator.ToString ();
internal Import (XmlElement importElement, Project project, ImportedProject originalProject)
: this (importElement, null, project, originalProject)
{}
// if @alternateProjectPath is available then that it used as the EvaluatedProjectPath!
internal Import (XmlElement importElement, string alternateProjectPath, Project project, ImportedProject originalProject)
{
if (importElement == null)
throw new ArgumentNullException ("importElement");
@@ -60,7 +71,8 @@ namespace Microsoft.Build.BuildEngine {
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
if (ConditionParser.ParseAndEvaluate (Condition, project)) {
evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
evaluatedProjectPath = String.IsNullOrEmpty (alternateProjectPath) ? EvaluateProjectPath (ProjectPath) : alternateProjectPath;
evaluatedProjectPath = GetFullPath ();
if (EvaluatedProjectPath == String.Empty)
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
@@ -72,9 +84,9 @@ namespace Microsoft.Build.BuildEngine {
{
string filename = evaluatedProjectPath;
// NOTE: it's a hack to transform Microsoft.CSharp.Targets to Microsoft.CSharp.targets
if (Path.HasExtension (filename))
filename = Path.ChangeExtension (filename, Path.GetExtension (filename));
if (!File.Exists (filename) && Path.GetFileName (filename) == "Microsoft.CSharp.Targets")
filename = Path.ChangeExtension (filename, ".targets");
if (!File.Exists (filename)) {
if (ignoreMissingImports) {
project.LogWarning (project.FullFileName, "Could not find project file {0}, to import. Ignoring.", filename);
@@ -92,91 +104,148 @@ namespace Microsoft.Build.BuildEngine {
string EvaluateProjectPath (string file)
{
string ret;
if (EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath", out ret) ||
EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath32", out ret) ||
EvaluateAsMSBuildExtensionsPath (file, "MSBuildExtensionsPath64", out ret))
return ret;
return EvaluatePath (file);
}
bool EvaluateAsMSBuildExtensionsPath (string file, string property_name, out string epath)
{
epath = null;
string property_ref = String.Format ("$({0})", property_name);
if (file.IndexOf (property_ref) < 0)
return false;
// This is a *HACK* to support multiple paths for
// MSBuildExtensionsPath property. Normally it would
// get resolved to a single value, but here we special
// case it and try ~/.config/xbuild/tasks and any
// paths specified in the env var $MSBuildExtensionsPath .
//
// The property itself will resolve to the default
// location though, so you get in any other part of the
// project.
string envvar = Environment.GetEnvironmentVariable (property_name);
envvar = String.Join (":", new string [] {
// For mac osx, look in the 'External' dir on macosx,
// see bug #663180
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
(envvar ?? String.Empty),
DotConfigExtensionsPath});
string [] paths = envvar.Split (new char [] {':'}, StringSplitOptions.RemoveEmptyEntries);
foreach (string path in paths) {
if (!Directory.Exists (path)) {
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", path);
continue;
}
string pfile = Path.GetFullPath (file.Replace ("\\", "/").Replace (
property_ref, path + Path.DirectorySeparatorChar));
var evaluated_path = EvaluatePath (pfile);
if (File.Exists (evaluated_path)) {
project.ParentEngine.LogMessage (MessageImportance.Low,
"{0}: Importing project {1} from extension path {2}", project.FullFileName, evaluated_path, path);
epath = pfile;
return true;
}
project.ParentEngine.LogMessage (MessageImportance.Low,
"{0}: Couldn't find project {1} for extension path {2}", project.FullFileName, evaluated_path, path);
}
return false;
}
string EvaluatePath (string path)
{
var exp = new Expression ();
exp.Parse (path, ParseOptions.Split);
return (string) exp.ConvertTo (project, typeof (string));
return Expression.ParseAs<string> (file, ParseOptions.Split, project);
}
string GetFullPath ()
{
string file = EvaluatedProjectPath;
if (!Path.IsPathRooted (file) && !String.IsNullOrEmpty (ContainedInProjectFileName))
file = Path.Combine (Path.GetDirectoryName (ContainedInProjectFileName), file);
if (!Path.IsPathRooted (EvaluatedProjectPath)) {
string dir = null;
if (originalProject == null) {
if (project.FullFileName != String.Empty) // Path.GetDirectoryName throws exception on String.Empty
dir = Path.GetDirectoryName (project.FullFileName);
} else {
if (originalProject.FullFileName != String.Empty)
dir = Path.GetDirectoryName (originalProject.FullFileName);
}
if (dir != null)
file = Path.Combine (dir, EvaluatedProjectPath);
}
return MSBuildUtils.FromMSBuildPath (file);
}
// For every extension path, in order, finds suitable
// import filename(s) matching the Import, and calls
// @func with them
//
// func: bool func(importPath, from_source_msg)
//
// If for an extension path, atleast one file gets imported,
// then it stops at that.
// So, in case imports like "$(MSBuildExtensionsPath)\foo\*",
// for every extension path, it will try to import the "foo\*",
// and if atleast one file gets successfully imported, then it
// stops at that
internal static void ForEachExtensionPathTillFound (XmlElement xmlElement, Project project, ImportedProject importingProject,
Func<string, string, bool> func)
{
string project_attribute = xmlElement.GetAttribute ("Project");
string condition_attribute = xmlElement.GetAttribute ("Condition");
bool has_extn_ref = project_attribute.IndexOf ("$(MSBuildExtensionsPath)") >= 0 ||
project_attribute.IndexOf ("$(MSBuildExtensionsPath32)") >= 0 ||
project_attribute.IndexOf ("$(MSBuildExtensionsPath64)") >= 0;
string importingFile = importingProject != null ? importingProject.FullFileName : project.FullFileName;
DirectoryInfo base_dir_info = null;
if (!String.IsNullOrEmpty (importingFile))
base_dir_info = new DirectoryInfo (Path.GetDirectoryName (importingFile));
else
base_dir_info = new DirectoryInfo (Directory.GetCurrentDirectory ());
IEnumerable<string> extn_paths = has_extn_ref ? GetExtensionPaths (project) : new string [] {null};
try {
foreach (string path in extn_paths) {
string extn_msg = null;
if (has_extn_ref) {
project.SetExtensionsPathProperties (path);
extn_msg = "from extension path " + path;
}
// do this after setting new Extension properties, as condition might
// reference it
if (!ConditionParser.ParseAndEvaluate (condition_attribute, project))
continue;
// We stop if atleast one file got imported.
// Remaining extension paths are *not* tried
bool atleast_one = false;
foreach (string importPath in GetImportPathsFromString (project_attribute, project, base_dir_info)) {
try {
if (func (importPath, extn_msg))
atleast_one = true;
} catch (Exception e) {
throw new InvalidProjectFileException (String.Format (
"{0}: Project file could not be imported, it was being imported by " +
"{1}: {2}", importPath, importingFile, e.Message), e);
}
}
if (atleast_one)
return;
}
} finally {
if (has_extn_ref)
project.SetExtensionsPathProperties (Project.DefaultExtensionsPath);
}
}
// Parses the Project attribute from an Import,
// and returns the import filenames that match.
// This handles wildcards also
static IEnumerable<string> GetImportPathsFromString (string import_string, Project project, DirectoryInfo base_dir_info)
{
string parsed_import = Expression.ParseAs<string> (import_string, ParseOptions.AllowItemsNoMetadataAndSplit, project);
if (parsed_import != null)
parsed_import = parsed_import.Trim ();
if (String.IsNullOrEmpty (parsed_import))
throw new InvalidProjectFileException ("The required attribute \"Project\" in Import is empty");
#if NET_4_0
if (DirectoryScanner.HasWildcard (parsed_import)) {
var directoryScanner = new DirectoryScanner () {
Includes = new ITaskItem [] { new TaskItem (parsed_import) },
BaseDirectory = base_dir_info
};
directoryScanner.Scan ();
foreach (ITaskItem matchedItem in directoryScanner.MatchedItems)
yield return matchedItem.ItemSpec;
} else
#endif
yield return parsed_import;
}
// Gives a list of extensions paths to try for $(MSBuildExtensionsPath),
// *in-order*
static IEnumerable<string> GetExtensionPaths (Project project)
{
// This is a *HACK* to support multiple paths for
// MSBuildExtensionsPath property. Normally it would
// get resolved to a single value, but here we special
// case it and try various paths, see the code below
//
// The property itself will resolve to the default
// location though, so you get that in any other part of the
// project.
string envvar = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath");
envvar = String.Join (PathSeparatorAsString, new string [] {
(envvar ?? String.Empty),
// For mac osx, look in the 'External' dir on macosx,
// see bug #663180
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
DotConfigExtensionsPath,
Project.DefaultExtensionsPath});
var pathsTable = new Dictionary<string, string> ();
foreach (string extn_path in envvar.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries)) {
if (pathsTable.ContainsKey (extn_path))
continue;
if (!Directory.Exists (extn_path)) {
project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", extn_path);
continue;
}
pathsTable [extn_path] = extn_path;
yield return extn_path;
}
}
public string Condition {
get {
string s = importElement.GetAttribute ("Condition");
@@ -195,6 +264,10 @@ namespace Microsoft.Build.BuildEngine {
public string ProjectPath {
get { return importElement.GetAttribute ("Project"); }
}
internal string ContainedInProjectFileName {
get { return originalProject != null ? originalProject.FullFileName : project.FullFileName; }
}
}
}
@@ -37,19 +37,19 @@ namespace Microsoft.Build.BuildEngine {
public class ImportCollection : ICollection, IEnumerable {
GroupingCollection groupingCollection;
Dictionary <string, object> filenames;
Dictionary <string, Import> filenames;
internal ImportCollection (GroupingCollection groupingCollection)
{
this.groupingCollection = groupingCollection;
filenames = new Dictionary <string, object> ();
filenames = new Dictionary <string, Import> ();
}
internal void Add (Import import)
{
if (!filenames.ContainsKey (import.EvaluatedProjectPath)) {
groupingCollection.Add (import);
filenames.Add (import.EvaluatedProjectPath, null);
filenames.Add (import.EvaluatedProjectPath, import);
}
}
@@ -77,6 +77,11 @@ namespace Microsoft.Build.BuildEngine {
{
return filenames.ContainsKey (import.EvaluatedProjectPath);
}
internal bool TryGetImport (Import keyImport, out Import valueImport)
{
return filenames.TryGetValue (keyImport.EvaluatedProjectPath, out valueImport);
}
public void CopyTo (Import[] array, int index)
{
@@ -57,9 +57,6 @@ namespace Microsoft.Build.BuildEngine {
lastWrite = File.GetLastWriteTime (filename);
fullFileName = filename;
}
catch (Exception) {
throw;
}
finally {
sr.Close ();
}
@@ -47,15 +47,21 @@ namespace Microsoft.Build.BuildEngine
else
return String.Format (unformatted, args);
}
public static void LogError (this Engine engine, string message,
params object[] messageArgs)
{
engine.LogErrorWithFilename (null, message, messageArgs);
}
public static void LogErrorWithFilename (this Engine engine, string filename, string message,
params object[] messageArgs)
{
if (message == null)
throw new ArgumentNullException ("message");
BuildErrorEventArgs beea = new BuildErrorEventArgs (
null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
null, null, filename, 0, 0, 0, 0, FormatString (message, messageArgs),
null, null);
engine.EventSource.FireErrorRaised (engine, beea);
}
@@ -3,8 +3,10 @@
//
// Author:
// Marek Sieradzki ([email protected])
// Ankit Jain ([email protected])
//
// (C) 2005 Marek Sieradzki
// Copyright 2011 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
@@ -32,6 +34,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml;
@@ -76,6 +79,11 @@ namespace Microsoft.Build.BuildEngine {
bool building;
BuildSettings current_settings;
Stack<Batch> batches;
// This is used to keep track of "current" file,
// which is then used to set the reserved properties
// $(MSBuildThisFile*)
Stack<string> this_file_property_stack;
ProjectLoadSettings project_load_settings;
@@ -113,6 +121,7 @@ namespace Microsoft.Build.BuildEngine {
initialTargets = new List<string> ();
defaultTargets = new string [0];
batches = new Stack<Batch> ();
this_file_property_stack = new Stack<string> ();
globalProperties = new BuildPropertyGroup (null, this, null, false);
foreach (BuildProperty bp in parentEngine.GlobalProperties)
@@ -135,8 +144,7 @@ namespace Microsoft.Build.BuildEngine {
if (!String.IsNullOrEmpty (importCondition))
importElement.SetAttribute ("Condition", importCondition);
Import import = new Import (importElement, this, null);
imports.Add (import);
AddImport (importElement, null, false);
MarkProjectAsDirty ();
NeedToReevaluate ();
}
@@ -268,7 +276,7 @@ namespace Microsoft.Build.BuildEngine {
{
return Build (targetNames, targetOutputs, BuildSettings.None);
}
[MonoTODO ("Not tested")]
public bool Build (string [] targetNames,
IDictionary targetOutputs,
@@ -289,6 +297,13 @@ namespace Microsoft.Build.BuildEngine {
Directory.SetCurrentDirectory (Path.GetDirectoryName (fullFileName));
building = true;
result = BuildInternal (targetNames, targetOutputs, buildFlags);
} catch (InvalidProjectFileException ie) {
ParentEngine.LogErrorWithFilename (fullFileName, ie.Message);
ParentEngine.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", fullFileName, ie.ToString ()));
} catch (Exception e) {
ParentEngine.LogErrorWithFilename (fullFileName, e.Message);
ParentEngine.LogMessage (MessageImportance.Low, String.Format ("{0}: {1}", fullFileName, e.ToString ()));
throw;
} finally {
ParentEngine.EndProjectBuild (this, result);
current_settings = BuildSettings.None;
@@ -308,7 +323,11 @@ namespace Microsoft.Build.BuildEngine {
needToReevaluate = false;
Reevaluate ();
}
#if NET_4_0
ProcessBeforeAndAfterTargets ();
#endif
if (targetNames == null || targetNames.Length == 0) {
if (defaultTargets != null && defaultTargets.Length != 0) {
targetNames = defaultTargets;
@@ -332,9 +351,13 @@ namespace Microsoft.Build.BuildEngine {
initialTargetsBuilt = true;
}
foreach (string target in targetNames)
foreach (string target in targetNames) {
if (target == null)
throw new ArgumentNullException ("Target name cannot be null");
if (!BuildTarget (target.Trim (), targetOutputs))
return false;
}
return true;
}
@@ -382,6 +405,44 @@ namespace Microsoft.Build.BuildEngine {
return sb.ToString ();
}
#if NET_4_0
void ProcessBeforeAndAfterTargets ()
{
var beforeTable = Targets.AsIEnumerable ()
.SelectMany (target => GetTargetNamesFromString (target.BeforeTargets),
(target, before_target) => new {before_target, name = target.Name})
.ToLookup (x => x.before_target, x => x.name)
.ToDictionary (x => x.Key, x => x.Distinct ().ToList ());
foreach (var pair in beforeTable) {
if (targets.Exists (pair.Key))
targets [pair.Key].BeforeThisTargets = pair.Value;
else
LogWarning (FullFileName, "Target '{0}', not found in the project", pair.Key);
}
var afterTable = Targets.AsIEnumerable ()
.SelectMany (target => GetTargetNamesFromString (target.AfterTargets),
(target, after_target) => new {after_target, name = target.Name})
.ToLookup (x => x.after_target, x => x.name)
.ToDictionary (x => x.Key, x => x.Distinct ().ToList ());
foreach (var pair in afterTable) {
if (targets.Exists (pair.Key))
targets [pair.Key].AfterThisTargets = pair.Value;
else
LogWarning (FullFileName, "Target '{0}', not found in the project", pair.Key);
}
}
string[] GetTargetNamesFromString (string targets)
{
Expression expr = new Expression ();
expr.Parse (targets, ParseOptions.AllowItemsNoMetadataAndSplit);
return (string []) expr.ConvertTo (this, typeof (string []));
}
#endif
[MonoTODO]
public string [] GetConditionedPropertyValues (string propertyName)
{
@@ -463,10 +524,12 @@ namespace Microsoft.Build.BuildEngine {
"projectFileName");
this.fullFileName = Utilities.FromMSBuildPath (Path.GetFullPath (projectFileName));
PushThisFileProperty (fullFileName);
string filename = fullFileName;
if (String.Compare (Path.GetExtension (fullFileName), ".sln", true) == 0) {
Project tmp_project = ParentEngine.CreateNewProject ();
tmp_project.FullFileName = filename;
SolutionParser sln_parser = new SolutionParser ();
sln_parser.ParseSolution (fullFileName, tmp_project, delegate (int errorNumber, string message) {
LogWarning (filename, message);
@@ -872,7 +935,7 @@ namespace Microsoft.Build.BuildEngine {
AddUsingTask (xe, ip);
break;
case "Import":
AddImport (xe, ip);
AddImport (xe, ip, true);
break;
case "ItemGroup":
AddItemGroup (xe, ip);
@@ -881,7 +944,7 @@ namespace Microsoft.Build.BuildEngine {
AddPropertyGroup (xe, ip);
break;
case "Choose":
AddChoose (xe);
AddChoose (xe, ip);
break;
default:
throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file.", xe.Name));
@@ -922,6 +985,7 @@ namespace Microsoft.Build.BuildEngine {
BuildProperty bp;
evaluatedProperties = new BuildPropertyGroup (null, null, null, true);
conditionedProperties = new Dictionary<string, List<string>> ();
foreach (BuildProperty gp in GlobalProperties) {
bp = new BuildProperty (gp.Name, gp.Value, PropertyType.Global);
@@ -960,10 +1024,9 @@ namespace Microsoft.Build.BuildEngine {
throw new Exception (String.Format ("Invalid tools version '{0}', no tools path set for this.", effective_tools_version));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", toolsPath, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", toolsPath, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsRoot", Path.GetDirectoryName (toolsPath), PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsVersion", effective_tools_version, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", ExtensionsPath, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath64", ExtensionsPath, PropertyType.Reserved));
SetExtensionsPathProperties (DefaultExtensionsPath);
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
@@ -975,6 +1038,20 @@ namespace Microsoft.Build.BuildEngine {
projectDir = Path.GetDirectoryName (FullFileName);
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDirectory", projectDir, PropertyType.Reserved));
if (this_file_property_stack.Count > 0)
// Just re-inited the properties, but according to the stack,
// we should have a MSBuild*This* property set
SetMSBuildThisFileProperties (this_file_property_stack.Peek ());
}
internal void SetExtensionsPathProperties (string extn_path)
{
if (!String.IsNullOrEmpty (extn_path)) {
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", extn_path, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", extn_path, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath64", extn_path, PropertyType.Reserved));
}
}
// precedence:
@@ -1023,23 +1100,52 @@ namespace Microsoft.Build.BuildEngine {
usingTask = new UsingTask (xmlElement, this, importedProject);
UsingTasks.Add (usingTask);
}
void AddImport (XmlElement xmlElement, ImportedProject importingProject)
void AddImport (XmlElement xmlElement, ImportedProject importingProject, bool evaluate_properties)
{
// eval all the properties etc till the import
groupingCollection.Evaluate (EvaluationType.Property);
if (evaluate_properties)
groupingCollection.Evaluate (EvaluationType.Property);
Import import = new Import (xmlElement, this, importingProject);
if (!ConditionParser.ParseAndEvaluate (import.Condition, this))
return;
try {
PushThisFileProperty (importingProject != null ? importingProject.FullFileName : FullFileName);
if (Imports.Contains (import)) {
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
"A circular reference was found involving the import of {0}. Only" +
" the first import of this file will be used, ignoring others.",
import.ProjectPath);
string project_attribute = xmlElement.GetAttribute ("Project");
if (String.IsNullOrEmpty (project_attribute))
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
return;
Import.ForEachExtensionPathTillFound (xmlElement, this, importingProject,
(importPath, from_source_msg) => AddSingleImport (xmlElement, importPath, importingProject, from_source_msg));
} finally {
PopThisFileProperty ();
}
}
bool AddSingleImport (XmlElement xmlElement, string projectPath, ImportedProject importingProject, string from_source_msg)
{
Import import = new Import (xmlElement, projectPath, this, importingProject);
if (!ConditionParser.ParseAndEvaluate (import.Condition, this)) {
ParentEngine.LogMessage (MessageImportance.Low,
"Not importing project '{0}' as the condition '{1}' is false",
import.ProjectPath, import.Condition);
return false;
}
Import existingImport;
if (Imports.TryGetImport (import, out existingImport)) {
if (importingProject == null)
LogWarning (fullFileName,
"Cannot import project '{0}' again. It was already imported by " +
"'{1}'. Ignoring.",
projectPath, existingImport.ContainedInProjectFileName);
else
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
"A circular reference was found involving the import of '{0}'. " +
"It was earlier imported by '{1}'. Only " +
"the first import of this file will be used, ignoring others.",
import.EvaluatedProjectPath, existingImport.ContainedInProjectFileName);
return false;
}
if (String.Compare (fullFileName, import.EvaluatedProjectPath) == 0) {
@@ -1047,13 +1153,19 @@ namespace Microsoft.Build.BuildEngine {
"The main project file was imported here, which creates a circular " +
"reference. Ignoring this import.");
return;
return false;
}
Imports.Add (import);
string importingFile = importingProject != null ? importingProject.FullFileName : FullFileName;
ParentEngine.LogMessage (MessageImportance.Low,
"{0}: Importing project {1} {2}",
importingFile, import.EvaluatedProjectPath, from_source_msg);
import.Evaluate (project_load_settings == ProjectLoadSettings.IgnoreMissingImports);
return true;
}
void AddItemGroup (XmlElement xmlElement, ImportedProject importedProject)
{
BuildItemGroup big = new BuildItemGroup (xmlElement, this, importedProject, false);
@@ -1066,9 +1178,9 @@ namespace Microsoft.Build.BuildEngine {
PropertyGroups.Add (bpg);
}
void AddChoose (XmlElement xmlElement)
void AddChoose (XmlElement xmlElement, ImportedProject importedProject)
{
BuildChoose bc = new BuildChoose (xmlElement, this);
BuildChoose bc = new BuildChoose (xmlElement, this, importedProject);
groupingCollection.Add (bc);
}
@@ -1261,6 +1373,41 @@ namespace Microsoft.Build.BuildEngine {
return default (T);
}
// Used for MSBuild*This* set of properties
internal void PushThisFileProperty (string full_filename)
{
string last_file = this_file_property_stack.Count == 0 ? String.Empty : this_file_property_stack.Peek ();
this_file_property_stack.Push (full_filename);
if (last_file != full_filename)
// first time, or different from previous one
SetMSBuildThisFileProperties (full_filename);
}
internal void PopThisFileProperty ()
{
string last_file = this_file_property_stack.Pop ();
if (this_file_property_stack.Count > 0 && last_file != this_file_property_stack.Peek ())
SetMSBuildThisFileProperties (this_file_property_stack.Peek ());
}
void SetMSBuildThisFileProperties (string full_filename)
{
if (String.IsNullOrEmpty (full_filename))
return;
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFile", Path.GetFileName (full_filename), PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileFullPath", full_filename, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileName", Path.GetFileNameWithoutExtension (full_filename), PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileExtension", Path.GetExtension (full_filename), PropertyType.Reserved));
string project_dir = Path.GetDirectoryName (full_filename) + Path.DirectorySeparatorChar;
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileDirectory", project_dir, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildThisFileDirectoryNoRoot",
project_dir.Substring (Path.GetPathRoot (project_dir).Length),
PropertyType.Reserved));
}
internal void LogWarning (string filename, string message, params object[] messageArgs)
{
BuildWarningEventArgs bwea = new BuildWarningEventArgs (
@@ -1278,7 +1425,7 @@ namespace Microsoft.Build.BuildEngine {
ParentEngine.EventSource.FireErrorRaised (this, beea);
}
static string ExtensionsPath {
internal static string DefaultExtensionsPath {
get {
if (extensions_path == null) {
// NOTE: code from mcs/tools/gacutil/driver.cs
@@ -30,6 +30,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
@@ -122,6 +123,16 @@ namespace Microsoft.Build.BuildEngine {
}
bool Build (string built_targets_key, out bool executeOnErrors)
{
project.PushThisFileProperty (TargetFile);
try {
return BuildActual (built_targets_key, out executeOnErrors);
} finally {
project.PopThisFileProperty ();
}
}
bool BuildActual (string built_targets_key, out bool executeOnErrors)
{
bool result = false;
executeOnErrors = false;
@@ -147,14 +158,15 @@ namespace Microsoft.Build.BuildEngine {
try {
buildState = BuildState.Started;
result = BuildDependencies (GetDependencies (), out executeOnErrors);
if (!result && executeOnErrors)
ExecuteOnErrors ();
if (result)
// deps built fine, do main build
result = DoBuild (out executeOnErrors);
#if NET_4_0
result = BuildDependencies (out executeOnErrors) &&
BuildBeforeThisTargets (out executeOnErrors) &&
DoBuild (out executeOnErrors) && // deps & Before targets built fine, do main build
BuildAfterThisTargets (out executeOnErrors);
#else
result = BuildDependencies (out executeOnErrors) && DoBuild (out executeOnErrors);
#endif
buildState = BuildState.Finished;
} catch (Exception e) {
@@ -164,41 +176,80 @@ namespace Microsoft.Build.BuildEngine {
project.PopBatch ();
}
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = (ITaskItem[]) Outputs.Clone ();
ITaskItem[] outputs = (ITaskItem[]) OutputsAsITaskItems.Clone ();
foreach (ITaskItem item in outputs) {
item.SetMetadata ("MSBuildProjectFile", TargetFile);
item.SetMetadata ("MSBuildTargetName", Name);
}
project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = outputs;
return result;
}
List <Target> GetDependencies ()
{
List <Target> list = new List <Target> ();
Target t;
string [] targetNames;
Expression deps;
if (DependsOnTargets != String.Empty) {
deps = new Expression ();
deps.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit);
targetNames = (string []) deps.ConvertTo (Project, typeof (string []));
foreach (string dep_name in targetNames) {
t = project.Targets [dep_name.Trim ()];
if (t == null)
throw new InvalidProjectFileException (String.Format (
"Target '{0}', a dependency of target '{1}', not found.",
dep_name.Trim (), Name));
list.Add (t);
}
}
return list;
}
bool BuildDependencies (List <Target> deps, out bool executeOnErrors)
bool BuildDependencies (out bool executeOnErrors)
{
executeOnErrors = false;
foreach (Target t in deps) {
if (String.IsNullOrEmpty (DependsOnTargets))
return true;
var expr = new Expression ();
expr.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit);
string [] targetNames = (string []) expr.ConvertTo (Project, typeof (string []));
bool result = BuildOtherTargets (targetNames,
tname => engine.LogError ("Target '{0}', a dependency of target '{1}', not found.",
tname, Name),
out executeOnErrors);
if (!result && executeOnErrors)
ExecuteOnErrors ();
return result;
}
#if NET_4_0
bool BuildBeforeThisTargets (out bool executeOnErrors)
{
executeOnErrors = false;
bool result = BuildOtherTargets (BeforeThisTargets, null, out executeOnErrors);
if (!result && executeOnErrors)
ExecuteOnErrors ();
return result;
}
bool BuildAfterThisTargets (out bool executeOnErrors)
{
executeOnErrors = false;
//missing_target handler not required as these are picked from actual target's
//"Before/AfterTargets attributes!
bool result = BuildOtherTargets (AfterThisTargets, null, out executeOnErrors);
if (!result && executeOnErrors)
ExecuteOnErrors ();
return result;
}
#endif
bool BuildOtherTargets (IEnumerable<string> targetNames, Action<string> missing_target, out bool executeOnErrors)
{
executeOnErrors = false;
if (targetNames == null)
// nothing to build
return true;
foreach (string target_name in targetNames) {
var t = project.Targets [target_name.Trim ()];
if (t == null) {
if (missing_target != null)
missing_target (target_name);
return false;
}
if (t.BuildState == BuildState.NotStarted)
if (!t.Build (null, out executeOnErrors))
return false;
if (t.BuildState == BuildState.Started)
throw new InvalidProjectFileException ("Cycle in target dependencies detected");
}
@@ -311,6 +362,19 @@ namespace Microsoft.Build.BuildEngine {
}
}
#if NET_4_0
internal string BeforeTargets {
get { return targetElement.GetAttribute ("BeforeTargets"); }
}
internal string AfterTargets {
get { return targetElement.GetAttribute ("AfterTargets"); }
}
internal List<string> BeforeThisTargets { get; set; }
internal List<string> AfterThisTargets { get; set; }
#endif
internal List<BuildTask> BuildTasks {
get { return buildTasks; }
}
@@ -323,7 +387,12 @@ namespace Microsoft.Build.BuildEngine {
get { return buildState; }
}
internal ITaskItem [] Outputs {
public string Outputs {
get { return targetElement.GetAttribute ("Outputs"); }
set { targetElement.SetAttribute ("Outputs", value); }
}
ITaskItem [] OutputsAsITaskItems {
get {
string outputs = targetElement.GetAttribute ("Outputs");
if (outputs == String.Empty)
@@ -86,6 +86,12 @@ namespace Microsoft.Build.BuildEngine {
yield return kvp.Value;
}
internal IEnumerable<Target> AsIEnumerable ()
{
foreach (KeyValuePair <string, Target> kvp in targetsByName)
yield return kvp.Value;
}
public void RemoveTarget (Target targetToRemove)
{
if (targetToRemove == null)
@@ -177,10 +177,6 @@ namespace Microsoft.Build.BuildEngine {
throw new InvalidProjectFileException ("This is not output property.");
o = propertyInfo.GetValue (task, null);
// FIXME: maybe we should throw an exception here?
if (o == null)
continue;
if (itemName != String.Empty) {
PublishItemGroup (propertyInfo, o, itemName);
} else {
@@ -198,6 +194,11 @@ namespace Microsoft.Build.BuildEngine {
object o,
string propertyName)
{
if (o == null) {
parentProject.EvaluatedProperties.RemoveProperty (propertyName);
return;
}
BuildProperty bp;
try {
bp = ChangeType.ToBuildProperty (o, propertyInfo.PropertyType, propertyName);
@@ -214,6 +215,9 @@ namespace Microsoft.Build.BuildEngine {
object o,
string itemName)
{
if (o == null)
return;
BuildItemGroup newItems;
try {
newItems = ChangeType.ToBuildItemGroup (o, propertyInfo.PropertyType, itemName);
@@ -783,7 +783,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
logger.DumpMessages ();
CheckMetadata (project, "A", "Meta", new string[] { "@(B)", "" }, "K1");
CheckEvaluatedMetadata (project, "A", "Meta", new string[] { "", "" }, "K2");
@@ -374,9 +374,11 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
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");
if (node == null) {
Console.WriteLine (project.Xml);
Assert.Fail ("Expected node to be non-null");
}
}
}
@@ -342,6 +342,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
bt [0].AddOutputItem ("Property", "ItemName");
project.Build ("T");
Assert.IsNotNull (project.EvaluatedItems [0], "No items found");
Assert.AreEqual ("ItemName", project.EvaluatedItems [0].Name, "A1");
Assert.AreEqual ("some_text", project.EvaluatedItems [0].FinalItemSpec, "A2");
}
@@ -209,5 +209,62 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
project.LoadXml (documentString);
}
#if NET_4_0
[Test]
public void TestImportWildcard ()
{
string main_project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
<ItemGroup>
<FooItem Include=""From main.proj""/>
</ItemGroup>
<Import Project=""tmp\*""/>
<Target Name=""Build"">
<Message Text=""FooItem: @(FooItem)""/>
</Target>
</Project>";
string other_project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
<ItemGroup>
<FooItem Include=""From $(MSBuildThisFile)""/>
</ItemGroup>
</Project>";
Engine engine = new Engine (Consts.BinPath);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
string base_dir = Path.GetFullPath (Path.Combine ("Test", "resources")) + Path.DirectorySeparatorChar;
string tmp_dir = Path.GetFullPath (Path.Combine (base_dir, "tmp")) + Path.DirectorySeparatorChar;
string main_project = Path.Combine (base_dir, "main.proj");
string first_project = Path.Combine (tmp_dir, "first.proj");
string second_project = Path.Combine (tmp_dir, "second.proj");
Directory.CreateDirectory (tmp_dir);
File.WriteAllText (main_project, main_project_xml);
File.WriteAllText (first_project, other_project_xml);
File.WriteAllText (second_project, other_project_xml);
Project project = engine.CreateNewProject ();
project.Load (main_project);
try {
Assert.IsTrue (project.Build ("Build"), "Build failed");
logger.CheckLoggedMessageHead ("FooItem: From main.proj;From first.proj;From second.proj", "A1");
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
} catch {
logger.DumpMessages ();
throw;
} finally {
File.Delete (main_project);
File.Delete (first_project);
File.Delete (second_project);
}
}
#endif
}
}
@@ -111,7 +111,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
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);
//Console.WriteLine ("time: {0} p.t: {1}", time, project.TimeOfLastDirty);
Assert.IsTrue (time <= project.TimeOfLastDirty, "A7");
Assert.IsTrue (String.Empty != project.Xml, "A8");
return;
@@ -1487,7 +1487,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
logger.DumpMessages ();
Assert.Fail ("A1: Build failed");
}
logger.DumpMessages ();
BuildItemGroup include = project.GetEvaluatedItemsByName ("FinalList");
Assert.AreEqual (3, include.Count, "A2");
}
@@ -1831,6 +1830,97 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
}
}
[Test]
public void TestMSBuildThisProperties ()
{
Engine engine = new Engine (Consts.BinPath);
Project project = engine.CreateNewProject ();
string base_dir = Path.GetFullPath (Path.Combine ("Test", "resources")) + Path.DirectorySeparatorChar;
string tmp_dir = Path.GetFullPath (Path.Combine (base_dir, "tmp")) + Path.DirectorySeparatorChar;
string first_project = Path.Combine (base_dir, "first.proj");
string second_project = Path.Combine (tmp_dir, "second.proj");
string third_project = Path.Combine (tmp_dir, "third.proj");
string first = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
<PropertyGroup>
<FooInMain>$(MSBuildThisFileDirectory)</FooInMain>
</PropertyGroup>
<ItemGroup>
<ItemInMain Include=""$(MSBuildThisFileFullPath)"" />
</ItemGroup>
<Import Project=""tmp\second.proj""/>
</Project>";
string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
<PropertyGroup>
<FooInImport1>$(MSBuildThisFileDirectory)</FooInImport1>
</PropertyGroup>
<PropertyGroup>
<FooInImport2>$(MSBuildThisFileDirectory)</FooInImport2>
</PropertyGroup>
<ItemGroup>
<ItemInImport1 Include=""$(MSBuildThisFileFullPath)"" />
</ItemGroup>
<Import Project=""third.proj""/>
</Project>";
string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
<PropertyGroup>
<FooInTwo>$(MSBuildThisFileFullPath)</FooInTwo>
</PropertyGroup>
<ItemGroup>
<ItemInTwo Include=""$(MSBuildThisFileFullPath)"" />
</ItemGroup>
<Target Name=""TargetInTwo"">
<Message Text=""FooInMain: $(FooInMain)""/>
<Message Text=""FooInImport1: $(FooInImport1)""/>
<Message Text=""FooInImport2: $(FooInImport2)""/>
<Message Text=""FooInTwo: $(FooInTwo)""/>
<Message Text=""ItemInMain: %(ItemInMain.Identity)""/>
<Message Text=""ItemInImport1: %(ItemInImport1.Identity)""/>
<Message Text=""ItemInTwo: %(ItemInTwo.Identity)""/>
<Message Text=""Full path: $(MSBuildThisFileFullPath)""/>
</Target>
</Project>";
File.WriteAllText (first_project, first);
Directory.CreateDirectory (Path.Combine (base_dir, "tmp"));
File.WriteAllText (second_project, second);
File.WriteAllText (third_project, third);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
project.Load (first_project);
try {
Assert.IsTrue (project.Build (), "Build failed");
logger.CheckLoggedMessageHead ("FooInMain: " + base_dir, "A1");
logger.CheckLoggedMessageHead ("FooInImport1: " + tmp_dir, "A2");
logger.CheckLoggedMessageHead ("FooInImport2: " + tmp_dir, "A3");
logger.CheckLoggedMessageHead ("FooInTwo: " + third_project, "A4");
logger.CheckLoggedMessageHead ("ItemInMain: " + first_project, "A5");
logger.CheckLoggedMessageHead ("ItemInImport1: " + second_project, "A6");
logger.CheckLoggedMessageHead ("ItemInTwo: " + third_project, "A7");
logger.CheckLoggedMessageHead ("Full path: " + third_project, "A8");
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
} catch {
logger.DumpMessages ();
throw;
} finally {
File.Delete (first_project);
File.Delete (second_project);
File.Delete (third_project);
}
}
[Test]
public void TestRequiredTask_String1 ()
@@ -2013,7 +2103,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
logger.DumpMessages ();
Assert.Fail ("A1: Build failed");
}
logger.DumpMessages ();
logger.CheckLoggedMessageHead ("Full item: foo;FOO;hmm;bar", "#A2");
logger.CheckLoggedMessageHead ("metadata1 :md1 metadata2: md2", "#A3");
@@ -2174,7 +2263,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
logger.CheckLoggedMessageHead (expected_output_msg, "A");
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages found");
}
} finally {
} catch {
logger.DumpMessages ();
}
return project;
@@ -420,5 +420,61 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
}
#if NET_4_0
[Test]
public void TestBeforeAndAfterTargets ()
{
Engine engine;
Project project;
string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""4.0"">
<Target Name=""DefaultBeforeTarget1"" BeforeTargets=""Default"">
<Message Text=""Hello from DefaultBeforeTarget1""/>
</Target>
<Target Name=""DefaultBeforeTarget2"" BeforeTargets=""Default;Default;NonExistant"">
<Message Text=""Hello from DefaultBeforeTarget2""/>
</Target>
<Target Name=""DefaultAfterTarget"" AfterTargets=""Default ; Foo"">
<Message Text=""Hello from DefaultAfterTarget""/>
</Target>
<Target Name=""Default"" DependsOnTargets=""DefaultDependsOn"">
<Message Text=""Hello from Default""/>
</Target>
<Target Name=""DefaultDependsOn"">
<Message Text=""Hello from DefaultDependsOn""/>
</Target>
</Project>";
engine = new Engine ();
project = engine.CreateNewProject ();
project.LoadXml (projectString);
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
engine.RegisterLogger (logger);
if (!project.Build ("Default")) {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
logger.CheckLoggedMessageHead ("Hello from DefaultDependsOn", "A1");
logger.CheckLoggedMessageHead ("Hello from DefaultBeforeTarget1", "A1");
logger.CheckLoggedMessageHead ("Hello from DefaultBeforeTarget2", "A1");
logger.CheckLoggedMessageHead ("Hello from Default", "A1");
logger.CheckLoggedMessageHead ("Hello from DefaultAfterTarget", "A1");
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages found");
//warnings for referencing unknown targets: NonExistant and Foo
Assert.AreEqual (2, logger.WarningsCount, "Expected warnings not raised");
}
#endif
}
}
@@ -575,7 +575,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
Assert.Fail ("Build failed");
}
logger.DumpMessages ();
logger.CheckLoggedMessageHead ("Prop2: File1", "A1");
logger.CheckLoggedMessageHead ("Files: File1", "A1");
logger.CheckLoggedMessageHead ("Files: File1", "A1");
@@ -710,7 +709,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
Assert.Fail ("Build failed");
}
logger.DumpMessages ();
logger.CheckLoggedMessageHead ("Item1: Item1OldVal", "A1");
logger.CheckLoggedMessageHead ("Item1: Val", "A2");
logger.CheckLoggedMessageHead ("Item2: Item2OldVal", "A3");
@@ -787,7 +785,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
Assert.Fail ("Build failed");
}
logger.DumpMessages ();
logger.CheckLoggedMessageHead ("output1: property: null ## array: null", "A1");
logger.CheckLoggedMessageHead ("output2: property: ## array: null", "A2");
logger.CheckLoggedMessageHead ("output3: property: null ## array: null", "A3");
@@ -1494,7 +1491,6 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
logger.DumpMessages ();
Assert.Fail ("Build failed");
}
logger.DumpMessages ();
logger.CheckLoggedMessageHead ("file1: " + Path.Combine ("bar", "foo.dll"), "A1");
@@ -79,6 +79,7 @@ Microsoft.Build.Tasks/GenerateTrustInfo.cs
Microsoft.Build.Tasks/GetAssemblyIdentity.cs
Microsoft.Build.Tasks/GetFrameworkPath.cs
Microsoft.Build.Tasks/GetFrameworkSdkPath.cs
Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
Microsoft.Build.Tasks.Hosting/ICscHostObject.cs
Microsoft.Build.Tasks.Hosting/IVbcHostObject.cs
Microsoft.Build.Tasks/LC.cs
@@ -37,8 +37,6 @@ using Mono.XBuild.Utilities;
namespace Microsoft.Build.Tasks {
public class AL : ToolTaskExtension {
Process alProcess;
public AL ()
{
}
@@ -46,7 +46,6 @@ namespace Microsoft.Build.Tasks {
Dictionary<string, TargetFrameworkAssemblies> target_framework_cache;
Dictionary<string, Dictionary<Version, string>> gac;
TaskLoggingHelper log;
StringWriter sw;
List<string> search_log;
static LibraryPcFileCache cache;
@@ -121,7 +120,10 @@ namespace Microsoft.Build.Tasks {
if (!Directory.Exists (framework_dir))
return null;
AssemblyName key_aname = new AssemblyName (reference.ItemSpec);
AssemblyName key_aname;
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out key_aname))
return null;
TargetFrameworkAssemblies gac_asm;
if (!target_framework_cache.TryGetValue (framework_dir, out gac_asm)) {
// fill gac_asm
@@ -160,7 +162,9 @@ namespace Microsoft.Build.Tasks {
// Try as a filename
string path = Path.GetFullPath (Path.Combine (directory, filename));
AssemblyName aname = specific_version ? new AssemblyName (reference.ItemSpec) : null;
AssemblyName aname = null;
if (specific_version && !TryGetAssemblyNameFromFullName (reference.ItemSpec, out aname))
return null;
ResolvedReference resolved_ref = ResolveReferenceForPath (path, reference, aname, null, SearchPath.Directory, specific_version);
if (resolved_ref != null)
@@ -181,8 +185,8 @@ namespace Microsoft.Build.Tasks {
ResolvedReference ResolveReferenceForPath (string filename, ITaskItem reference, AssemblyName aname,
string error_message, SearchPath spath, bool specific_version)
{
AssemblyName found_aname = GetAssemblyNameFromFile (filename);
if (found_aname == null) {
AssemblyName found_aname;
if (!TryGetAssemblyNameFromFile (filename, out found_aname)) {
if (error_message != null)
log.LogMessage (MessageImportance.Low, error_message);
return null;
@@ -204,8 +208,8 @@ namespace Microsoft.Build.Tasks {
{
TargetFrameworkAssemblies gac_asm = new TargetFrameworkAssemblies (directory);
foreach (string file in Directory.GetFiles (directory, "*.dll")) {
AssemblyName aname = GetAssemblyNameFromFile (file);
if (aname != null)
AssemblyName aname;
if (TryGetAssemblyNameFromFile (file, out aname))
gac_asm.NameToAssemblyNameCache [aname.Name] =
new KeyValuePair<AssemblyName, string> (aname, file);
}
@@ -215,7 +219,10 @@ namespace Microsoft.Build.Tasks {
public ResolvedReference ResolveGacReference (ITaskItem reference, bool specific_version)
{
AssemblyName name = new AssemblyName (reference.ItemSpec);
AssemblyName name;
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out name))
return null;
if (!gac.ContainsKey (name.Name)) {
LogSearchMessage ("Considered {0}, but could not find in the GAC.",
reference.ItemSpec);
@@ -264,7 +271,11 @@ namespace Microsoft.Build.Tasks {
return null;
}
ResolvedReference rr = GetResolvedReference (reference, pkg.File, new AssemblyName (pkg.FullName),
AssemblyName aname;
if (!TryGetAssemblyNameFromFullName (pkg.FullName, out aname))
return null;
ResolvedReference rr = GetResolvedReference (reference, pkg.File, aname,
false, SearchPath.PkgConfig);
rr.FoundInSearchPathAsString = String.Format ("{{PkgConfig}} provided by package named {0}",
pkg.ParentPackage.Name);
@@ -291,14 +302,18 @@ namespace Microsoft.Build.Tasks {
return null;
}
return ResolveReferenceForPath (hintpath, reference, new AssemblyName (reference.ItemSpec),
AssemblyName aname;
if (!TryGetAssemblyNameFromFullName (reference.ItemSpec, out aname))
return null;
return ResolveReferenceForPath (hintpath, reference, aname,
String.Format ("File at HintPath {0}, is either an invalid assembly or the file does not exist.", hintpath),
SearchPath.HintPath, specific_version);
}
public AssemblyName GetAssemblyNameFromFile (string filename)
public bool TryGetAssemblyNameFromFile (string filename, out AssemblyName aname)
{
AssemblyName aname = null;
aname = null;
filename = Path.GetFullPath (filename);
try {
aname = AssemblyName.GetAssemblyName (filename);
@@ -310,7 +325,19 @@ namespace Microsoft.Build.Tasks {
filename);
}
return aname;
return aname != null;
}
bool TryGetAssemblyNameFromFullName (string full_name, out AssemblyName aname)
{
aname = null;
try {
aname = new AssemblyName (full_name);
} catch (FileLoadException) {
LogSearchMessage ("Considered '{0}' as an assembly name, but it is invalid.", full_name);
}
return aname != null;
}
internal static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion)
@@ -341,11 +368,8 @@ namespace Microsoft.Build.Tasks {
bool a_is_empty = (a_bytes == null || a_bytes.Length == 0);
bool b_is_empty = (b_bytes == null || b_bytes.Length == 0);
if (a_is_empty && b_is_empty)
return true;
if (a_is_empty || b_is_empty)
return false;
return true;
for (int i = 0; i < a_bytes.Length; i++)
if (a_bytes [i] != b_bytes [i])
@@ -54,24 +54,30 @@ namespace Microsoft.Build.Tasks {
assignedFiles = new ITaskItem [files.Length];
for (int i = 0; i < files.Length; i ++) {
string file = files [i].ItemSpec;
string link = files [i].GetMetadata ("Link");
string afile = null;
//FIXME: Hack!
string normalized_root = Path.GetFullPath (rootFolder);
// cur dir should already be set to
// the project dir
file = Path.GetFullPath (file);
if (String.IsNullOrEmpty (link)) {
//FIXME: Hack!
string normalized_root = Path.GetFullPath (rootFolder);
if (file.StartsWith (normalized_root)) {
afile = Path.GetFullPath (file).Substring (
normalized_root.Length);
// skip over "root/"
if (afile [0] == '\\' ||
afile [0] == '/')
afile = afile.Substring (1);
// cur dir should already be set to
// the project dir
file = Path.GetFullPath (file);
if (file.StartsWith (normalized_root)) {
afile = Path.GetFullPath (file).Substring (
normalized_root.Length);
// skip over "root/"
if (afile [0] == '\\' ||
afile [0] == '/')
afile = afile.Substring (1);
} else {
afile = Path.GetFileName (file);
}
} else {
afile = Path.GetFileName (file);
afile = link;
}
assignedFiles [i] = new TaskItem (files [i]);
@@ -43,7 +43,8 @@ namespace Microsoft.Build.Tasks {
public override bool Execute ()
{
if (Log != null)
Log.LogError (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
Log.LogError (null, code, helpKeyword,
String.IsNullOrEmpty (File) ? BuildEngine.ProjectFileOfTaskNode : File,
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
text ?? String.Empty, null);
@@ -64,6 +65,8 @@ namespace Microsoft.Build.Tasks {
get { return text; }
set { text = value; }
}
public string File { get; set; }
}
}
@@ -35,6 +35,7 @@ using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
@@ -49,6 +50,10 @@ namespace Microsoft.Build.Tasks {
string stdOutEncoding;
string workingDirectory;
string scriptFile;
#if NET_4_0
Func<string, bool> errorMatcher, warningMatcher;
#endif
public Exec ()
{
@@ -77,6 +82,10 @@ namespace Microsoft.Build.Tasks {
string commandLineCommands)
{
try {
#if NET_4_0
errorMatcher = GetTryMatchRegexFunc (CustomErrorRegularExpression, true);
warningMatcher = GetTryMatchRegexFunc (CustomWarningRegularExpression, false);
#endif
return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
} finally {
if (scriptFile != null)
@@ -117,9 +126,48 @@ namespace Microsoft.Build.Tasks {
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
{
Log.LogMessage (importance, singleLine);
#if NET_4_0
if (IgnoreStandardErrorWarningFormat ||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
#endif
Log.LogMessage (importance, singleLine);
}
#if NET_4_0
// @is_error_type - log as errors, else warnings
Func<string, bool> GetTryMatchRegexFunc (string regex_str, bool is_error_type)
{
bool is_bad = false;
Regex regex = null;
return (singleLine) => {
if (String.IsNullOrEmpty (regex_str) || is_bad)
return false;
try {
if (regex == null)
regex = new Regex (regex_str, RegexOptions.Compiled);
} catch (ArgumentException ae) {
Log.LogError ("The regular expression specified for '{0}' is invalid : {1}",
is_error_type ? "errors" : "warnings", ae.Message);
Log.LogMessage (MessageImportance.Low, "The regular expression specified for '{0}' is invalid : {1}",
is_error_type ? "errors" : "warnings", ae.ToString ());
is_bad = true;
return false;
}
if (!regex.Match (singleLine).Success)
return false;
if (is_error_type)
Log.LogError (singleLine);
else
Log.LogWarning (singleLine);
return true;
};
}
#endif
[MonoTODO]
protected override bool ValidateParameters ()
{
@@ -162,6 +210,14 @@ namespace Microsoft.Build.Tasks {
protected override MessageImportance StandardOutputLoggingImportance {
get { return base.StandardOutputLoggingImportance; }
}
#if NET_4_0
public bool IgnoreStandardErrorWarningFormat { get; set; }
public string CustomErrorRegularExpression { get; set; }
public string CustomWarningRegularExpression { get; set; }
#endif
[MonoTODO]
[Output]
@@ -0,0 +1,273 @@
//
// GetReferenceAssemblyPaths.cs: Gets the target framework directories corresponding
// to target framework moniker
//
// Author:
// Ankit Jain ([email protected])
//
// Copyright 2011 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.
using System;
using Microsoft.Build.Framework;
using System.IO;
using System.Reflection;
using System.Xml;
using System.Collections.Generic;
using Mono.XBuild.Utilities;
#if NET_4_0
namespace Microsoft.Build.Tasks
{
public class GetReferenceAssemblyPaths : TaskExtension
{
static string framework_base_path;
static string PathSeparatorAsString = Path.PathSeparator.ToString ();
const string MacOSXExternalXBuildDir = "/Library/Frameworks/Mono.framework/External/xbuild-frameworks";
public GetReferenceAssemblyPaths ()
{
}
public override bool Execute ()
{
FrameworkMoniker moniker = null;
if (!TryParseTargetFrameworkMoniker (TargetFrameworkMoniker, out moniker))
return false;
var framework = GetFrameworkDirectoriesForMoniker (moniker);
if (framework == null) {
Log.LogWarning ("Unable to find framework corresponding to the target framework moniker '{0}'. " +
"Framework assembly references will be resolved from the GAC, which might not be " +
"the intended behavior.", TargetFrameworkMoniker);
return true;
}
ReferenceAssemblyPaths = FullFrameworkReferenceAssemblyPaths = framework.Directories;
TargetFrameworkMonikerDisplayName = framework.DisplayName;
return true;
}
Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker)
{
string dirs = String.Join (PathSeparatorAsString, new string [] {
Environment.GetEnvironmentVariable ("XBUILD_FRAMEWORK_FOLDERS_PATH") ?? String.Empty,
MSBuildUtils.RunningOnMac ? MacOSXExternalXBuildDir : String.Empty,
RootPath,
DefaultFrameworksBasePath });
string [] paths = dirs.Split (new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries);
foreach (string path in paths) {
var framework = GetFrameworkDirectoriesForMoniker (moniker, path);
if (framework != null)
return framework;
}
return null;
}
//@base_path must be absolute
Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker, string base_path)
{
if (String.IsNullOrEmpty (base_path)) {
Log.LogMessage (MessageImportance.Low, "Invalid *empty* base path, ignoring. " + Environment.StackTrace);
return null;
}
Log.LogMessage (MessageImportance.Low, "Looking for framework '{0}' in root path '{1}'",
moniker, base_path);
string framework_path = Path.Combine (base_path, Path.Combine (moniker.Identifier, moniker.Version));
if (!String.IsNullOrEmpty (moniker.Profile))
framework_path = Path.Combine (framework_path, moniker.Profile);
string redistlist_dir = Path.Combine (framework_path, "RedistList");
string framework_list = Path.Combine (redistlist_dir, "FrameworkList.xml");
if (!File.Exists (framework_list)) {
Log.LogMessage (MessageImportance.Low,
"Unable to find framework definition file '{0}' for Target Framework Moniker '{1}'",
framework_list, moniker);
return null;
}
Log.LogMessage (MessageImportance.Low, "Found framework definition list '{0}' for framework '{1}'",
framework_list, moniker);
XmlReader xr = XmlReader.Create (framework_list);
try {
xr.MoveToContent ();
if (xr.LocalName != "FileList") {
Log.LogMessage (MessageImportance.Low, "Invalid frameworklist '{0}', expected a 'FileList' root element.",
framework_list);
return null;
}
var framework = new Framework ();
framework.DisplayName = xr.GetAttribute ("Name");
string framework_dir = xr.GetAttribute ("TargetFrameworkDirectory");
if (String.IsNullOrEmpty (framework_dir))
framework_dir = Path.Combine (redistlist_dir, "..");
else
framework_dir = Path.Combine (redistlist_dir, framework_dir);
var directories = new List<string> ();
directories.Add (MSBuildUtils.FromMSBuildPath (framework_dir));
string include = xr.GetAttribute ("IncludeFramework");
if (!String.IsNullOrEmpty (include)) {
var included_framework = GetFrameworkDirectoriesForMoniker (new FrameworkMoniker (moniker.Identifier, include, null));
if (included_framework != null && included_framework.Directories != null)
directories.AddRange (included_framework.Directories);
}
framework.Directories = directories.ToArray ();
return framework;
} catch (XmlException xe) {
Log.LogWarning ("Error reading framework definition file '{0}': {1}", framework_list, xe.Message);
Log.LogMessage (MessageImportance.Low, "Error reading framework definition file '{0}': {1}", framework_list,
xe.ToString ());
return null;
} finally {
if (xr != null)
((IDisposable)xr).Dispose ();
}
}
bool TryParseTargetFrameworkMoniker (string moniker_literal, out FrameworkMoniker moniker)
{
moniker = null;
if (String.IsNullOrEmpty (moniker_literal))
throw new ArgumentException ("Empty moniker string");
string [] parts = moniker_literal.Split (new char [] {','}, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length < 2 || parts.Length > 3) {
LogInvalidMonikerError (null, moniker_literal);
return false;
}
string identifier = parts [0];
string version = null;
string profile = null;
if (!parts [1].StartsWith ("Version=")) {
LogInvalidMonikerError ("Invalid framework name", moniker_literal);
return false;
}
version = parts [1].Substring (8);
if (String.IsNullOrEmpty (version)) {
LogInvalidMonikerError ("Invalid framework version", moniker_literal);
return false;
}
if (parts.Length > 2) {
if (!parts [2].StartsWith ("Profile=")) {
LogInvalidMonikerError ("Invalid framework version", moniker_literal);
return false;
}
profile = parts [2].Substring (8);
if (String.IsNullOrEmpty (profile)) {
LogInvalidMonikerError ("Invalid framework profile", moniker_literal);
return false;
}
}
moniker = new FrameworkMoniker (identifier, version, profile);
return true;
}
void LogInvalidMonikerError (string msg, string moniker_literal)
{
if (msg != null)
Log.LogError ("{0} in the Target Framework Moniker '{1}'. Expected format: 'Identifier,Version=<version>[,Profile=<profile>]'. " +
"It should have either 2 or 3 comma separated components.", msg, moniker_literal);
else
Log.LogError ("Invalid Target Framework Moniker '{0}'. Expected format: 'Identifier,Version=<version>[,Profile=<profile>]'. " +
"It should have either 2 or 3 comma separated components.", moniker_literal);
}
[Required]
public string TargetFrameworkMoniker { get; set; }
public string RootPath { get; set; }
public bool BypassFrameworkInstallChecks { get; set; }
[Output]
public string TargetFrameworkMonikerDisplayName { get; set; }
[Output]
public string[] ReferenceAssemblyPaths { get; set; }
[Output]
public string[] FullFrameworkReferenceAssemblyPaths { get; set; }
static string DefaultFrameworksBasePath {
get {
if (framework_base_path == null) {
// NOTE: code from mcs/tools/gacutil/driver.cs
PropertyInfo gac = typeof (System.Environment).GetProperty (
"GacPath", BindingFlags.Static | BindingFlags.NonPublic);
if (gac != null) {
MethodInfo get_gac = gac.GetGetMethod (true);
string gac_path = (string) get_gac.Invoke (null, null);
framework_base_path = Path.GetFullPath (Path.Combine (
gac_path, Path.Combine ("..", "xbuild-frameworks")));
}
}
return framework_base_path;
}
}
}
class FrameworkMoniker {
public readonly string Identifier;
public readonly string Version;
public readonly string Profile;
public FrameworkMoniker (string identifier, string version, string profile)
{
this.Identifier = identifier;
this.Version = version;
this.Profile = profile;
}
public override string ToString ()
{
if (String.IsNullOrEmpty (Profile))
return String.Format ("{0},Version={1}", Identifier, Version);
return String.Format ("{0},Version={1},Profile={2}", Identifier, Version, Profile);
}
}
class Framework {
public string[] Directories;
public string DisplayName;
}
}
#endif
@@ -99,6 +99,8 @@ namespace Microsoft.Build.Tasks {
// nothing to resolve
return true;
LogTaskParameters ();
assembly_resolver.Log = Log;
tempResolvedFiles = new List<ITaskItem> ();
tempCopyLocalFiles = new Dictionary<string, ITaskItem> ();
@@ -212,8 +214,8 @@ namespace Microsoft.Build.Tasks {
resolved = assembly_resolver.ResolveGacReference (item, specific_version);
} else if (String.Compare (spath, "{RawFileName}") == 0) {
//FIXME: identify assembly names, as extract the name, and try with that?
AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
if (aname != null)
AssemblyName aname;
if (assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname))
resolved = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true,
SearchPath.RawFileName);
} else if (String.Compare (spath, "{CandidateAssemblyFiles}") == 0) {
@@ -280,8 +282,8 @@ namespace Microsoft.Build.Tasks {
LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference from AssemblyFiles {0}", item.ItemSpec);
string copy_local;
AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
if (aname == null) {
AssemblyName aname;
if (!assembly_resolver.TryGetAssemblyNameFromFile (item.ItemSpec, out aname)) {
Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal);
continue;
@@ -523,6 +525,19 @@ namespace Microsoft.Build.Tasks {
rr.FoundInSearchPath == SearchPath.TargetFrameworkDirectory;
}
void LogTaskParameters ()
{
Log.LogMessage (MessageImportance.Low, "TargetFrameworkDirectories:");
if (TargetFrameworkDirectories != null)
foreach (string dir in TargetFrameworkDirectories)
Log.LogMessage (MessageImportance.Low, "\t{0}", dir);
Log.LogMessage (MessageImportance.Low, "SearchPaths:");
if (SearchPaths != null)
foreach (string path in SearchPaths)
Log.LogMessage (MessageImportance.Low, "\t{0}", path);
}
public bool AutoUnify {
get { return autoUnify; }
set { autoUnify = value; }
@@ -644,7 +659,15 @@ namespace Microsoft.Build.Tasks {
public ITaskItem[] SuggestedRedirects {
get { return suggestedRedirects; }
}
#if NET_4_0
public string TargetFrameworkMoniker { get; set; }
public string TargetFrameworkMonikerDisplayName { get; set; }
#endif
public string TargetFrameworkVersion { get; set; }
public string[] TargetFrameworkDirectories {
get { return targetFrameworkDirectories; }
set { targetFrameworkDirectories = value; }
@@ -655,6 +678,7 @@ namespace Microsoft.Build.Tasks {
set { targetProcessorArchitecture = value; }
}
static Dictionary<string, string> cultureNamesTable;
static Dictionary<string, string> CultureNamesTable {
get {
@@ -183,7 +183,7 @@ namespace Microsoft.Build.Tasks {
string col = match.Result ("${column}");
int columnNumber = 0;
if (!string.IsNullOrEmpty (col))
columnNumber = col == "255+" ? -1 : Int32.Parse (col);
columnNumber = col.IndexOf ("+") >= 0 ? -1 : Int32.Parse (col);
string category = match.Result ("${level}");
string code = match.Result ("${number}");
@@ -47,7 +47,8 @@ namespace Microsoft.Build.Tasks {
if (String.IsNullOrEmpty (text))
return true;
Log.LogWarning (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
Log.LogWarning (null, code, helpKeyword,
String.IsNullOrEmpty (File) ? BuildEngine.ProjectFileOfTaskNode : File,
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
text, null);
@@ -68,6 +69,8 @@ namespace Microsoft.Build.Tasks {
get { return text; }
set { text = value; }
}
public string File { get; set; }
}
}
@@ -42,6 +42,7 @@ namespace MonoTests.Microsoft.Build.Tasks
string [] files;
Project project;
Engine engine;
[SetUp]
public void SetUp ()
@@ -63,7 +64,7 @@ namespace MonoTests.Microsoft.Build.Tasks
"sample.txt", @"bar\sample.txt",
"sample.it.png", @"dir\sample.en.png", "sample.inv.txt"};
Engine engine = new Engine (Consts.BinPath);
engine = new Engine (Consts.BinPath);
project = engine.CreateNewProject ();
}
@@ -141,7 +142,14 @@ namespace MonoTests.Microsoft.Build.Tasks
{
string projectText = CreateProjectString (files_list);
project.LoadXml (projectText);
Assert.IsTrue (project.Build ("1"), "A1 : Error in building");
TestMessageLogger testLogger = new TestMessageLogger ();
engine.RegisterLogger (testLogger);
if (!project.Build ("1")) {
testLogger.DumpMessages ();
Assert.Fail ("A1 : Error in building");
}
}
void CheckItems (string [] values, string [] cultures, string itemlist_name, string prefix)
@@ -118,7 +118,6 @@ namespace MonoTests.Microsoft.Build.Tasks
try {
Assert.AreEqual (build_result, project.Build (), "Build " + (build_result ? "failed" : "should've failed"));
testLogger.DumpMessages ();
if (!build_result || messages == null)
// build failed as expected, don't check outputs
return;
@@ -115,6 +115,69 @@ namespace MonoTests.Microsoft.Build.Tasks
}
}
[Test]
public void TestLink ()
{
string projectText = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<ItemGroup>
<FooFiles Include=""xyz.cs"">
<Child>Cxyz.cs</Child>
<Link>Test\Link\xyz.cs</Link>
</FooFiles>
<FooFiles Include=""rel\bar.resx"">
<Child>Crel\bar.resx</Child>
<Link>Test\Link\bar.resx</Link>
</FooFiles>
<FooFiles Include=""rel\qwe.txt"">
<Child>Crel\qwe.txt</Child>
<Link>..\Test\Link\qwe.txt</Link>
</FooFiles>
</ItemGroup>
<Target Name=""1"">
<AssignTargetPath Files=""@(FooFiles)"" RootFolder=""/"">
<Output TaskParameter=""AssignedFiles"" ItemName=""FooPath"" />
</AssignTargetPath>
</Target>
</Project>";
Engine engine = new Engine(Consts.BinPath);
Project project = engine.CreateNewProject();
project.LoadXml(projectText);
string id = "A";
Assert.IsTrue(project.Build("1"), id + "1 : Error in building");
string [] files = new string [] { "xyz.cs", "rel/bar.resx", "rel/qwe.txt"};
string [] assignedFiles = new string [] {
PathCombine ("Test", "Link", "xyz.cs"),
PathCombine ("Test", "Link", "bar.resx"),
PathCombine ("..", "Test", "Link", "qwe.txt")
};
BuildItemGroup include = project.GetEvaluatedItemsByName("FooPath");
Assert.AreEqual(files.Length, include.Count, id + "2");
for (int i = 0; i < files.Length; i++) {
Assert.AreEqual (files [i], include [i].FinalItemSpec, id + "3, file #" + i);
Assert.IsTrue (include[i].HasMetadata ("TargetPath"), id + "4, file #" + i + ", TargetPath metadata missing");
Assert.AreEqual (assignedFiles [i], include[i].GetMetadata("TargetPath"), id + "5, file #" + i);
Assert.IsTrue (include [i].HasMetadata ("Child"), id + "6, file #" + i + ", Child metadata missing");
Assert.AreEqual ("C" + files [i], include [i].GetMetadata ("Child"), id + "7, file #" + i + ", Child metadata value incorrect");
}
}
string PathCombine (string path1, params string[] parts)
{
if (parts == null || parts.Length == 0)
return path1;
string final_path = path1;
foreach (string part in parts)
final_path = Path.Combine (final_path, part);
return final_path;
}
void CheckTargetPath(string[] files, string[] assignedFiles, string rootFolder, string id)
{
Engine engine = new Engine(Consts.BinPath);
@@ -210,7 +210,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
testLogger.DumpMessages ();
Assert.Fail ("Build failed");
}
testLogger.DumpMessages ();
}
[Test]
@@ -127,5 +127,45 @@ namespace MonoTests.Microsoft.Build.Tasks {
Assert.AreEqual ("@(IG)", project.EvaluatedProperties["C"].FinalValue, "A6");
}
[Test]
public void TestEmptyPropertyValue ()
{
Engine engine;
Project project;
string documentString = @"
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup>
<A>1</A>
</PropertyGroup>
<Target Name='1'>
<Message Text='Before: $(A)'/>
<CreateProperty Value=''>
<Output
TaskParameter='Value'
PropertyName='A'
/>
</CreateProperty>
<Message Text='After: $(A)'/>
</Target>
</Project>
";
engine = new Engine (Consts.BinPath);
TestMessageLogger testLogger = new TestMessageLogger ();
engine.RegisterLogger (testLogger);
project = engine.CreateNewProject ();
project.LoadXml (documentString);
if (!project.Build ("1")) {
testLogger.DumpMessages ();
Assert.Fail ("Build failed");
}
testLogger.CheckLoggedMessageHead ("Before: 1", "A1");
testLogger.CheckLoggedMessageHead ("After: ", "A2");
Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected messages found");
}
}
}
@@ -119,7 +119,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
testLogger.DumpMessages ();
Assert.Fail ("Build failed");
}
testLogger.DumpMessages ();
Assert.AreEqual (1, testLogger.NormalMessageCount, "Expected number of messages");
testLogger.CheckLoggedMessageHead (expected, "A1");
@@ -95,7 +95,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
Assert.Fail ("Build should have failed");
}
testLogger.DumpMessages ();
Assert.AreEqual (0, testLogger.CheckAny ("Text1", MessageImportance.Low), "A1");
Assert.AreEqual (0, testLogger.CheckAny ("Text2", MessageImportance.Normal), "A2");
Assert.AreEqual (0, testLogger.CheckAny ("Text3", MessageImportance.High), "A3");
@@ -104,7 +103,6 @@ namespace MonoTests.Microsoft.Build.Tasks {
Assert.AreEqual (0, testLogger.CheckAny ("Text6", MessageImportance.High), "A6");
Assert.AreEqual (0, testLogger.CheckAny ("Text7", MessageImportance.Normal), "A7");
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A8");
}
}
}
@@ -905,7 +905,6 @@ namespace MonoTests.Microsoft.Build.Tasks
testLogger.DumpMessages ();
Assert.Fail ("Build failed");
}
testLogger.DumpMessages ();
try {
testLogger.CheckLoggedAny ("For md: 3 Item1: Item1Ref: Item2: Three Item2Ref: Three Prop1: Prop1Ref: Prop2: Three Prop2Ref: Three", MessageImportance.Normal, "A1");
@@ -69,6 +69,9 @@ namespace MonoTests.Microsoft.Build.Tasks
set { task_finished = value; }
}
public int WarningsCount { get; set; }
public int ErrorsCount { get; set; }
public int Count
{
get { return messages.Count; }
@@ -81,14 +84,19 @@ namespace MonoTests.Microsoft.Build.Tasks
public void Initialize (IEventSource eventSource)
{
eventSource.MessageRaised += new BuildMessageEventHandler (MessageHandler);
eventSource.ErrorRaised += new BuildErrorEventHandler (AllMessagesHandler);
eventSource.ErrorRaised += (e,o) => ErrorsCount ++;
eventSource.WarningRaised += new BuildWarningEventHandler(AllMessagesHandler);
eventSource.WarningRaised += (e,o) => WarningsCount ++;
eventSource.TargetStarted += delegate { target_started++; };
eventSource.TargetFinished += delegate { target_finished++; };
eventSource.TaskStarted += delegate { task_started++; };
eventSource.TaskFinished += delegate { task_finished++; };
eventSource.ProjectStarted += delegate(object sender, ProjectStartedEventArgs args) { project_started++; Console.WriteLine ("Project started: {0}", args.ProjectFile); };
eventSource.ProjectFinished += delegate (object sender, ProjectFinishedEventArgs args) { project_finished++; Console.WriteLine ("Project finished: {0}", args.ProjectFile); };
eventSource.ProjectStarted += delegate(object sender, ProjectStartedEventArgs args) { project_started++; };
eventSource.ProjectFinished += delegate (object sender, ProjectFinishedEventArgs args) { project_finished++; };
eventSource.BuildStarted += delegate { build_started ++; };
eventSource.BuildFinished += delegate { build_finished++; };
}
@@ -114,22 +114,16 @@ namespace Microsoft.Build.Utilities
toolOutput = new StringBuilder ();
try {
string arguments = commandLineCommands;
string responseFileSwitch = String.Empty;
if (!String.IsNullOrEmpty (responseFileCommands)) {
responseFileName = Path.GetTempFileName ();
File.WriteAllText (responseFileName, responseFileCommands);
arguments = arguments + " " + GetResponseFileSwitch (responseFileName);
responseFileSwitch = GetResponseFileSwitch (responseFileName);
}
var pinfo = GetProcessStartInfo (pathToTool, commandLineCommands, responseFileSwitch);
LogToolCommand (String.Format ("Tool {0} execution started with arguments: {1} {2}",
pathToTool, commandLineCommands, responseFileCommands));
ProcessStartInfo pinfo = new ProcessStartInfo (pathToTool, arguments);
pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
pinfo.UseShellExecute = false;
pinfo.RedirectStandardOutput = true;
pinfo.RedirectStandardError = true;
pinfo.FileName, commandLineCommands, responseFileCommands));
var pendingLineFragmentOutput = new StringBuilder ();
var pendingLineFragmentError = new StringBuilder ();
@@ -264,7 +258,7 @@ namespace Microsoft.Build.Utilities
string col = match.Result ("${column}");
int columnNumber = 0;
if (!string.IsNullOrEmpty (col))
columnNumber = col == "255+" ? -1 : Int32.Parse (col);
columnNumber = col.IndexOf ("+") >= 0 ? -1 : Int32.Parse (col);
string category = match.Result ("${level}");
string code = match.Result ("${number}");
@@ -298,6 +292,18 @@ namespace Microsoft.Build.Utilities
return String.Format ("@{0}", responseFilePath);
}
protected virtual ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
{
var pinfo = new ProcessStartInfo (pathToTool, String.Format ("{0} {1}", commandLineCommands, responseFileSwitch));
pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
pinfo.UseShellExecute = false;
pinfo.RedirectStandardOutput = true;
pinfo.RedirectStandardError = true;
return pinfo;
}
protected virtual bool HandleTaskExecutionErrors ()
{
if (!Log.HasLoggedErrors && exitCode != 0)
@@ -23,7 +23,9 @@
// THE SOFTWARE.
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.Serialization;
using System.Web;
using System.Web.Util;
@@ -43,6 +45,42 @@ namespace Microsoft.Web.Infrastructure.DynamicValidationHelper
this.wrapped = wrapped;
}
public new string this [int index] {
get { return Get (index); }
}
public new string this [string name] {
get { return Get (name); }
set{ Set (name,value); }
}
public override string[] AllKeys {
get { return wrapped.AllKeys; }
}
public override int Count {
get { return wrapped.Count; }
}
public override NameObjectCollectionBase.KeysCollection Keys {
get { return wrapped.Keys; }
}
public new void Add (NameValueCollection c)
{
wrapped.Add (c);
}
public override void Add (string name, string val)
{
wrapped.Add (name, val);
}
public override void Clear ()
{
wrapped.Clear ();
}
public override string Get (string name)
{
return Validate (name, wrapped.Get (name));
@@ -53,6 +91,41 @@ namespace Microsoft.Web.Infrastructure.DynamicValidationHelper
return Validate (wrapped.GetKey (index), wrapped.Get (index));
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
wrapped.GetObjectData (info, context);
}
public override IEnumerator GetEnumerator ()
{
return wrapped.GetEnumerator ();
}
public override string GetKey (int index)
{
return wrapped.GetKey (index);
}
public override string[] GetValues (int index)
{
return wrapped.GetValues (index);
}
public override string[] GetValues (string name)
{
return wrapped.GetValues (name);
}
public override void OnDeserialization (object sender)
{
wrapped.OnDeserialization (sender);
}
public override void Set (string name, string value)
{
wrapped.Set (name, value);
}
string Validate (string key, string value)
{
if (String.IsNullOrEmpty (value))
@@ -1,3 +1,9 @@
2011-05-05 Veerapuram Varadhan <[email protected]>
** Fixes #681916
* Tds70.cs (WriteParameterInfo): Handle null value for Image
or varbinary(max) parameters as well.
2010-09-29 Veerapuram Varadhan <[email protected]>
** Fixes failed test for smallmoney
@@ -615,7 +615,8 @@ namespace Mono.Data.Tds.Protocol
// types if param value is NULL
if ((colType == TdsColumnType.BigVarChar ||
colType == TdsColumnType.BigNVarChar ||
colType == TdsColumnType.BigVarBinary) &&
colType == TdsColumnType.BigVarBinary ||
colType == TdsColumnType.Image) &&
(param.Value == null || param.Value == DBNull.Value))
size = -1;
else
@@ -85,5 +85,5 @@
<Type Name="VMStartEvent" Kind="Class" />
</Namespace>
</Types>
<Title>Mono.Debugger</Title>
<Title>Mono.Debugger.Soft</Title>
</Overview>
@@ -356,7 +356,8 @@ namespace Mono.Debugger.Soft
BREAKPOINT = 10,
STEP = 11,
TYPE_LOAD = 12,
EXCEPTION = 13
EXCEPTION = 13,
KEEPALIVE = 14
}
enum ModifierKind {
@@ -377,7 +378,8 @@ namespace Mono.Debugger.Soft
DISPOSE = 6,
INVOKE_METHOD = 7,
SET_PROTOCOL_VERSION = 8,
ABORT_INVOKE = 9
ABORT_INVOKE = 9,
SET_KEEPALIVE = 10
}
enum CmdEvent {
@@ -1166,6 +1168,8 @@ namespace Mono.Debugger.Soft
long id = r.ReadId ();
events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
//EventHandler.AppDomainUnload (req_id, thread_id, id);
} else if (kind == EventKind.KEEPALIVE) {
events [i] = new EventInfo (etype, req_id) { };
} else {
throw new NotImplementedException ("Unknown event kind: " + kind);
}
@@ -1381,6 +1385,13 @@ namespace Mono.Debugger.Soft
SendReceive (CommandSet.VM, (int)CmdVM.ABORT_INVOKE, new PacketWriter ().WriteId (thread).WriteInt (id));
}
public void SetSocketTimeouts (int send_timeout, int receive_timeout, int keepalive_interval)
{
socket.SendTimeout = send_timeout;
socket.ReceiveTimeout = receive_timeout;
SendReceive (CommandSet.VM, (int)CmdVM.SET_KEEPALIVE, new PacketWriter ().WriteId (keepalive_interval));
}
/*
* DOMAIN
*/
@@ -17,7 +17,8 @@ namespace Mono.Debugger.Soft
Step = 11,
TypeLoad = 12,
Exception = 13,
KeepAlive = 14,
// Not part of the wire protocol
VMDisconnect = 99
}
}
}
@@ -160,6 +160,16 @@ namespace Mono.Debugger.Soft
return new EnumMirror (this, type, value);
}
//
// Enable send and receive timeouts on the connection and send a keepalive event
// every 'keepalive_interval' milliseconds.
//
public void SetSocketTimeouts (int send_timeout, int receive_timeout, int keepalive_interval)
{
conn.SetSocketTimeouts (send_timeout, receive_timeout, keepalive_interval);
}
//
// Methods to create event request objects
//
@@ -200,8 +210,8 @@ namespace Mono.Debugger.Soft
public void EnableEvents (params EventType[] events) {
foreach (EventType etype in events) {
if (etype == EventType.Breakpoint)
throw new ArgumentException ("Breakpoint events cannot be requested using EnableEvents", "events");
if (etype == EventType.Breakpoint || etype == EventType.Step)
throw new ArgumentException ("Breakpoint/Step events cannot be requested using EnableEvents", "events");
conn.EnableEvent (etype, SuspendPolicy.All, null);
}
}
@@ -584,6 +584,14 @@ public class Tests : TestsBase
return 42;
}
public int? invoke_return_nullable () {
return 42;
}
public int? invoke_return_nullable_null () {
return null;
}
public void invoke_type_load () {
new Class3 ();
}
@@ -1739,6 +1739,16 @@ public class DebuggerTests
v = this_obj.InvokeMethod (e.Thread, m, null);
AssertValue (42, v);
// return nullable
m = t.GetMethod ("invoke_return_nullable");
v = this_obj.InvokeMethod (e.Thread, m, null);
Assert.IsInstanceOfType (typeof (StructMirror), v);
// return nullable null
m = t.GetMethod ("invoke_return_nullable_null");
v = this_obj.InvokeMethod (e.Thread, m, null);
AssertValue (null, v);
// pass primitive
m = t.GetMethod ("invoke_pass_primitive");
Value[] args = new Value [] {
@@ -0,0 +1,42 @@
//
// MonoTaskScheduler.cs
//
// Author:
// Jérémie "Garuma" Laval <[email protected]>
//
// Copyright (c) 2011 Jérémie "Garuma" Laval
//
// 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_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Mono.Threading.Tasks
{
public interface IMonoTaskScheduler
{
void MonoParticipateUntil (Task task);
bool MonoParticipateUntil (Task task, ManualResetEventSlim predicateEvt, int millisecondsTimeout);
}
}
#endif
@@ -39,9 +39,7 @@ namespace Mono.Security.Protocol.Tls
#region Fields
static ManualResetEvent record_processing = new ManualResetEvent (true);
private const int WaitTimeOut = 5 * 60 * 1000;
static ManualResetEvent record_processing = new ManualResetEvent (true);
internal Stream innerStream;
internal MemoryStream inputBuffer;
@@ -875,7 +873,7 @@ namespace Mono.Security.Protocol.Tls
// Always wait until the read is complete
if (!asyncResult.IsCompleted)
{
if (!asyncResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false))
if (!asyncResult.AsyncWaitHandle.WaitOne ())
throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndRead");
}
@@ -900,7 +898,7 @@ namespace Mono.Security.Protocol.Tls
if (!asyncResult.IsCompleted)
{
if (!internalResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false))
if (!internalResult.AsyncWaitHandle.WaitOne ())
throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndWrite");
}
@@ -1,56 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
// General Information about the assembly
[assembly: AssemblyTitle("Mono.WebBrowser")]
[assembly: AssemblyDescription("Managed Wrapper for xulrunner engine, to support WebBrowser")]
[assembly: AssemblyConfiguration("Development version")]
[assembly: AssemblyCompany("MONO development team")]
[assembly: AssemblyProduct("Mono.WebBrowser")]
[assembly: AssemblyCopyright("(c) 2007, 2008 Andreia Gaita")]
[assembly: AssemblyTrademark("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AssemblyVersion("0.5.0.0")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../mono.snk")]
@@ -2,9 +2,9 @@
// CustomValidationAttribute.cs
//
// Authors:
// Marek Habersack <[email protected]>
// Marek Habersack <[email protected]>
//
// Copyright (C) 2010 Novell Inc. (http://novell.com)
// Copyright (C) 2010-2011 Novell Inc. (http://novell.com)
//
//
@@ -30,35 +30,111 @@
#if NET_4_0
using System;
using System.Collections.Generic;
using System.Reflection;
namespace System.ComponentModel.DataAnnotations
{
[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = true)]
public sealed class CustomValidationAttribute : ValidationAttribute
{
Tuple <string, Type> typeId;
MethodInfo validationMethod;
bool validationMethodChecked;
bool validationMethodSignatureValid;
int validationMethodParamCount;
public string Method { get; private set; }
public override object TypeId {
get {
throw new NotImplementedException ();
}
get { return typeId; }
}
public Type ValidatorType { get; private set; }
public CustomValidationAttribute (Type validatorType, string method)
{
this.ValidatorType = validatorType;
this.Method = method;
this.typeId = new Tuple <string, Type> (method, validatorType);
}
public override string FormatErrorMessage (string name)
{
throw new NotImplementedException ();
ThrowIfAttributeNotWellFormed ();
return String.Format ("{0} is not valid.", name);
}
// LAMESPEC: MSDN doesn't document it at all, but corcompare shows it in the type
protected override ValidationResult IsValid (object value, ValidationContext validationContext)
{
throw new NotImplementedException ();
ThrowIfAttributeNotWellFormed ();
object[] p;
if (validationMethodParamCount == 2)
p = new object [] {value, validationContext};
else
p = new object [] {value};
try {
return validationMethod.Invoke (null, p) as ValidationResult;
} catch (TargetInvocationException ex) {
if (ex.InnerException != null)
throw ex.InnerException;
throw;
}
}
void ThrowIfAttributeNotWellFormed ()
{
Type type = ValidatorType;
if (type == null)
throw new InvalidOperationException ("The CustomValidationAttribute.ValidatorType was not specified.");
if (type.IsNotPublic)
throw new InvalidOperationException (String.Format ("The custom validation type '{0}' must be public.", type.Name));
string method = Method;
if (String.IsNullOrEmpty (method))
throw new InvalidOperationException ("The CustomValidationAttribute.Method was not specified.");
if (validationMethod == null) {
if (!validationMethodChecked) {
validationMethod = type.GetMethod (method, BindingFlags.Public | BindingFlags.Static);
validationMethodChecked = true;
}
if (validationMethod == null)
throw new InvalidOperationException (
String.Format ("The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.",
method, type.Name));
if (!typeof (ValidationResult).IsAssignableFrom (validationMethod.ReturnType))
throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.", method, type.Name));
validationMethodSignatureValid = true;
ParameterInfo[] parameters = validationMethod.GetParameters ();
if (parameters == null)
validationMethodSignatureValid = false;
else {
validationMethodParamCount = parameters.Length;
switch (validationMethodParamCount) {
case 1:
break;
case 2:
if (parameters [1].ParameterType != typeof (ValidationContext))
validationMethodSignatureValid = false;
break;
default:
validationMethodSignatureValid = false;
break;
}
}
}
if (!validationMethodSignatureValid)
throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult MethodTwo(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.", method, type.Name));
}
}
}
@@ -37,7 +37,10 @@ namespace System.ComponentModel.DataAnnotations
public abstract class ValidationAttribute : Attribute
{
const string DEFAULT_ERROR_MESSAGE = "The field {0} is invalid.";
#if !NET_4_0
#if NET_4_0
object nestedCallLock = new object ();
bool nestedCall;
#else
string errorMessageResourceName;
string errorMessageString;
Type errorMessageResourceType;
@@ -127,20 +130,50 @@ namespace System.ComponentModel.DataAnnotations
get { return GetStringFromResourceAccessor (); }
}
#if NET_4_0
NotImplementedException NestedNIEX ()
{
return new NotImplementedException ("IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).");
}
//
// This is the weirdest (to be gentle) idea ever... The IsValid (object) overload
// throws the NIEX when it is called from the default IsValid (object,
// ValidationContext) overload, but not when directly. And the reverse situation is
// true as well. That means, the calls detect the "nested" calls and that we need to
// protect the nestedCall flag... ugh
//
public virtual bool IsValid (object value)
{
throw new NotImplementedException ("IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).");
lock (nestedCallLock) {
if (nestedCall)
throw NestedNIEX ();
try {
nestedCall = true;
return IsValid (value, null) == ValidationResult.Success;
} finally {
nestedCall = false;
}
}
}
protected virtual ValidationResult IsValid (object value, ValidationContext validationContext)
{
// .NET emulation
if (validationContext == null)
throw new NullReferenceException (".NET emulation.");
if (!IsValid (value)) {
string memberName = validationContext.MemberName;
return new ValidationResult (FormatErrorMessage (validationContext.DisplayName), memberName != null ? new string[] { memberName } : new string[] {});
lock (nestedCallLock) {
if (nestedCall)
throw NestedNIEX ();
try {
nestedCall = true;
if (!IsValid (value)) {
// .NET emulation
if (validationContext == null)
throw new NullReferenceException (".NET emulation.");
string memberName = validationContext.MemberName;
return new ValidationResult (FormatErrorMessage (validationContext.DisplayName), memberName != null ? new string[] { memberName } : new string[] {});
}
} finally {
nestedCall = false;
}
}
return ValidationResult.Success;
@@ -0,0 +1,81 @@
//
// Authors:
// Marek Habersack <[email protected]>
//
// Copyright (C) 2011 Novell Inc. http://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.
//
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace System.ComponentModel.DataAnnotations
{
static class ValidationAttributeCollectionExtensions
{
public static void Validate <TAttribute> (this AttributeCollection attributes, object value, ValidationContext validationContext,
ICollection <ValidationResult> validationResults, ref bool valid)
where TAttribute: ValidationAttribute
{
if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0)
return;
ValidationResult result;
foreach (TAttribute attr in attributes.OfType <TAttribute> ()) {
result = attr.GetValidationResult (value, validationContext);
if (result != ValidationResult.Success) {
valid = false;
if (validationResults != null)
validationResults.Add (result);
}
}
}
public static void ValidateExcept <TAttribute> (this AttributeCollection attributes, object value, ValidationContext validationContext,
ICollection <ValidationResult> validationResults, ref bool valid)
where TAttribute: ValidationAttribute
{
if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0)
return;
ValidationResult result;
ValidationAttribute vattr;
foreach (Attribute attr in attributes) {
if (attr is TAttribute)
continue;
vattr = attr as ValidationAttribute;
if (vattr == null)
continue;
result = vattr.GetValidationResult (value, validationContext);
if (result != ValidationResult.Success) {
valid = false;
if (validationResults != null)
validationResults.Add (result);
}
}
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Atsushi Enomoto <[email protected]>
//
// Copyright (C) 2008 Novell Inc. http://novell.com
// Copyright (C) 2008-2011 Novell Inc. http://novell.com
//
//
@@ -63,8 +63,12 @@ namespace System.ComponentModel.DataAnnotations
}
#if NET_4_0
public ValidationException (ValidationResult validationResult, ValidationAttribute validatingAttribute, object value)
: this (validationResult != null ? validationResult.ErrorMessage : null, validatingAttribute, value)
{
this.ValidationResult = validationResult;
}
public ValidationResult ValidationResult { get; private set; }
#endif
public ValidationAttribute ValidationAttribute { get; private set; }
public object Value { get; private set; }
@@ -0,0 +1,211 @@
//
// Authors:
// Marek Habersack <[email protected]>
//
// Copyright (C) 2011 Novell Inc. http://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.
//
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace System.ComponentModel.DataAnnotations
{
// TODO: we could probably use some kind of type cache here
public static class Validator
{
public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection <ValidationResult> validationResults)
{
return TryValidateObject (instance, validationContext, validationResults, false);
}
public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection <ValidationResult> validationResults, bool validateAllProperties)
{
if (instance == null)
throw new ArgumentNullException ("instance");
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
if (!Object.ReferenceEquals (instance, validationContext.ObjectInstance))
throw new ArgumentException ("The instance provided must match the ObjectInstance on the ValidationContext supplied.", "instance");
ValidationResult result;
bool valid = true;
Type instanceType = instance.GetType ();
TypeDescriptor.GetAttributes (instanceType).Validate <ValidationAttribute> (instance, validationContext, validationResults, ref valid);
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (instance);
if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0) {
foreach (PropertyDescriptor pdesc in properties) {
object value = pdesc.GetValue (instance);
ValidateProperty (pdesc, value, validationContext, validationResults, validateAllProperties, ref valid);
}
}
return valid;
}
static void ValidateProperty (PropertyDescriptor pdesc, object value, ValidationContext validationContext, ICollection <ValidationResult> validationResults,
bool validateAll, ref bool valid)
{
AttributeCollection attributes = pdesc.Attributes;
attributes.Validate <RequiredAttribute> (value, validationContext, validationResults, ref valid);
if (validateAll)
attributes.ValidateExcept <RequiredAttribute> (value, validationContext, validationResults, ref valid);
}
static PropertyDescriptor GetProperty (Type type, string propertyName, object value)
{
if (String.IsNullOrEmpty (propertyName))
throw new ArgumentNullException ("propertyName");
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (type);
PropertyDescriptor pdesc = null;
if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0)
pdesc = properties.Find (propertyName, false);
if (pdesc == null)
throw new ArgumentException (String.Format ("The type '{0}' does not contain a public property named '{1}'.", type.Name, propertyName), "propertyName");
Type valueType = value == null ? null : value.GetType ();
Type propertyType = pdesc.PropertyType;
bool invalidType = false;
Console.WriteLine ("valueType == {0}; propertyType == {1} (reference? {2})", valueType == null ? "<null>" : valueType.FullName,
propertyType, !propertyType.IsValueType || (Nullable.GetUnderlyingType (propertyType) != null));
if (valueType == null)
invalidType = !(!propertyType.IsValueType || (Nullable.GetUnderlyingType (propertyType) != null));
else if (propertyType != valueType)
invalidType = true;
if (invalidType)
throw new ArgumentException (String.Format ("The value of property '{0}' must be of type '{1}'.", propertyName, type.FullName), "propertyName");
return pdesc;
}
public static bool TryValidateProperty (object value, ValidationContext validationContext, ICollection <ValidationResult> validationResults)
{
// LAMESPEC: value can be null, validationContext must not
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
PropertyDescriptor pdesc = GetProperty (validationContext.ObjectType, validationContext.MemberName, value);
if (value == null)
return true;
bool valid = true;
ValidateProperty (pdesc, value, validationContext, validationResults, true, ref valid);
return valid;
}
public static bool TryValidateValue (object value, ValidationContext validationContext, ICollection<ValidationResult> validationResults,
IEnumerable <ValidationAttribute> validationAttributes)
{
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
ValidationResult result;
// It appears .NET makes this call before checking whether
// validationAttributes is null...
ValidationAttribute vattr = validationAttributes.FirstOrDefault <ValidationAttribute> (attr => attr is RequiredAttribute);
if (vattr != null) {
result = vattr.GetValidationResult (value, validationContext);
if (result != ValidationResult.Success) {
if (validationResults != null)
validationResults.Add (result);
return false;
}
}
if (validationAttributes == null)
return true;
bool valid = true;
foreach (ValidationAttribute attr in validationAttributes) {
if (attr == null || (attr is RequiredAttribute))
continue;
result = attr.GetValidationResult (value, validationContext);
if (result != ValidationResult.Success) {
valid = false;
if (validationResults != null)
validationResults.Add (result);
}
}
return valid;
}
public static void ValidateObject (object instance, ValidationContext validationContext)
{
ValidateObject (instance, validationContext, false);
}
public static void ValidateObject (object instance, ValidationContext validationContext, bool validateAllProperties)
{
if (instance == null)
throw new ArgumentNullException ("instance");
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
var validationResults = new List <ValidationResult> ();
if (TryValidateObject (instance, validationContext, validationResults, validateAllProperties))
return;
ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null;
throw new ValidationException (result, null, instance);
}
public static void ValidateProperty (object value, ValidationContext validationContext)
{
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
var validationResults = new List <ValidationResult> ();
if (TryValidateProperty (value, validationContext, validationResults))
return;
ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null;
throw new ValidationException (result, null, value);
}
public static void ValidateValue (object value, ValidationContext validationContext, IEnumerable <ValidationAttribute> validationAttributes)
{
if (validationContext == null)
throw new ArgumentNullException ("validationContext");
var validationResults = new List <ValidationResult> ();
if (TryValidateValue (value, validationContext, validationResults, validationAttributes))
return;
ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null;
throw new ValidationException (result, null, value);
}
}
}
@@ -1,6 +1,7 @@
../../System.Web.DynamicData/Test/Common/AssertExtensions.cs
System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProviderTests.cs
System.ComponentModel.DataAnnotations/AssociationAttributeTest.cs
System.ComponentModel.DataAnnotations/CustomValidationAttributeTest.cs
System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs
System.ComponentModel.DataAnnotations/EnumDataTypeAttributeTest.cs
System.ComponentModel.DataAnnotations/RangeAttributeTest.cs
@@ -9,4 +10,5 @@ System.ComponentModel.DataAnnotations/StringLengthAttributeTest.cs
System.ComponentModel.DataAnnotations/ValidationAttributeTest.cs
System.ComponentModel.DataAnnotations/ValidationContextTest.cs
System.ComponentModel.DataAnnotations/ValidationResultTest.cs
System.ComponentModel.DataAnnotations/ValidatorTest.cs
System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs
@@ -0,0 +1,332 @@
//
// Authors:
// Marek Habersack <[email protected]>
//
// Copyright (C) 2011 Novell, Inc. (http://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.
//
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.Design;
using System.Text;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.ComponentModel.DataAnnotations
{
#if NET_4_0
[TestFixture]
public class CustomValidationAttributeTest
{
[Test]
public void Constructor ()
{
var attr = new CustomValidationAttribute (null, "MyMethod");
Assert.IsNull (attr.ValidatorType, "#A1-1");
Assert.AreEqual ("MyMethod", attr.Method, "#A1-2");
attr = new CustomValidationAttribute (typeof (string), null);
Assert.AreEqual (typeof (string), attr.ValidatorType, "#A2-1");
Assert.IsNull (attr.Method, "#A2-2");
attr = new CustomValidationAttribute (null, null);
Assert.IsNull (attr.ValidatorType, "#A3-1");
Assert.IsNull (attr.Method, "#A3-2");
attr = new CustomValidationAttribute (typeof (string), "NoSuchMethod");
Assert.AreEqual (typeof (string), attr.ValidatorType, "#A5-1");
Assert.AreEqual ("NoSuchMethod", attr.Method, "#A5-2");
}
[Test]
public void TypeId ()
{
var attr = new CustomValidationAttribute (null, "MyMethod");
Assert.IsNotNull (attr.TypeId, "#A1-1");
Assert.AreEqual (typeof (Tuple<string, Type>), attr.TypeId.GetType (), "#A1-2");
var typeid = attr.TypeId as Tuple <string, Type>;
Assert.IsNotNull (typeid.Item1, "#A2-1");
Assert.AreEqual ("MyMethod", typeid.Item1, "#A2-2");
Assert.IsNull (typeid.Item2, "#A2-3");
attr = new CustomValidationAttribute (typeof (CustomValidationAttributeTest), "MyMethod");
typeid = attr.TypeId as Tuple<string, Type>;
Assert.IsNotNull (typeid.Item1, "#A3-1");
Assert.AreEqual ("MyMethod", typeid.Item1, "#A3-2");
Assert.IsNotNull (typeid.Item2, "#A3-3");
Assert.AreEqual (typeof (CustomValidationAttributeTest), typeid.Item2, "#A3-4");
var typeid2 = attr.TypeId as Tuple<string, Type>;
Assert.IsTrue (Object.ReferenceEquals (typeid, typeid2), "#A4");
}
[Test]
public void FormatErrorMessage ()
{
var attr = new CustomValidationAttribute (null, null);
string msg = null;
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute.ValidatorType was not specified.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 88
msg = attr.FormatErrorMessage (null);
}, "#A1");
attr = new CustomValidationAttribute (typeof (string), null);
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute.Method was not specified.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 102
msg = attr.FormatErrorMessage (null);
}, "#A2");
attr = new CustomValidationAttribute (typeof (string), String.Empty);
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute.Method was not specified.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 117
msg = attr.FormatErrorMessage (null);
}, "#A3");
attr = new CustomValidationAttribute (typeof (string), "NoSuchMethod");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute method 'NoSuchMethod' does not exist in type 'String' or is not public and static.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 126
msg = attr.FormatErrorMessage (null);
}, "#A4");
attr = new CustomValidationAttribute (typeof (PrivateValidatorMethodContainer), "MethodOne");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The custom validation type 'PrivateValidatorMethodContainer' must be public.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 138
msg = attr.FormatErrorMessage (null);
}, "#A5");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodOne");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute method 'MethodOne' in type 'PublicValidatorMethodContainer'
// must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success
// to represent success.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 150
msg = attr.FormatErrorMessage (null);
}, "#A6");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodTwo");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute method 'MethodTwo' in type 'PublicValidatorMethodContainer' must match the expected signature: public static ValidationResult MethodTwo(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 163
msg = attr.FormatErrorMessage (null);
}, "#A7");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodThree");
msg = attr.FormatErrorMessage (null);
Assert.IsNotNull (msg, "#A8-1");
Assert.IsTrue (msg.Length > 0, "#A8-2");
Assert.AreEqual (" is not valid.", msg, "#A8-3");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodFour");
msg = attr.FormatErrorMessage ("test");
Assert.IsNotNull (msg, "#A9-1");
Assert.IsTrue (msg.Length > 0, "#A9-2");
Assert.AreEqual ("test is not valid.", msg, "#A9-3");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodFive");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute method 'MethodFive' in type 'PublicValidatorMethodContainer' must match the expected signature: public static ValidationResult MethodFive(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 180
msg = attr.FormatErrorMessage (null);
}, "#A10");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodSix");
AssertExtensions.Throws<InvalidOperationException> (() => {
// MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage:
// System.InvalidOperationException : The CustomValidationAttribute method 'MethodSix' in type 'PublicValidatorMethodContainer' must match the expected signature: public static ValidationResult MethodSix(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.
//
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.ThrowIfAttributeNotWellFormed()
// at System.ComponentModel.DataAnnotations.CustomValidationAttribute.FormatErrorMessage(String name)
// at MonoTests.System.ComponentModel.DataAnnotations.CustomValidationAttributeTest.FormatErrorMessage() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\CustomValidationAttributeTest.cs:line 191
msg = attr.FormatErrorMessage (null);
}, "#A11");
}
[Test]
public void IsValid ()
{
var attr = new CustomValidationAttribute (null, null);
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A1");
attr = new CustomValidationAttribute (typeof (string), null);
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A2");
attr = new CustomValidationAttribute (typeof (string), String.Empty);
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A3");
attr = new CustomValidationAttribute (typeof (string), "NoSuchMethod");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A4");
attr = new CustomValidationAttribute (typeof (PrivateValidatorMethodContainer), "MethodOne");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A5");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodOne");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A6");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodTwo");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A7");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodThree");
bool valid = attr.IsValid ("test");
Assert.IsTrue (valid, "#A8-1");
valid = attr.IsValid (null);
Assert.IsFalse (valid, "#A8-2");
valid = attr.IsValid ("failTest");
Assert.IsFalse (valid, "#A8-3");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodFour");
valid = attr.IsValid ("test");
Assert.IsTrue (valid, "#A9-1");
valid = attr.IsValid (null);
Assert.IsFalse (valid, "#A9-2");
valid = attr.IsValid ("failTest");
Assert.IsFalse (valid, "#A9-3");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodFive");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A10");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodSix");
AssertExtensions.Throws<InvalidOperationException> (() => {
attr.IsValid ("test");
}, "#A11");
attr = new CustomValidationAttribute (typeof (PublicValidatorMethodContainer), "MethodSeven");
AssertExtensions.Throws<ApplicationException> (() => {
attr.IsValid ("test");
}, "#A12");
}
class PrivateValidatorMethodContainer
{
public static void MethodOne ()
{ }
}
public class PublicValidatorMethodContainer
{
public static void MethodOne ()
{ }
public static ValidationResult MethodTwo ()
{
return ValidationResult.Success;
}
public static ValidationResult MethodThree (object o)
{
if (o == null)
return new ValidationResult ("Object cannot be null");
string s = o as string;
if (s == null || s != "failTest")
return ValidationResult.Success;
return new ValidationResult ("Test failed as requested");
}
public static ValidationResult MethodFour (object o, ValidationContext ctx)
{
if (o == null)
return new ValidationResult ("Object cannot be null");
string s = o as string;
if (s == null || s != "failTest")
return ValidationResult.Success;
return new ValidationResult ("Test failed as requested");
}
public static ValidationResult MethodFive (object o, string s)
{
return ValidationResult.Success;
}
public static ValidationResult MethodSix (object o, ValidationContext ctx, string s)
{
return ValidationResult.Success;
}
public static ValidationResult MethodSeven (object o, ValidationContext ctx)
{
throw new ApplicationException ("SNAFU");
}
}
}
#endif
}
@@ -31,6 +31,7 @@ using System.ComponentModel.DataAnnotations;
using System.Text;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.ComponentModel.DataAnnotations
{
@@ -446,19 +447,19 @@ namespace MonoTests.System.ComponentModel.DataAnnotations
{
var attr = new ValidateFooAttribute ();
try {
AssertExtensions.Throws <NotImplementedException> (() => {
// It calls IsValid (object, validationContext) which throws the NIEX, but when that overload is called directly, there's
// no exception.
//
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
// at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 450
attr.IsValid (null);
Assert.Fail ("#A1-1");
} catch (NotImplementedException) {
// success
}
try {
}, "#A1-1");
AssertExtensions.Throws <NotImplementedException> (() => {
attr.IsValid ("stuff");
Assert.Fail ("#A1-2");
} catch (NotImplementedException) {
// success
}
}, "#A1-2");
}
[Test]
@@ -466,13 +467,9 @@ namespace MonoTests.System.ComponentModel.DataAnnotations
{
var attr = new ValidateBarAttribute ();
try {
// ...
AssertExtensions.Throws <NullReferenceException> (() => {
attr.CallIsValid (null, null);
Assert.Fail ("#A1");
} catch (NullReferenceException) {
// success
}
}, "#A1");
var vc = new ValidationContext ("stuff", null, null);
var vr = attr.CallIsValid (null, vc);
@@ -500,6 +497,41 @@ namespace MonoTests.System.ComponentModel.DataAnnotations
Assert.AreEqual ("SomeMember", list [0], "#A3-6");
}
[Test]
public void IsValid_Object_ValidationContext_CrossCallsWithNIEX ()
{
var attr = new ValidateSomethingAttribute ();
AssertExtensions.Throws<NotImplementedException> (() => {
// Thrown from the IsValid (object, ValidationContext) overload!
//
// MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_02:
// System.NotImplementedException : IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).
//
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
// at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 639
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
// at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 639
// at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_02() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 514
attr.IsValid ("stuff");
}, "#A1");
AssertExtensions.Throws<NotImplementedException> (() => {
// And this one is thrown from the IsValid (object) overload!
//
// MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_CrossCallsWithNIEX:
// System.NotImplementedException : IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).
//
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
// at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 660
// at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value)
// at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.IsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 660
// at MonoTests.System.ComponentModel.DataAnnotations.ValidateSomethingAttribute.CallIsValid(Object value, ValidationContext validationContext) in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 667
// at MonoTests.System.ComponentModel.DataAnnotations.ValidationAttributeTest.IsValid_Object_ValidationContext_CrossCallsWithNIEX() in C:\Users\grendel\Documents\Visual Studio 2010\Projects\System.Web.Test\System.Web.Test\System.ComponentModel.DataAnnotations\ValidationAttributeTest.cs:line 530
attr.CallIsValid ("stuff", null);
}, "#A2");
}
[Test]
public void Validate_Object_ValidationContext ()
{
@@ -618,7 +650,27 @@ namespace MonoTests.System.ComponentModel.DataAnnotations
return base.FormatErrorMessage (name);
}
}
#if NET_4_0
class ValidateSomethingAttribute : ValidationAttribute
{
public override bool IsValid (object value)
{
return base.IsValid (value, null) == ValidationResult.Success;
}
protected override ValidationResult IsValid (object value, ValidationContext validationContext)
{
if (base.IsValid (value))
return ValidationResult.Success;
return new ValidationResult ("failed to validate in base class");
}
public ValidationResult CallIsValid (object value, ValidationContext validationContext)
{
return IsValid (value, validationContext);
}
}
#endif
class FooErrorMessageProvider
{
public static string ErrorProperty1
@@ -1,4 +1,6 @@
#include System.ComponentModel.DataAnnotations.dll.sources
System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs
System.ComponentModel.DataAnnotations/ValidationContext.cs
System.ComponentModel.DataAnnotations/ValidationResult.cs
System.ComponentModel.DataAnnotations/Validator.cs
@@ -38,6 +38,18 @@ using System.IO;
namespace System.Configuration {
// For configuration document, use this XmlDocument instead of the standard one. This ignores xmlns attribute for MS.
internal class ConfigurationXmlDocument : XmlDocument
{
public override XmlElement CreateElement (string prefix, string localName, string namespaceURI)
{
if (namespaceURI == "http://schemas.microsoft.com/.NetConfiguration/v2.0")
return base.CreateElement (String.Empty, localName, String.Empty);
else
return base.CreateElement (prefix, localName, namespaceURI);
}
}
public sealed class Configuration
{
Configuration parent;
@@ -111,7 +111,7 @@ namespace System.Configuration
// ignore, it can fail - we deserialize only in order to get
// the configSource attribute
}
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
doc.LoadXml (RawXml);
return SectionHandler.Create (parent, ConfigContext, doc.DocumentElement);
}
@@ -159,7 +159,7 @@ namespace System.Configuration
{
if (protection_provider != null) {
ProtectedConfigurationProvider prov = ProtectedConfiguration.GetProvider (protection_provider, true);
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
reader.MoveToElement ();
@@ -69,7 +69,7 @@ namespace System.Configuration
internal string EncryptSection (string clearXml, ProtectedConfigurationProvider protectionProvider)
{
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
doc.LoadXml (clearXml);
XmlNode encryptedNode = protectionProvider.Encrypt (doc.DocumentElement);
@@ -79,7 +79,7 @@ namespace System.Configuration
internal string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider)
{
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
doc.InnerXml = encryptedXml;
XmlNode decryptedNode = protectionProvider.Decrypt (doc.DocumentElement);
@@ -66,7 +66,7 @@ namespace System.Configuration
[MonoTODO]
public override XmlNode Decrypt (XmlNode encrypted_node)
{
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
doc.Load (new StringReader (encrypted_node.OuterXml));
@@ -82,7 +82,7 @@ namespace System.Configuration
[MonoTODO]
public override XmlNode Encrypt (XmlNode node)
{
XmlDocument doc = new XmlDocument ();
XmlDocument doc = new ConfigurationXmlDocument ();
doc.Load (new StringReader (node.OuterXml));
Loaded 100 of 701 files, more files were not shown because too many files have changed in this diff. Show more