Compare commits

...
227 Commits
Author SHA1 Message Date
Duncan Mak 1f505f2ebb Add TimeZoneInfo.MonoTouch.cs so that it's included in dist 2011-12-05 20:28:03 -05:00
Zoltan Varga 3e62b6e207 Fix infinite recursion introduced by the previous patch. 2011-12-05 06:01:06 +01:00
Zoltan Varga 83e5c48472 AOT the cctor of generic classes which are referenced by SFLDA patches and superclasses of generic instances. Fixes #2155 2011-12-05 05:53:10 +01:00
Duncan Mak abc05b767c Bump to 2.10.7 2011-12-02 15:26:04 -05:00
Jb Evain 7019e2b39f Test for assignability of arrays to generic interfaces. Fixes #2304. 2011-12-02 16:46:09 +01:00
Paolo Molaro 137efe9736 Fixed complex value type scan (xmarin bug#228). 2011-12-01 17:53:52 +01:00
Marek Safar 4752df3669 Fix Array::Contains for null items via ICollection<T>. Fixes #2260
Conflicts:

	mcs/class/corlib/System/Array.cs
2011-11-30 13:52:58 +00:00
Sebastien Pouliot a2d3a480e9 Ensure that [Parameterized]ThreadStart code is always wrapped in a NSAutoreleasePool for MonoTouch. Fix bug #1999 2011-11-29 19:56:00 -05:00
Jeffrey Stedfast e79c9e9135 [monodoc] Removed debug spew 2011-11-29 16:14:06 -05:00
Miguel de Icaza bd511fa11e Fix the build, add declaration for SeqPoint 2011-11-28 04:38:37 -05:00
Zoltan Varga f8539f3cf6 Add a heuristic to insert_breakpoint () to avoid 'Unable to insert breakpoint' errors in some cases, since the set of IL offsets in the debug info doesn't completely match what the JIT generates. Fixes #407. 2011-11-26 18:09:17 +01:00
Zoltan Varga 614da57287 Save the stack space used by arguments into MonoJitInfo to avoid calling mono_arch_get_arg_info () during stack walking, since it is not signal safe. Fixes #2190. 2011-11-24 20:06:33 +01:00
Miguel de Icaza c8778b1133 Extend JsonSerializerReader to support nullables and parse a wider range of Date formats, fixes x#163 2011-11-24 01:32:05 -05:00
Zoltan Varga f3692b8819 Always free _WapiFileShare entries using _wapi_free_share_info (), otherwise zeroed out entries remain in the hash table when shared handles are disabled. Fixes #2170. 2011-11-24 02:38:49 +01:00
Rodrigo Kumpera ae25c90d61 Correctly calculate the number of cards to be marked.
* sgen-cardtable.c (sgen_card_table_mark_range): The number of
	pages to be marked must be correctly calculated to avoid the case
	when the in-card offset of the start address is bigger than
	of the end address and cause the last card to be skipped.

	Fixes #1917
2011-11-23 20:56:59 -02:00
Zoltan Varga ff47ddc6db Fix a crash introduced by 64d35e3940. Fixes #2150. 2011-11-22 23:00:21 +01:00
Rodrigo Kumpera 88ac3e5d4d Scan all ephemeron arrays during nursery collections.
* sgen-gc.c (mark_ephemerons_in_range): All ephemeron arrays
	must be scanned during a nursery collection since we ignore
	them during remset processing for a good reason.

	In the future we should use cardtable information to avoid
	scanning the whole thing.

	Fixes bxc #1175.
2011-11-22 17:25:43 -02:00
Neale Ferguson 9746e8d9f8 Implement serialization 2011-11-22 10:12:41 -05:00
Jonathan Pryor 10bcc0d354 [MonoDroid] Only alias stdout/stderr on Android devices.
Mono for Android uses Mono 2.10 + smcs to build code, which thus uses
an smcs built against the Mono for Android profile assemblies, which
would thus be built with MONODROID defined. Thus (understandably) dies
at runtime with a DllNotFoundException, as liblog.so can't be found.

Fix smcs.
2011-11-21 18:46:13 -05:00
Jonathan Pryor cf3562d2c8 [MonoDroid] Fix the libmono build.
7e49d08a nee 2763aae9c doesn't build because <fcntl.h> is missing:

	mono/utils/mono-proclib.c:517: error: 'O_RDONLY' undeclared (first use in this function

Fix the build.
2011-11-21 12:53:46 -05:00
Jonathan Pryor 2388926d50 [corlib] On Android, alias stdout/stderr to logcat.
In Mono for Android, stdout and stderr (file descriptors 1 and 2) are
only visible when debugging within MonoDevelop and/or Visual Studio,
which is rather annoying.

This was changed in Mono for Android 1.9.2, by using Console.SetOut()
and Console.SetError() to send stdout/stderr message to both
stdout/stderr and to the Android Debug Log (`adb logcat`), allowing
e.g. Console.WriteLine() output to be viewed outside of a debugger.

Problem: in order to capture user-generated messages at their earliest
point, Console.SetOut()/etc. must be called at the earliest point in
Mono for Android initialization, even if Console.WriteLine() is never
used. Worse, this adds ~180ms of startup overhead on a Nexus One.

The fix here is to move the std*/logcat duplication logic into
mscorlib.dll, so that we can configure things within the
System.Console static constructor. This moves the initialization
penalty onto users of System.Console (instead of all users).
2011-11-21 09:30:59 -05:00
Zoltan Varga d6be15f97b Don't allow compiling with stock LLVM versions, only the Mono LLVM repo at https://github.com/mono/llvm is supported. 2011-11-20 20:17:03 +01:00
Zoltan Varga ad8e7c929f Free debug info for dynamic methods by storing it in malloc-ed memory instead of the normal debugger tables. Fixes #731579. 2011-11-20 14:10:20 +01:00
Rolf Bjarne Kvinge 1638105782 [System.Data] Fix sorting in DataView when changing sort value/default sort several times. 2011-11-16 16:01:38 -05:00
Jérémie Laval ad939942b5 Fix previous commit 2011-11-16 13:21:46 -05:00
Jérémie Laval e2110645f1 [MonoDroid] Query hardware CPU count for Environment.ProcessorCount 2011-11-16 11:18:38 -05:00
Rodrigo Kumpera 55f3721a38 Add JIT counters to the local set of counters we support. 2011-11-15 21:41:25 -02:00
Alan McGovern 82d9fb288c [io-layer] Use lstat as a fallback for stat in SetFileAttributes
Make SetFileAttributes consistent with GetFileAttributes - if
stat fails and ENOENT try to use lstat in case it's a dangling
symlink.
2011-11-11 16:55:41 +00:00
Neale Ferguson 9196c64c2a Fixes bug 1916 - incorrect appending of string to buffer when remaining buffer size is less than string size. 2011-11-10 18:42:33 -05:00
Jérémie Laval 3dfc36e4ac Add missing Task_T_Test file 2011-11-10 23:37:38 +01:00
Miguel de Icaza 044461a63b Add locking around the ServiceModel.Logger, fixes a race reported on the mono-devel list 2011-11-09 23:14:49 -05:00
Rolf Bjarne Kvinge fd05675b35 Log profiler: fix comment typo 2011-11-09 00:15:48 +01:00
Sebastien Pouliot 2e9eca05b9 fix typo in monotouch build 2011-11-08 15:57:34 -05:00
Zoltan Varga eefdcf1d3a Fix profiler build if boehm is disabled. 2011-11-08 17:47:16 +01:00
Sebastien Pouliot 8546da29ca Workaround AOT limitation for bug #1443. Patch by Rodrigo Kumpera 2011-11-08 07:58:04 -05:00
Sebastien Pouliot 793bbb9a87 MonoTouch specific initialization for TimeZone (devices). Fix bug #1790 2011-11-08 07:58:04 -05:00
Jérémie Laval 5ff0b3b636 Import TPL unit test from master 2011-11-07 19:05:14 +01:00
Jérémie Laval 51eb841a56 Import TPL changes from master 2011-11-07 18:20:33 +01:00
Rodrigo Kumpera c3026122e9 Fix marshaling of Win32_IN6_ADDR. 2011-11-05 14:15:59 -02:00
Robert Jordan 6bf88caf77 [Web] Fix obvious typo in DELETE FROM WHERE statement. 2011-11-05 14:47:33 +01:00
Zoltan Varga 8b336154f7 Avoid adding a ref in OpenProcess (), it is already added in _wapi_search_handle (). Fixes #1682. 2011-11-04 18:15:40 +01:00
Zoltan Varga 9ecf360a2b Fix a crash if a profiler is not found. Fixes #1855. 2011-11-04 16:53:56 +01:00
Sebastien Pouliot 9c72742bf8 OSX and iOS does not support CLOCK_MONOTONIC so we use mach_timebase_info instead. Fix bug #1366 2011-11-04 11:14:15 -04:00
Jeremie Laval 5faf9e26c8 Add RwWrite flag to status check when already owning upgradeable lock. Fix #802. 2011-11-04 01:17:37 +01:00
Rodrigo Kumpera 6bc4446f02 Implement the icalls needed by the new mobile mmap code. 2011-11-03 17:39:59 -02:00
Rodrigo Kumpera 32942d4014 Implement a mobile ready version of memory mapped files. 2011-11-03 17:39:58 -02:00
Rodrigo Kumpera 66c0b04951 Move all Mono.Unix deps into a single place and put a skeleton of MOBILE support for mmap'd files. 2011-11-03 17:39:58 -02:00
alexrp 7cbff8d169 Fix call to mono_sgen_gc_unlock () in mono_gc_toggleref_add (). 2011-11-03 14:39:45 +01:00
Zoltan Varga a58017ca8e Fix a crash which happens when an inlined method ends with a throw inside a branch, i.e. the return value is not on one branch, and not on the other. Fixes #1835. 2011-11-02 22:54:33 +01:00
Rolf Bjarne Kvinge 6efa57b2c2 [Mono.Data.Sqlite] Use a prebuilt resources file like Managed.Windows.Forms does.
This makes it possible to build the monotouch profile, since generating the resources
file requires a System.Windows.Forms.dll, which monotouch doesn't have.
2011-11-02 12:13:38 +01:00
Zoltan Varga 6373d04e93 Delete unused link.h include 2011-11-01 20:57:26 +01:00
Jeremie Laval b8cd87e608 Set success boolean in all cases and avoid state masking. Fix #124 2011-11-01 16:30:37 +01:00
Rodrigo Kumpera 9fa7633b1f publish the same events as pthread_stop_world 2011-11-01 10:20:59 -02:00
Rodrigo Kumpera 8ea6fd8ac5 Implement new toggleref machinery for sgen.
* sgen-toggleref.c: GC backed toggleref machinery. This enables
	embedders to support toggleref style of external memory management
	without hooking up to the host retain/release machinery.

	The API export two entry points. The first let the caller register
	a callback with sgen that decides the state of a given object, by
	probably inspecting its native state. The second allows registration
	of objects with the toggleref machinery.

	The idea of toggleref is that we keep an external reference to an object
	and it can be  either a strong or weak reference. We use a weak reference
	when the external peer has no interest into the object and a strong otherwise.
2011-10-26 15:16:29 -02:00
Rodrigo Kumpera 29bc8d9b9c Export a bunch of sgen functions for internal usage. 2011-10-26 14:25:41 -02:00
Rolf Bjarne Kvinge d1df969755 Log profiler: ensure the size we pass to getsockname is initalized correctly. 2011-10-26 15:24:11 +02:00
Rolf Bjarne Kvinge 33e0667472 Log profiler: flush file after writing to it. 2011-10-26 15:22:36 +02:00
Rolf Bjarne Kvinge 2ee0c254a4 Log profiler: add support for writing to an existing file descriptor. 2011-10-26 15:02:49 +02:00
Rolf Bjarne Kvinge 5ddf92f33c Profiler: add support embedded profilers whose entry point ends with _<profiler name>. 2011-10-26 14:20:44 +02:00
Lluis Sanchez 4960cd6133 [System.Xml] Fix handling of XmlSchemaForm when importing elements
When the schema for is not explicitly set for an element, get the default form specified in the schema, and use 'unqualified' if there is no other default. This fixes bug #41.
2011-10-26 11:29:32 +02:00
Atsushi Eno dd1a9c331a Fix NET_2_1 builds. 2011-10-26 00:36:30 +09:00
Rolf Bjarne Kvinge 352bb2461b When providing stack trace for a crash make sure we attach to the crashed process, not the forked process that will become gdb. 2011-10-24 22:38:22 +02:00
Miguel de Icaza 4ef6555a3a Remove the exit code so that we can get a little bit further on MacOS X 2011-10-24 12:53:34 -04:00
Atsushi Eno 1e25dd1757 Give prefix "i" for xsi:nil. Patch by Alexander Riman, fixes pt.2 of #1198. 2011-10-24 23:53:59 +09:00
Miguel de Icaza 995a774521 Patch from Mario Kosmiskas for Bug 1460: add support for Path.GetFileName to work with MONO_IOMAP 2011-10-22 21:09:30 -04:00
Miguel de Icaza 4aeb0b7347 Fix from github.com/sehe for passing the command line arguments to the OnStart method 2011-10-22 09:58:57 -04:00
Miguel de Icaza 0e2108e5e0 Make this build on the MOBILE profile 2011-10-21 11:49:49 -04:00
Marek Safar 3f246aa0b2 Fix VolatileRead(uint&), VolatileWrite(uint&,uint) to use correct word size 2011-10-19 15:38:13 +01:00
Sebastien Pouliot 0222d30eab Ensure private key flow from the mono store into the X509Certificate2 instance. Patch from bug #1201 2011-10-18 15:50:34 -04:00
Alan McGovern 35c0bb794e [WindowsBase] Add better support for Default/Override content_types
System.IO.Packaging already had full support for parsing [Content_Types].xml
if it contained both <Override> and <Default> nodes when specifying content
types for files. However we had taken a shortcut before by explicitly writing
the content type of each file using an <Override> attribute for every file. We
now properly write a <Default> element and only use <Override> attributes when
required.
2011-10-18 11:43:14 +01:00
Jérémie Laval d12e49a9b3 [WindowsBase] Don't treat special file [Content-Types].xml as a part, ends up as a duplicate when writing back a package 2011-10-18 00:50:49 +01:00
Alan McGovern 97426e608b [System.IO.Packaging] Fix some dispose related issues
Ensure we can call dispose multiple times without blowing up. Also
ensure that we do not close streams which are passed in by the user.
We should only close streams which are implicitly created by the API.
This is a modification of the patch proposed for bug #1464, which is
now fixed by this commit.
2011-10-18 00:48:28 +01:00
Miguel de Icaza daa4a4f0f5 Fix for 1461: Microsoft's generated deserializer call CollapseWhitespace extensively 2011-10-17 17:06:29 -04:00
Rolf Bjarne Kvinge b3cc72b9a7 Add System.Numerics to the mobile profile. 2011-10-17 12:32:45 +02:00
Gonzalo Paniagua Javier 32029f1171 Return the correct length for input streams 2011-10-17 00:46:14 -04:00
Marek Safar 44882b1925 Fix System.Data.Services.Client public key 2011-10-16 12:03:08 -04:00
Miguel de Icaza b7ad6a07a8 Apply patch from Mario Kosmiskaso fix bug 1210: Correctly propagate the Operation Context on async calls
The OperationContext is a [ThreadStatic] variable therefore when a REST call is
made asynchronously the worker thread will not see a context set and will not
expose any data through the context.

A possible solution (which I implemented in the attached patch) is for
ClientRealProxy to set the context in the channel prior to executing the call
(either sync or async). The ClientRuntimeChannel needs to then properly set and
reset the context in the worker thread.

Because WCF operations marked [OperationContract(AsyncPattern = true)] using
IAsyncResult only generate an outgoing call on End<OperationName> the
ClientRuntimeChannel.EndProcess must not reset the context as it's currently
doing. The context can only be reset after calling EndInvoke because the
request will be only generated at this point.
2011-10-16 11:44:36 -04:00
Miguel de Icaza 2bb4353929 Apply patch from Mario Kosmiskaso fix bug 1209: Patch to correctly expose WebOperationContext.IncomingResponse
There was apparently no point in the call flow when the reponse message was set
in the context, resulting in WebOperationContext.IncomingResponse always being
null.

After patching WebMessageFormatter to set the response in the context (if
available) the value of WebOperationContext.IncomingResponse was still null. A
bit more investigation showed that IncomingWebResponseContext would construct a
HttpResponseMessageProperty encapsulating the OperationContext at the time the
request was made but before the response was received and cache that object.
That caused the HttpResponseMessageProperty to always have a null value for the
response. The second part of the patch changes this behavior and always creates
a new HttpResponseMessageProperty on GET.
2011-10-16 11:41:36 -04:00
Miguel de Icaza 88df658060 Apply patch from Mario Kosmiskaso fix bug 1207: Throw the correct exception when a REST request returns a 404
.NET throws a EndpointNotFoundException encapsulating a WebException when a
REST request returns a 404.

The attached patch tests for a 404 and throws the same exception chain thrown
by .NET.
2011-10-16 11:37:43 -04:00
Miguel de Icaza 6ca75c627b Apply patch from Mario Kosmiskaso fix bug 1207: Check reference before copying values from Headers
OutgoingWebRequestContext throws a NullReferenceException when making a REST
call. The exception is thrown because there are no Headers in the context.

Attached patch simply tests for null before copying values from Headers.
2011-10-16 11:37:06 -04:00
Miguel de Icaza 393f7c7f3e Apply patch from Mario Kosmiskaso fix bug 1205: Check reference before copying values from Headers
OutgoingWebRequestContext throws a NullReferenceException when making a REST
call. The exception is thrown because there are no Headers in the context.

Attached patch simply tests for null before copying values from Headers.
2011-10-16 11:33:37 -04:00
Miguel de Icaza 07268b7ab8 Apply patch from Mario Kosmiskaso fix bug 1204: Add certificate to the HttpWebRequest if configured
System.ServiceModel.Channels.HttpRequestChannel never added the configured
certificate to the HttpWebRequest which prevented client side authentication.

The attached patch does exactly that if a certificate has been configured.
2011-10-16 11:32:07 -04:00
Miguel de Icaza 241a34d604 Fix bug 1203, relaxes the test for the protocol to allow https endpoints 2011-10-16 11:29:09 -04:00
Gonzalo Paniagua Javier da1bdf6b34 Don't 404 when any of the hashes has a / in it
This fixes "random" problems getting resources served by
	WebResource.axd.
2011-10-16 00:14:22 -04:00
Rolf Bjarne Kvinge f0737b398c Log profiler: Don't include major collections in ondemand mode. 2011-10-13 14:39:15 +02:00
David Evans f373840a8a Fix regression to System.Diagnostics.Process.PrivateMemorySize64 (). Fixes #1459 2011-10-13 08:01:06 +02:00
QuickJack 2d1dba2a8f Edited mcs/class/System/System.Net/WebRequest.cs via GitHub 2011-10-12 23:42:33 -04:00
QuickJack a8cee6b88e Edited mcs/class/System/System.Net/WebRequest.cs via GitHub 2011-10-12 23:42:29 -04:00
QuickJack 76debbe013 Edited mcs/class/System/System.Net.Configuration/BypassElement.cs via GitHub 2011-10-12 23:42:25 -04:00
QuickJack 92bb5751a7 Edited mcs/class/System/System.Net.Configuration/ProxyElement.cs via GitHub 2011-10-12 23:42:20 -04:00
Rolf Bjarne Kvinge 39a7dcb400 [System] Added NetworkCredential.SecurePassword. 2011-10-11 15:12:39 +02:00
Rolf Bjarne Kvinge 276ca3613f [Microsoft.Build] Stub out a lot of classes to make NuGet build with mono. 2011-10-11 15:12:39 +02:00
Rolf Bjarne Kvinge 7e9785dc4e [Microsoft.Build.Framework] Add a couple of 4.0 interfaces. 2011-10-11 15:12:38 +02:00
Rolf Bjarne Kvinge 968a511c89 [WindowsBase] Relationship ids must be valid XML identifiers. 2011-10-11 15:12:38 +02:00
Rolf Bjarne Kvinge 7cce646657 [Microsoft.Build] Stub out a few types to make nuget run. 2011-10-11 15:12:38 +02:00
Leszek 'skolima' Ciesielski b033bff618 [MSBuild] Fixed issues found by Paul Selormey.
Unset attributes should return String.Empty, null is only for invalid.
2011-10-11 15:12:38 +02:00
Leszek 'skolima' Ciesielski 9c94be9d30 [MSBuild] LinkedList used for storing children
ProjectElementContainer should now handle modifications faster.
2011-10-11 15:12:38 +02:00
Leszek 'skolima' Ciesielski 0e4b34fdd7 [MSBuild] Preserve comments in build files
Contribution by Paul Selormey
2011-10-11 15:12:37 +02:00
Leszek 'skolima' Ciesielski f784b407c4 [MSBuild] Finishing Microsoft.Build.Construction
No more NotImplementedException.
2011-10-11 15:12:37 +02:00
Leszek 'skolima' Ciesielski a246a51c0f [MSBuild] Microsoft.Build.Construction loading project files 2011-10-11 15:12:37 +02:00
Leszek 'skolima' Ciesielski 21a92702c3 fixing the build 2011-10-11 15:12:37 +02:00
Leszek 'skolima' Ciesielski dffda4000e [MSBuild] Add Microsoft.Build for 4.0 profile
Namespace Microsoft.Build.Construction partiallly implemented,
enought to construct and save a valid project file. Some
tests present (work on .Net).
2011-10-11 15:12:37 +02:00
Miguel de Icaza 736891c361 Add the fallback to MonoDoc 2011-10-07 16:36:28 -04:00
Miguel de Icaza 62e371b81b Avoid loading the same documentation file twice 2011-10-07 16:22:41 -04:00
Sebastien Pouliot 4f64a73a44 Ensure consistency when 'emitContext == true' is used in MONOTOUCH profile (since it won't work when the linker is enabled). Fix bug #1144 2011-10-05 17:44:00 -04:00
Sebastien Pouliot a147386bc4 Internalize [ComImport] in MONOTOUCH profile since it can make the (unlinked) application code crash (and we better spot this at compile time). Fix assistly #2357 2011-10-05 17:43:48 -04:00
Rolf Bjarne Kvinge d87a79de52 [System.ServiceModel] Write EndPointAddress properly in the 2.1 profile. Fixes #1244 2011-10-05 22:57:02 +02:00
Alan McGovern 14a9dbdd34 [System.IO.Path] Fix potential infinite loop in Path.GetTempFileName
Refactor this method so that it only attempts alternative filenames if
the filename just attempted already exists. This way we will never end
up looping forever being unable to create the required file. Previously
if we opened the maximum allowed files and then called GetTempFileName
we'd loop forever throwing an IOException in the FileStream constructor
every time.
2011-09-30 13:25:41 +01:00
Gonzalo Paniagua Javier fc7ffed3ac Plug an unmanaged memory leak
If Flush() was called with final_flush set to true, we were leaking the
	unmanaged memory in the output stream (if allocated).

	It was "only" an AS leak.

	Thanks to Kumpera for the help debugging this.
2011-09-30 01:23:03 -04:00
Gonzalo Paniagua Javier 7cf63b69e6 Merge pull request #167 from konrad-kruczynski/send_async_fix
Fix for Xamarin bug #531.
2011-09-29 11:47:55 -04:00
Jeffrey Stedfast 3bb319b61d [TimeZone] Fixed race condition with renewing the CurrentTimeZone object.
Fixes bug #1055.
2011-09-29 10:57:40 -04:00
Rodrigo Kumpera 6148e4b997 Request ObjectMirror type and domain in a single request. 2011-09-29 03:23:05 +02:00
Rodrigo Kumpera 39c0feba1c Cache thread id. 2011-09-29 03:18:19 +02:00
Rodrigo Kumpera 89881c9b4d Cache source files. 2011-09-29 03:17:41 +02:00
Rodrigo Kumpera 47c388364d Cache ObjectMirror type and domain. 2011-09-29 03:17:17 +02:00
Rodrigo Kumpera 8ad829ac4e Avoid looking up the ctor mirror twice. 2011-09-29 03:16:55 +02:00
Zoltan Varga 93e489abf2 Avoid a crash if mono_debug_open_image_from_memory is called without --debug. Fixes #1093. 2011-09-29 02:01:29 +02:00
Zoltan Varga 742ff74e50 Save/restore argument registers when instrumenting tail calls. Fixes #971 2011-09-27 20:58:39 +02:00
Rodrigo Kumpera abff177b4b Split bridge processing in two steps.
* sgen-bridge.c: Bridge processing must be split in
	two steps because the object scanning step must be done
	with world stop and before we copy the finalizable objects
	and the ones pointed by them.
2011-09-26 20:07:10 -03:00
Rodrigo Kumpera 5524ab9825 Fix the interation of non tracking weak refs and ephemerons.
* sgen-gc.c (finish_gray_stack): We must process ephemerons
	before we check for non track weak refs to make sure we mark
	those values whose only root are their keys.
2011-09-26 19:35:52 -03:00
Mark Probst d51f05c88b [sgen] Do the bridge callback after the world has been restarted.
Conflicts:

	mono/metadata/sgen-gc.c
2011-09-26 19:32:59 -03:00
Gonzalo Paniagua Javier 35f3c96490 Create the first tp thread right away.
Avoid 500ms delay.  Fixes Xamarin bug #1036.
2011-09-25 02:21:40 -04:00
Jérémie Laval c1d9d1a6b6 Fix double adding in ConcurrentDictionary ctor with IEnumerable seed. 2011-09-25 11:27:47 +02:00
Sebastien Pouliot 8bb319b1e6 Provide binding for sqlite3_config to allow setting the threading model. Fix bug #652 2011-09-24 09:36:19 -04:00
Gonzalo Paniagua Javier 37ac996882 Return the right empty collection in ParseQueryString.
Fixes Xamarin bug #970.
2011-09-21 07:39:58 -04:00
Miguel de Icaza 0afd473342 Fix my profiler loader.
This is what happens when you test on a pre-configured environment that
already worked fine.    This depended on a function that was never called
so we ended up probing for paths on NULL (repeating the same process twice)
instead of loading the profiler from the installation directory.
2011-09-19 22:53:17 -04:00
Jérémie Laval 4b750612a8 Fix for #892 2011-09-19 18:38:47 +02:00
Jérémie Laval 5d17d13bee Fix more argument checking for Task<T> 2011-09-19 18:38:46 +02:00
Jérémie Laval 475c172dae Check that supplied function argument in a Task<T> ctor isn't null 2011-09-19 18:38:46 +02:00
Sebastien Pouliot 323ff14b65 fix previous fix (wrt #808) 2011-09-19 11:23:14 -04:00
Sebastien Pouliot 4a6df0b082 Fix typo (bug #808) 2011-09-18 11:35:58 -04:00
Sebastien Pouliot 8141307e4b Expose Dispose under the NET_2_1 based profiles. Fix bug #154 2011-09-18 11:35:38 -04:00
Gonzalo Paniagua Javier 27b145e24f Avoid warning 2011-09-16 20:37:02 -04:00
Sebastien Pouliot bdaf7bb33c Allow commit/rollback/update events to work under MonoTouch. Fix bug #233 2011-09-15 22:21:48 -04:00
Alex Corrado 378032bf64 Fix prepending $(CURDIR) to paths failing under cygwin 2011-09-15 13:07:57 -04:00
Alex Corrado a19eb0760b 2.10.6 2011-09-13 23:37:20 -04:00
Gonzalo Paniagua Javier 5cfc62f415 Stop lying in the comments 2011-09-13 20:24:11 -04:00
Gonzalo Paniagua Javier 1ed1c4bed1 Report compilation errors when the type named in 'class' can't be loaded. 2011-09-13 20:24:01 -04:00
Rodrigo Kumpera 616f648f0d Avoid duplicates in the SSC xrefs.
* sgen-brige.c (scc_add_xref): Make sure that the xref
	array is kept sorted by doing sorted insertion for single elements
	and merging for a pair of lists.

	This avoids degenerated cases where performance of the dfs2 step
	goes unbound and slows us down significantly.

	Fixes bxc #496
2011-09-13 15:35:31 -03:00
Rodrigo Kumpera 4fccd4d599 Add logging to sgen-bridge. Log times and sizes. 2011-09-13 15:35:30 -03:00
Rolf Bjarne Kvinge bd4f80e803 [System.Data] Delay column expression evaluation after all the columns have been cloned when cloning a table. Fixes #666.
When cloning a table we loop over all the columns and clone them, but if a column
contains an expression with a reference to a later column, we'll throw an exception
unless we delay the expression compilation until all the columns have been added
to the new table clone.

So I've split out the expression compilation logic from the Expression property setter,
and now the column Clone method only sets the field. The Clone caller is responsible
for calling CompileExpression on the cloned column after adding all the cloned columns to
the cloned table.
2011-09-13 14:15:11 +02:00
Rolf Bjarne Kvinge 9e9b3f913d [System.Data] Properly clone a column's extended properties when cloning a table. Fixes #668. 2011-09-13 13:01:57 +02:00
Jérémie Laval a2a168e5f3 Add missing files. 2011-09-13 12:20:07 +02:00
Jérémie Laval 5f982b1908 Backport System.Threading.Tasks from master to mono-2-10 2011-09-13 12:18:39 +02:00
Gonzalo Paniagua Javier f00202d3e3 Delay initialization of the stream until first read
This way uri-based resources are not fetched before they are supposed
	to.

	Fixes Xamarin bug #762.
2011-09-13 01:24:14 -04:00
Gonzalo Paniagua Javier b4d4033040 Internal worker is kept while there is an ongoing operation
When there is an ongoing operation we can't dispose the internal
	worker because it might be used by the IO threadpool.

	Fixes Novell bug #691076 and Xamarin bug #766.
2011-09-13 00:06:12 -04:00
Sebastien Pouliot 68deb6335e More fixes for running unit tests under NET_2_1 profile 2011-09-12 12:53:17 -04:00
Miguel de Icaza cb965a9d3a Various fixes to the Expression parser, the fixes include:
* Fixes to the SUBSTRING and TRIM function to allow
	  a wider range of functions to be passed as
	  parameters.   This fixes xamarin #665

	* Fix to the Parser.jay grammar to eliminate the
	  reduce/reduce conflicts.

	* Dropping the string concatenation code and instead
	  use the existing arithmetic addition operator which
	  also fixes the concatenation operation in the presence
	  of null values

	* Adds the null literal

With the associated test cases.
2011-09-09 22:04:18 -04:00
Marek Habersack 86262ef424 Support colors on 256-color terminals 2011-09-09 22:04:02 -04:00
Sebastien Pouliot acfa4856b9 Adjust corlib unit tests to reduce failures when executed on the NET_2_1 profile 2011-09-09 13:48:15 -04:00
Sebastien Pouliot be8711a7e6 fix FileStream test failures under Mac OSX 2011-09-09 13:48:01 -04:00
Sebastien Pouliot 7e6a0ff51e Throwing IsolatedStorageException is a Moonlight-behavior and should not have been exposed to other 2.1 profiles 2011-09-09 13:47:48 -04:00
Sebastien Pouliot c989e10293 Ensure we can roundtrip 'Local' (special case) timezone. Fix bug #326 2011-09-09 13:29:40 -04:00
Sebastien Pouliot b04d809478 Return null instead of catching Activator exception (and return null). What was a corner case before is now very common when the linker is used (e.g. monotouch, m4a). Reported in assistly #1741 2011-09-09 13:29:26 -04:00
Miguel de Icaza 219276c182 Fallback: load profiler from the Mono default path. This in particular allows users to run mono --profiler=log foo.exe without having to set anuy environment variables 2011-09-07 18:44:22 -04:00
Sebastien Pouliot 64ff652330 Add null-check on 'partDesc'. Fix bug #612 (WCF regression) 2011-09-07 11:17:55 -04:00
Rodrigo Kumpera 75e3ca80bc Let the system figure our permissions instead of doing a poor job at it.
io.c (DeleteFile): We can't forbit a file to be deleted just before
	it's mask is not u+w. We should just call unlink and let the kernel
	figure out permissions.

	We are not SAMBA.

	We're not in the job of trying to mingle windows and unix permissions
	models so we just let the kernel figure it out and translate the appropriate
	errno value to UnauthorizedAccessException.
2011-09-06 19:36:00 -03:00
Jérémie Laval aa48b6f714 Use a TaskCompletionSource in non-generic ContinueWhenAny case. Fix #647. 2011-09-06 23:55:01 +02:00
Rodrigo Kumpera 2603a2e4fd Improve exception message. 2011-09-06 14:53:00 -03:00
Rodrigo Kumpera 05550e7c66 Add collection logging to sgen. 2011-09-06 14:52:59 -03:00
Gonzalo Paniagua Javier 99349445b1 Display more debugging info when epoll fails 2011-09-05 21:13:07 -04:00
Gonzalo Paniagua Javier d768dd0125 Fallback to poll() if epoll_create() fails
From a patch by Zoltan in bug #705190.
2011-09-05 20:51:10 -04:00
Zoltan Varga e376d9156b Handle threads which die without detaching. 2011-09-06 04:24:21 +02:00
Zoltan Varga 85349b801f Implement AppDomain.ResourceResolve. Fixes #579. 2011-09-04 03:20:22 +02:00
Mark Probst 41d1be9f34 [sgen] Break tracking weak references as early as possible.
Our tracking references code aimed to transform tracking references
into normal weak references the first time their targets became
unreachable.  It was implemented incorrectly though, and is not the
right thing to do in the first place anyway, because tracking
references have to keep tracking if the target is re-registered for
finalization.  The incorrect implementation inadvertently handled
re-registration correctly, but it kept the reference intact for one
garbage collection cycle too many.
2011-09-02 11:14:27 -03:00
Rodrigo Kumpera ac19d5bfaf Handle finalizable objects pointed by bridge objects. (cont...)
* sgen-fin-weak-hash.c:
	* sgen-gc.c: Bridge objects are used to represent objects
	that have references outside of sgen's control. They are
	kept around until the embedder figures out it's ok to
	collect them.
	Until those bridge objects turn externally unreachable,
	they must be kept around. Up to now, the expected pattern
	was to resurrect them during finalization.
	The problem with this approach is that if they hold references
	to other finalizable, non-bridge objects those will be finalized
	and we will resurrect objects that point to dead ones.

	Think of this:

	class BridgeObject {
 		FileStream stream;
	}

	The bridge object is resurrected on the finalizer and so will
	stream, disposing its native handle and been permanently unusable.

	The solution is to process brige objects before we do ordinary
	finalization. We record all dead bridges and copy/mark them.
	We drain the gray queue on the end, which makes sure all other
	finalizable objects that transitively reachable are too.

	Finally, we introduce a breaking change to the bridge API.
	The bridge must set to NULL the first object of all SCC
	entries that remain alive. Other entries will be considered
	dead and will be subject to regular finalization.

	This way, sgen knows when a given bridge object is completely
	unreachable and provides adequate finalization semantics to
	them and referenced objects.

	This fixes bxc #375
2011-09-01 20:13:06 -03:00
Atsushi Eno ae7d005dfc DiffLoader didn't handle encoded name and caused mismatch between .NET. 2011-08-31 17:53:04 -07:00
Atsushi Eno 04427d962d Fix invalid path check for Windows regarding ':'. 2011-08-31 14:12:51 -07:00
Atsushi Eno 57bc2f6ffb Add test for bug #545. 2011-08-31 14:12:42 -07:00
Atsushi Eno 059a6a685b EncoderReplacementFallbackBuffer.Reset() did not really reset its internals. 2011-08-31 14:03:10 -07:00
Chris Toshok 4ac77ca819 prepend $(CURDIR) to jay input files so that the debugging info references the right .jay 2011-08-30 17:06:50 -07:00
Jonathan Pryor d703e86b4b Don't use vasprintf on PLATFORM_ANDROID.
This allows sanely using g_log() within signal handlers.
2011-08-30 15:44:17 -04:00
Atsushi Eno 6870a59952 Implement IXmlLineInfo on XLinq node reader. 2011-08-30 23:13:36 +09:00
Atsushi Eno 721dadd34b LineInfo on namespace nodes were missing. 2011-08-30 20:22:01 +09:00
Sebastien Pouliot b7061d3e57 Fix build. Adding #if MOBILE is just not enough ;-) 2011-08-29 09:53:23 -04:00
Sebastien Pouliot 2f4099863e Fix bug #380. Patch from bnc#605795 were not committed to master but part of MonoTouch 3.x (ended up missing in MT4) 2011-08-29 08:57:30 -04:00
Hin-Tak Leung 96e0c59371 Fix mingw32 cross-build on a git no-branch checkout. Fixes #698446. 2011-08-29 01:25:19 +02:00
Zoltan Varga 1e910229a8 Allow pointers to structures to be passed in pinvoke, MS seems to allow this at least in some cases. Fixes bxc #158.
This partially reverts c4d9097c57.
2011-08-28 17:52:05 +02:00
Jérémie Laval c74031105a Check that CancellationToken coming from OperationCanceledException isn't None. Fix #472. 2011-08-28 14:50:12 +02:00
Atsushi Eno 279678d726 Revert GET switch for serializing requests. BodyWriter handles it better. 2011-08-24 18:13:04 -07:00
Atsushi Eno 46db32524d for GET request, just skip the member. It does not contain xml for null. 2011-08-24 16:48:46 -07:00
Atsushi Eno 0563034987 Skip serialization when the return type is void.
This batch should fix bug #206.
2011-08-24 12:20:23 -07:00
Atsushi Eno 0baf32151f Do not try to output empty message body to logs. 2011-08-24 12:20:13 -07:00
Atsushi Eno 8bd9eebf1f When there is void return, the common message formatter should ignore it.
This case occurs when MessageContract is used and there is no member for
the return value.
2011-08-24 12:20:02 -07:00
Atsushi Eno b9a5b85c16 ReturnValue in MessageDescription was missing when there was MessageContract. 2011-08-24 12:19:52 -07:00
Atsushi Eno c98be1ad12 Differentiate GET query parameter binding from another request binding.
This is one core of the bugfix for #206.
2011-08-24 12:19:42 -07:00
Atsushi Eno 67b1fcec06 When there was no path parameter, it ignored the whole path part. 2011-08-24 12:19:31 -07:00
Atsushi Eno 4643f66d1a This filter should ignore port, and should not filter out anonymous URIs. 2011-08-24 12:19:21 -07:00
Atsushi Eno e3aa857b74 UriTemplate should not be mandatory, make it optional. Fix unit test. 2011-08-23 11:43:56 -07:00
Alex Corrado 350fcbd003 2.10.5 2011-08-22 19:58:07 -04:00
Jérémie Laval c6799b1f41 Throw when a non-finished task is started 2011-08-20 15:00:24 +02:00
Jérémie Laval f260ff4299 Make TaskCompletionSource methods thread-safe
Conflicts:

	mcs/class/corlib/System.Threading.Tasks/TaskCompletionSource.cs
2011-08-20 14:54:28 +02:00
Rodrigo Kumpera 7122b78d60 Fix sgen-arm-mach. It requires some #define juggling.
.
2011-08-19 20:36:39 -03:00
Rodrigo Kumpera 52971cce4c Fix variance test involving nullable types.
* class.c (mono_class_is_variant_compatible): Reject valuetypes
	if not the same straight away. This fixes testing IEnumerable<int?>
	with IEnumerable<int>.

	Fixes bxc #185
2011-08-19 19:32:48 -03:00
Rodrigo Kumpera 5dc77749e7 Correctly calculate the size of the freed array buffer.
* sgen-bridge.c (dyn_array_ensure_capacity): We must correctly
	calculate the size as our allocator asserts when we do it with
	very large allocs.
2011-08-19 02:06:24 -03:00
Rodrigo Kumpera 472b3e6fca Fix android's broken pthread_kill under sgen. 2011-08-18 14:02:26 -03:00
Alan McGovern 59b4c5bc3d [LinkedList] Optimise Clear slightly. 2011-08-18 16:06:27 +01:00
Alan McGovern f105c6d4e7 Merge pull request #161 from LogosBible/master
Fix bug #311: On LinkedList.Clear, detach each node instead of dropping them en masse.
2011-08-18 16:06:10 +01:00
Zoltan Varga 2e637c4cba Disable some failing LLVM passes. Should fix bxc #280. 2011-08-18 17:00:34 +02:00
Jérémie Laval 8d44e61042 Fix coding style 2011-08-17 20:02:02 +02:00
Sebastien Pouliot eac9866b2c Provide an error message if an instance method is decorated with [MonoPInvokeCallback]. Ease finding issues like bug #296 2011-08-17 10:49:30 -04:00
Alan McGovern 7ada4aec7b [System.IO.Packaging] Fix calling convention related issues
The P/Invokes should be Cdecl as the library is compiled with that
calling convention. The delegates passed to native code must also
be marshalled as Cdecl. Fixes BXC #223.
2011-08-17 12:50:23 +01:00
Miguel de Icaza dacb11a24c updated copyrights 2011-08-17 01:26:05 -04:00
Miguel de Icaza 5c44041365 More updates 2011-08-17 01:21:40 -04:00
Rodrigo Kumpera 56b901df8f Fix g_log redirection under android. 2011-08-16 16:30:06 -03:00
Jérémie Laval 582bd35450 Backport TaskCreationOptions check from master 2011-08-16 19:06:45 +02:00
Jeffrey Stedfast 6057352d91 Merge pull request #158 from nickers/mono-2-10
remove debug CWL's
2011-08-16 04:35:11 -07:00
Tomasz Wsuł 3b450189bb Remove writing statement on standard output 2011-08-16 12:56:08 +02:00
Jeffrey Stedfast 7878c22bbf Fixed a typo in zoltan's last commit 2011-08-15 18:05:13 -04:00
Jeffrey Stedfast 674372dd15 Fix for bug #445855
In this day and age of mobile personal computing devices,
we need to periodically check the underlying system
timezone because the device may have crossed a timezone
boundary.
2011-08-15 15:19:20 -04:00
Zoltan Varga af804a9305 Escape characters in LLVM symbol names 2011-08-15 17:47:56 +01:00
Zoltan Varga 7e2eff0be7 Don't pass MONO_UNWIND_ACTUAL_METHOD to the stack walker in a signal handler, its not signal safe. Fixes bxc #263. 2011-08-14 22:35:55 +02:00
Gonzalo Paniagua Javier 7de999655d [threadpool] Exit on unhandled exceptions only
Unhandled exceptions will only set the exitcode if there is no
	AppDomain unhandled exception handler. When the exitcode is set,
	the TP will exit for unhandled exceptions.

	Fixes bug #227.
2011-08-13 00:34:13 -04:00
Gonzalo Paniagua Javier 1b84abfcab [threadpool] Work around for a race-condition
Under some circumstances new_job was not signaled and the threadpool
	threads didn't realized there was a workitem in the queue.

	Fixes Xamarin bug #12 and Novell bug #690357.
2011-08-12 23:17:05 -04:00
Sebastien Pouliot 8286cbf198 Use 'as' for casting certificate extensions since we already deal with null and malformed extensions will throw, hard to debug, ICE when we just want to ignore them 2011-08-12 14:59:12 -04:00
Gonzalo Paniagua Javier db7d7c47cb Fix the range for rnd.Next() 2011-08-11 14:17:23 -04:00
Rodrigo Kumpera 9445d6e22c Add IObserver/IObservable to MOBILE profile. 2011-08-11 13:19:47 -03:00
Marek Habersack 209c253e3f Compilation fix for e449d41158 2011-08-11 02:29:07 +02:00
Marek Habersack e449d41158 [runtime] Fix for Xamarin bug #99. Don't fail to parse assembly names with spaces surrounding = in key=value pairs 2011-08-11 02:20:11 +02:00
Zoltan Varga 9b4a07a69e Fix the newly added test_0_llvm_regress_171 (). 2011-08-10 18:10:58 +02:00
Jérémie Laval 28766cfe96 Avoid creating a delegate instance in general case when setting up continuations
Conflicts:

	mcs/class/corlib/System.Threading.Tasks/Task.cs
2011-08-10 17:16:23 +02:00
Jonathan Pryor a95adaf53d [System,MOBILE] Add System.Text.RegularExpressions.RegexOptions.Compiled.
Add the RegexOptions.Compiled enumeration value to the MOBILE profile.

Fixes: http://bugzilla.xamarin.com/show_bug.cgi?id=149

MonoTouch and Mono for Android still use `PatternCompiler`, which is
interpreted. Thus RegexOptions.Compiled is ignored, and is present only for
compatibility with Windows Phone 7, which states [0]:

	Present only in Silverlight for Windows Phone, but not supported.

[0] http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regexoptions(VS.96).aspx
2011-08-09 21:33:56 -04:00
Zoltan Varga 7ae2112edc LLVM requires two PHI entries if a previous bblock branches to the current bblock using a conditional branch whose two targets are the same. Fixes #171. 2011-08-09 21:41:54 +02:00
Zoltan Varga 79b99d358b Add support for reference instances of Interlocked.Exchange<T> to full-aot, similarly to Interlocked.CompareExchange<T>. 2011-08-09 19:16:15 +02:00
Zoltan Varga 12fedc8ee6 Merge pull request #154 from mdsol/fix-mono-tarball-tests
Fix mono tarball tests
2011-08-09 10:03:00 -07:00
Jeffrey Stedfast 27589a4031 If #CONFIGURATION_DEP isn't defined, we still want to get a default proxy 2011-08-09 12:30:32 -04:00
Harry Wilkinson 049efb2da8 Include mono/tests/delegate2.exe.config to the source tarball so that the tests pass 2011-08-08 18:16:03 +01:00
364 changed files with 15513 additions and 2034 deletions

No files matched your search

+2 -2
View File
@@ -57,11 +57,11 @@ function setup ()
CROSS_DLL_DIR="$CROSS_DIR/bin"
PATH=$CROSS_BIN_DIR:$PATH
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'|tr -d '\('`
if [ -d ./.git ]; then
MONO_GIT_COMMIT="`git log -1 --format=format:%t`"
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2`"
MONO_GIT_BRANCH="`git branch|grep '\*'|cut -d ' ' -f 2|tr -d '\)'|tr -d '\('`"
MONO_RELEASE="$MONO_VERSION-$MONO_GIT_BRANCH-$MONO_GIT_COMMIT"
else
MONO_RELEASE="$MONO_VERSION"
+5 -1
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.4)
AM_INIT_AUTOMAKE(mono,2.10.7)
AM_MAINTAINER_MODE
API_VER=2.0
@@ -2105,9 +2105,13 @@ if test "x$enable_llvm" = "xyes"; then
llvm_version=`$LLVM_CONFIG --version`
major_version=`echo $llvm_version | cut -c 1`
minor_version=`echo $llvm_version | cut -c 3`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version)
if echo $llvm_version | grep -q 'mono'; then
AC_DEFINE(LLVM_MONO_BRANCH, 1, [Whenever we are using the mono branch of LLVM])
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MONO_BRANCH"
else
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
+1
View File
@@ -58,6 +58,7 @@ case $host in
;;
*-*-linux-android*)
platform_android=yes
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
PATHSEP='/'
SEARCHSEP=':'
OS="UNIX"
+8 -9
View File
@@ -24,6 +24,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
@@ -111,28 +112,26 @@ g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask)
void
g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
{
#if PLATFORM_ANDROID
__android_log_vprint (to_android_priority (log_level), log_domain, format, args);
#else
char *msg;
vasprintf (&msg, format, args);
#if PLATFORM_ANDROID
__android_log_print (to_android_priority (log_level),
/* TODO: provide a proper app name */
"mono", "%s%s%s",
log_domain != NULL ? log_domain : "",
log_domain != NULL ? ": " : "",
msg);
#else
printf ("%s%s%s\n",
log_domain != NULL ? log_domain : "",
log_domain != NULL ? ": " : "",
msg);
#endif
free (msg);
if (log_level & fatal){
fflush (stdout);
fflush (stderr);
abort ();
}
#endif
if (log_level & fatal){
abort ();
}
}
void
+13
View File
@@ -569,6 +569,9 @@ void GC_stop_world()
thread_act_array_t act_list, prev_list;
mach_msg_type_number_t listcount, prevcount;
if (GC_notify_event)
GC_notify_event (GC_EVENT_PRE_STOP_WORLD);
# if DEBUG_THREADS
GC_printf1("Stopping the world from 0x%lx\n", mach_thread_self());
# endif
@@ -639,6 +642,9 @@ void GC_stop_world()
#endif
mach_port_deallocate(my_task, my_thread);
if (GC_notify_event)
GC_notify_event (GC_EVENT_POST_STOP_WORLD);
}
/* Caller holds allocation lock, and has held it continuously since */
@@ -654,6 +660,9 @@ void GC_start_world()
mach_msg_type_number_t listcount;
struct thread_basic_info info;
mach_msg_type_number_t outCount = THREAD_INFO_MAX;
if (GC_notify_event)
GC_notify_event (GC_EVENT_PRE_START_WORLD);
# if DEBUG_THREADS
GC_printf0("World starting\n");
@@ -700,6 +709,10 @@ void GC_start_world()
vm_deallocate(my_task, (vm_address_t)act_list, sizeof(thread_t) * listcount);
mach_port_deallocate(my_task, my_thread);
if (GC_notify_event)
GC_notify_event (GC_EVENT_POST_START_WORLD);
# if DEBUG_THREADS
GC_printf0("World started\n");
# endif
+2
View File
@@ -26,6 +26,8 @@ PLATFORM_MAKE_CORLIB_CMP = yes
PLATFORM_CHANGE_SEPARATOR_CMD=tr '/' '\\\\'
PLATFORM_PATH_SEPARATOR = ;
override CURDIR:=$(shell cygpath -m $(CURDIR))
## not so simple :-)
#PLATFORM_AOT_SUFFIX = .dll
+1 -1
View File
@@ -22,7 +22,7 @@ EXTRA_DISTFILES = \
$(RESOURCE_FILES)
Commons.Xml.Relaxng.Rnc/RncParser.cs: Commons.Xml.Relaxng.Rnc/RncParser.jay $(topdir)/jay/skeleton.cs
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs Commons.Xml.Relaxng.Rnc/RncParser.jay > Commons.Xml.Relaxng.Rnc/RncParser.cs
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $(CURDIR)/Commons.Xml.Relaxng.Rnc/RncParser.jay > Commons.Xml.Relaxng.Rnc/RncParser.cs
BUILT_SOURCES = Commons.Xml.Relaxng.Rnc/RncParser.cs
+2
View File
@@ -144,6 +144,7 @@ mobile_dirs := \
System.Transactions \
System.Data \
Mono.Cairo \
System.Numerics \
Mono.Data.Sqlite
net_3_5_only_dirs := \
@@ -156,6 +157,7 @@ net_4_0_dirs := \
System.Dynamic \
System.Numerics \
Microsoft.CSharp \
Microsoft.Build \
System.Windows.Forms.DataVisualization \
System.ComponentModel.Composition \
System.Xaml \
@@ -23,9 +23,11 @@ Microsoft.Build.Framework/IBuildEngine.cs
Microsoft.Build.Framework/IBuildEngine2.cs
Microsoft.Build.Framework/IEventSource.cs
Microsoft.Build.Framework/ILogger.cs
Microsoft.Build.Framework/INodeLogger.cs
Microsoft.Build.Framework/ITask.cs
Microsoft.Build.Framework/ITaskHost.cs
Microsoft.Build.Framework/ITaskItem.cs
Microsoft.Build.Framework/ITaskItem2.cs
Microsoft.Build.Framework/LoadInSeparateAppDomainAttribute.cs
Microsoft.Build.Framework/LoggerException.cs
Microsoft.Build.Framework/LoggerVerbosity.cs
@@ -0,0 +1,44 @@
//
// INodeLogger.cs:
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.Collections;
namespace Microsoft.Build.Framework
{
[System.Runtime.InteropServices.ComVisible (true)]
public interface INodeLogger : ILogger
{
void Initialize (IEventSource eventSource, int nodeCount);
}
}
#endif
@@ -0,0 +1,50 @@
//
// ITaskItem2.cs:
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.Collections;
namespace Microsoft.Build.Framework
{
[System.Runtime.InteropServices.GuidAttribute ("ac6d5a59-f877-461b-88e3-b2f06fce0cb9")]
[System.Runtime.InteropServices.ComVisible (true)]
public interface ITaskItem2 : ITaskItem
{
string EvaluatedIncludeEscaped { get; set; }
string GetMetadataValueEscaped (string metadataName);
void SetMetadataValueLiteral (string metadataName, string metadataValue);
IDictionary CloneCustomMetadataEscaped ();
}
}
#endif
+5
View File
@@ -0,0 +1,5 @@
obj/
bin/
*.vs10x
*.docstates
*.suo
@@ -0,0 +1,64 @@
//
// AssemblyInfo.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Reflection;
using System.Resources;
using System.Runtime;
using System.Security;
using System.Security.Permissions;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
// General Information about the Microsoft.Build assembly
[assembly: AssemblyTitle ("Microsoft.Build.dll")]
[assembly: AssemblyDescription ("Microsoft.Build.dll")]
[assembly: AssemblyDefaultAlias ("Microsoft.Build.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)]
+26
View File
@@ -0,0 +1,26 @@
thisdir = class/Microsoft.Build
SUBDIRS =
include ../../build/rules.make
LIBRARY = Microsoft.Build.dll
ifneq (4.0, $(FRAMEWORK_VERSION))
LIBRARY_NAME = dummy-Microsoft.Build.dll
NO_INSTALL = yes
NO_TEST = yes
NO_SIGN_ASSEMBLY = yes
endif
LIB_MCS_FLAGS = \
/r:$(corlib) \
/r:System.dll \
/r:System.Core.dll \
/r:System.Xml.dll \
/r:Microsoft.Build.Engine.dll \
/r:Microsoft.Build.Framework.dll
include ../../build/library.make
export TESTING_MONO=a
XBUILD_DIR=../../tools/xbuild
include $(XBUILD_DIR)/xbuild_targets.make
@@ -0,0 +1,74 @@
//
// ProjectChooseElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Exceptions;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("ProjectChooseElement (#Children={Count} "
+ "HasOtherwise={OtherwiseElement != null})")]
public class ProjectChooseElement : ProjectElementContainer
{
internal ProjectChooseElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public override string Condition { get { return null; } set { throw new InvalidOperationException(
"Can not set Condition."); } }
public ProjectOtherwiseElement OtherwiseElement {
get { return LastChild as ProjectOtherwiseElement; }
}
public ICollection<ProjectWhenElement> WhenElements {
get { return new CollectionFromEnumerable<ProjectWhenElement> (
new FilteredEnumerable<ProjectWhenElement> (Children)); }
}
internal override string XmlName {
get { return "Choose"; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "Otherwise":
var other = ContainingProject.CreateOtherwiseElement ();
AppendChild (other);
return other;
case "When":
var when = ContainingProject.CreateWhenElement (null);
PrependChild (when);
return when;
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
}
}
@@ -0,0 +1,76 @@
//
// ProjectCommentElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
internal class ProjectCommentElement : ProjectElement
{
internal ProjectCommentElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
string comment;
public string Comment { get { return comment ?? String.Empty; } set { comment = value; } }
internal override string XmlName {
get { return String.Empty; }
}
internal override void Load (XmlReader reader)
{
LoadValue (reader);
}
internal override void LoadAttribute (string name, string value)
{
}
internal override void LoadValue (XmlReader reader)
{
if (reader.NodeType == XmlNodeType.Comment) {
Comment = reader.Value;
}
}
internal override void Save (XmlWriter writer)
{
this.SaveValue (writer);
}
internal override void SaveValue (XmlWriter writer)
{
if (!String.IsNullOrEmpty (Comment)) {
writer.WriteComment (Comment);
}
}
}
}
@@ -0,0 +1,113 @@
//
// ProjectElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
using Microsoft.Build.Exceptions;
namespace Microsoft.Build.Construction
{
public abstract class ProjectElement
{
internal ProjectElement ()
{
linkedListNode = new LinkedListNode<ProjectElement> (this);
}
public ProjectRootElement ContainingProject { get; internal set; }
public ProjectElement PreviousSibling {
get { return LinkedListNode.Previous == null ? null : LinkedListNode.Previous.Value; }
internal set { }
}
public ProjectElementContainer Parent { get; internal set; }
public ProjectElement NextSibling {
get { return LinkedListNode.Next == null ? null : LinkedListNode.Next.Value; }
internal set { }
}
string label;
public string Label { get { return label ?? String.Empty; } set { label = value; } }
string condition;
public virtual string Condition { get { return condition ?? String.Empty; } set { condition = value; } }
public IEnumerable<ProjectElementContainer> AllParents {
get {
var parent = Parent;
while (parent != null) {
yield return parent;
parent = parent.Parent;
}
}
}
readonly LinkedListNode<ProjectElement> linkedListNode;
internal LinkedListNode<ProjectElement> LinkedListNode { get { return linkedListNode; } }
internal virtual void Load (XmlReader reader)
{
reader.ReadToFollowing (XmlName);
while (reader.MoveToNextAttribute ()) {
LoadAttribute (reader.Name, reader.Value);
}
LoadValue (reader);
}
internal virtual void LoadAttribute (string name, string value)
{
switch (name) {
case "xmlns":
break;
case "Label":
Label = value;
break;
case "Condition":
Condition = value;
break;
default:
throw new InvalidProjectFileException (string.Format (
"Attribute \"{0}\" is not known on node \"{1}\" [type {2}].", name, XmlName,
GetType ()));
}
}
internal virtual void LoadValue (XmlReader reader)
{
}
internal abstract string XmlName { get; }
internal virtual void Save (XmlWriter writer)
{
writer.WriteStartElement (XmlName);
SaveValue (writer);
writer.WriteEndElement ();
}
internal virtual void SaveValue (XmlWriter writer)
{
SaveAttribute (writer, "Label", Label);
SaveAttribute (writer, "Condition", Condition);
}
internal void SaveAttribute (XmlWriter writer, string attributeName, string attributeValue)
{
if (!string.IsNullOrWhiteSpace (attributeValue))
writer.WriteAttributeString (attributeName, attributeValue);
}
}
}
@@ -0,0 +1,142 @@
//
// ProjectElementContainer.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Collections.Generic;
using System.Linq;
using System.Xml;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
public abstract class ProjectElementContainer : ProjectElement
{
internal ProjectElementContainer () {}
LinkedList<ProjectElement> children = new LinkedList<ProjectElement> ();
public IEnumerable<ProjectElement> AllChildren {
get {
foreach (var child in Children) {
var container = child as ProjectElementContainer;
if (container != null)
foreach (var containersChild in container.AllChildren)
yield return containersChild;
yield return child;
}
}
}
public ICollection<ProjectElement> Children {
get { return new CollectionFromEnumerable<ProjectElement> (
children.Where (p => !(p is ProjectCommentElement))); }
}
public ICollection<ProjectElement> ChildrenReversed {
get { return new CollectionFromEnumerable<ProjectElement> (
new ReverseEnumerable<ProjectElement> (children)); }
}
public int Count {
get { return children.Count; }
}
public ProjectElement FirstChild {
get { return children.First == null ? null : children.First.Value; }
private set { }
}
public ProjectElement LastChild {
get { return children.Last == null ? null: children.Last.Value; }
private set { }
}
public void AppendChild (ProjectElement child)
{
children.AddLast (child.LinkedListNode);
child.Parent = this;
}
public void InsertAfterChild (ProjectElement child, ProjectElement reference)
{
if (reference == null) {
PrependChild (child);
} else {
child.Parent = this;
children.AddAfter (reference.LinkedListNode, child.LinkedListNode);
}
}
public void InsertBeforeChild (ProjectElement child, ProjectElement reference)
{
if (reference == null) {
AppendChild (child);
} else {
child.Parent = this;
children.AddBefore (reference.LinkedListNode, child.LinkedListNode);
}
}
public void PrependChild (ProjectElement child)
{
children.AddFirst (child.LinkedListNode);
child.Parent = this;
}
public void RemoveAllChildren ()
{
foreach (var child in children)
RemoveChild (child);
}
public void RemoveChild (ProjectElement child)
{
child.Parent = null;
children.Remove (child.LinkedListNode);
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
foreach (var child in children)
child.Save (writer);
}
internal override void LoadValue (XmlReader reader)
{
while (reader.Read ()) {
if (reader.NodeType == XmlNodeType.Element) {
var child = LoadChildElement (reader.Name);
child.Load (reader.ReadSubtree ());
} else if (reader.NodeType == XmlNodeType.Comment) {
var commentElement = new ProjectCommentElement (ContainingProject);
commentElement.Load (reader);
AppendChild (commentElement);
}
}
}
internal abstract ProjectElement LoadChildElement (string name);
}
}
@@ -0,0 +1,90 @@
//
// ProjectExtensionsElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
using System.Text;
namespace Microsoft.Build.Construction
{
public class ProjectExtensionsElement : ProjectElement
{
internal ProjectExtensionsElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public override string Condition {
get { return null; }
set {
throw new InvalidOperationException ("Can not set Condition.");
}
}
public string Content {
get { return element.InnerXml; }
set { element.InnerXml = value; }
}
public string this[string name] {
get {
var child = element[name];
return child == null ? string.Empty : child.InnerXml;
}
set {
var child = element[name];
if (child == null) {
if (string.IsNullOrEmpty (name))
return;
child = document.CreateElement (name);
element.AppendChild (child);
}
if (string.IsNullOrEmpty (value))
element.RemoveChild (child);
else
child.InnerXml = value;
}
}
internal override void Load (XmlReader reader)
{
while (reader.Read () && reader.NodeType != XmlNodeType.Element)
;
using (XmlReader subReader = reader.ReadSubtree ()) {
document = new XmlDocument ();
document.Load (subReader);
element = document.DocumentElement;
}
}
internal override void SaveValue (XmlWriter writer)
{
element.WriteContentTo (writer);
}
internal override string XmlName {
get { return "ProjectExtensions"; }
}
XmlDocument document;
XmlElement element;
}
}
@@ -0,0 +1,72 @@
//
// ProjectImportElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("Project={Project} Condition={Condition}")]
public class ProjectImportElement : ProjectElement
{
internal ProjectImportElement (string project, ProjectRootElement containingProject)
: this(containingProject)
{
Project = project;
}
internal ProjectImportElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
string project;
public string Project { get { return project ?? String.Empty; } set { project = value; } }
internal override string XmlName {
get { return "Import"; }
}
internal override void SaveValue (XmlWriter writer)
{
SaveAttribute (writer, "Project", Project);
base.SaveValue (writer);
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "Project":
Project = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
}
}
@@ -0,0 +1,58 @@
//
// ProjectImportGroupElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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 Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Imports={Count} Condition={Condition} Label={Label}")]
public class ProjectImportGroupElement : ProjectElementContainer
{
internal ProjectImportGroupElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public ICollection<ProjectImportElement> Imports {
get { return new CollectionFromEnumerable<ProjectImportElement> (
new FilteredEnumerable<ProjectImportElement> (Children)); }
}
public ProjectImportElement AddImport (string project)
{
var import = ContainingProject.CreateImportElement (project);
AppendChild (import);
return import;
}
internal override string XmlName { get { return "ImportGroup"; } }
internal override ProjectElement LoadChildElement (string name)
{
return AddImport (null);
}
}
}
@@ -0,0 +1,64 @@
//
// ProjectItemDefinitionElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("{ItemType} #Metadata={Count} Condition={Condition}")]
public class ProjectItemDefinitionElement : ProjectElementContainer
{
internal ProjectItemDefinitionElement (string itemType, ProjectRootElement containingProject)
{
ItemType = itemType;
ContainingProject = containingProject;
}
public string ItemType { get; private set; }
public ICollection<ProjectMetadataElement> Metadata {
get { return new CollectionFromEnumerable<ProjectMetadataElement> (
new FilteredEnumerable<ProjectMetadataElement> (Children)); }
}
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
{
var metadata = ContainingProject.CreateMetadataElement (name);
metadata.Value = unevaluatedValue;
AppendChild (metadata);
return metadata;
}
internal override string XmlName {
get { return ItemType; }
}
internal override ProjectElement LoadChildElement (string name)
{
return AddMetadata (name, null);
}
}
}
@@ -0,0 +1,61 @@
//
// ProjectItemDefinitionGroupElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#ItemDefinitions={Count} Condition={Condition} Label={Label}")]
public class ProjectItemDefinitionGroupElement : ProjectElementContainer
{
internal ProjectItemDefinitionGroupElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public ICollection<ProjectItemDefinitionElement> ItemDefinitions {
get { return new CollectionFromEnumerable<ProjectItemDefinitionElement> (
new FilteredEnumerable<ProjectItemDefinitionElement> (Children)); }
}
public ProjectItemDefinitionElement AddItemDefinition (string itemType)
{
var definition = ContainingProject.CreateItemDefinitionElement (itemType);
AppendChild (definition);
return definition;
}
internal override string XmlName {
get { return "ItemDefinitionGroup"; }
}
internal override ProjectElement LoadChildElement (string name)
{
return AddItemDefinition (name);
}
}
}
@@ -0,0 +1,104 @@
//
// ProjectItemElementa.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
using System.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("{ItemType} Include={Include} Exclude={Exclude} "
+ "#Metadata={Count} Condition={Condition}")]
public class ProjectItemElement : ProjectElementContainer
{
internal ProjectItemElement (string itemType, ProjectRootElement containingProject)
{
ItemType = itemType;
ContainingProject = containingProject;
}
string exclude;
public string Exclude { get { return exclude ?? String.Empty; } set { exclude = value; } }
public bool HasMetadata {
get {
var metadata = Metadata.FirstOrDefault ();
return metadata != null;
}
}
string include;
public string Include { get { return include ?? String.Empty; } set { include = value; } }
string itemType;
public string ItemType { get { return itemType ?? String.Empty; } set { itemType = value; } }
public ICollection<ProjectMetadataElement> Metadata {
get { return new CollectionFromEnumerable<ProjectMetadataElement> (
new FilteredEnumerable<ProjectMetadataElement> (Children)); }
}
string @remove;
public string Remove { get { return @remove ?? String.Empty; } set { @remove = value; } }
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
{
var metadata = ContainingProject.CreateMetadataElement (name, unevaluatedValue);
AppendChild (metadata);
return metadata;
}
internal override string XmlName {
get { return ItemType; }
}
internal override void SaveValue (XmlWriter writer)
{
SaveAttribute (writer, "Include", Include);
SaveAttribute (writer, "Exclude", Exclude);
SaveAttribute (writer, "Remove", Remove);
base.SaveValue (writer);
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "Include":
Include = value;
break;
case "Exclude":
Exclude = value;
break;
case "Remove":
Remove = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override ProjectElement LoadChildElement (string name)
{
var metadata = ContainingProject.CreateMetadataElement (name);
AppendChild (metadata);
return metadata;
}
}
}
@@ -0,0 +1,94 @@
//
// ProjectItemGroupElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Collections.Generic;
using System.Linq;
using Microsoft.Build.Internal;
using System;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Items={Count} Condition={Condition} Label={Label}")]
public class ProjectItemGroupElement : ProjectElementContainer
{
public ProjectItemElement AddItem (string itemType, string include)
{
return AddItem (itemType, include, null);
}
public ProjectItemElement AddItem (string itemType, string include,
IEnumerable<KeyValuePair<string, string>> metadata)
{
var item = ContainingProject.CreateItemElement (itemType, include);
if (metadata != null)
foreach (var data in metadata)
item.AddMetadata (data.Key, data.Value);
var lastChild = LastChild;
foreach (var existingItem in Items) {
var compare = string.Compare (item.ItemType, existingItem.ItemType,
StringComparison.OrdinalIgnoreCase);
if (compare == 0) {
if (string.Compare (item.Include, existingItem.Include,
StringComparison.OrdinalIgnoreCase) >= 0)
continue;
lastChild = existingItem.PreviousSibling;
break;
}
if (compare < 0) {
lastChild = existingItem.PreviousSibling;
break;
}
}
InsertAfterChild (item, lastChild);
return item;
}
internal ProjectItemGroupElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public ICollection<ProjectItemElement> Items {
get { return new CollectionFromEnumerable<ProjectItemElement> (
new FilteredEnumerable<ProjectItemElement> (Children)); }
}
internal override string XmlName {
get { return "ItemGroup"; }
}
internal override ProjectElement LoadChildElement (string name)
{
var item = ContainingProject.CreateItemElement (name);
AppendChild (item);
return item;
}
}
}
@@ -0,0 +1,63 @@
//
// ProjectMetadataElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("{Name} Value={Value} Condition={Condition}")]
public class ProjectMetadataElement : ProjectElement
{
internal ProjectMetadataElement (string name, ProjectRootElement containingProject)
{
Name = name;
ContainingProject = containingProject;
}
string name;
public string Name { get { return name ?? String.Empty; } set { name = value; } }
string internalValue;
public string Value { get { return internalValue ?? String.Empty; } set { internalValue = value; } }
internal override string XmlName {
get { return Name; }
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
if (!string.IsNullOrWhiteSpace (Value))
writer.WriteValue (Value);
}
internal override void LoadValue (XmlReader reader)
{
while (reader.Read () & reader.NodeType != XmlNodeType.Text)
;
Value = reader.Value;
}
}
}
@@ -0,0 +1,65 @@
//
// ProjectOnErrorElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("ExecuteTargets={ExecuteTargets}")]
public class ProjectOnErrorElement : ProjectElement
{
internal ProjectOnErrorElement (string executeTargets, ProjectRootElement containingProject)
: this(containingProject)
{
ExecuteTargetsAttribute = executeTargets;
}
internal ProjectOnErrorElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public string ExecuteTargetsAttribute { get; set; }
internal override string XmlName {
get { return "OnError"; }
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
SaveAttribute (writer, "ExecuteTargets", ExecuteTargetsAttribute);
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "ExecuteTargets":
ExecuteTargetsAttribute = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
}
}
@@ -0,0 +1,86 @@
//
// ProjectOtherwiseElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Collections.Generic;
using System;
using System.Linq;
using Microsoft.Build.Exceptions;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Children={Count}")]
public class ProjectOtherwiseElement : ProjectElementContainer
{
internal ProjectOtherwiseElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public ICollection<ProjectChooseElement> ChooseElements {
get { return new CollectionFromEnumerable<ProjectChooseElement> (
new FilteredEnumerable<ProjectChooseElement> (Children)); }
}
public override string Condition {
get { return null; }
set {
throw new InvalidOperationException ("Can not set Condition.");
}
}
public ICollection<ProjectItemGroupElement> ItemGroups {
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
}
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
}
internal override string XmlName {
get { return "Otherwise"; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "PropertyGroup":
var property = ContainingProject.CreatePropertyGroupElement ();
AppendChild (property);
return property;
case "ItemGroup":
var item = ContainingProject.CreateItemGroupElement ();
AppendChild (item);
return item;
case "When":
var when = ContainingProject.CreateWhenElement (null);
AppendChild (when);
return when;
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
}
}
@@ -0,0 +1,90 @@
//
// ProjectOutputElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("Name={Name} TaskParameter={TaskParameter} ItemName={ItemName} "
+ "PropertyName={PropertyName} Condition={Condition}")]
public class ProjectOutputElement : ProjectElement
{
internal ProjectOutputElement (string taskParameter, string itemType, string propertyName,
ProjectRootElement containintProject)
{
TaskParameter = taskParameter;
ItemType = itemType;
PropertyName = propertyName;
ContainingProject = containintProject;
}
public bool IsOutputItem {
get { return !String.IsNullOrWhiteSpace(itemType); }
}
public bool IsOutputProperty {
get { return !String.IsNullOrWhiteSpace(propertyName); }
}
string itemType;
public string ItemType { get { return itemType ?? String.Empty; } set { itemType = value; } }
string propertyName;
public string PropertyName { get { return propertyName ?? String.Empty; } set { propertyName = value; } }
string taskParameter;
public string TaskParameter {
get { return taskParameter ?? String.Empty; }
set { taskParameter = value; }
}
internal override string XmlName {
get { return "Output"; }
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
SaveAttribute (writer, "TaskParameter", TaskParameter);
if (IsOutputProperty)
SaveAttribute (writer, "PropertyName", PropertyName);
else
SaveAttribute (writer, "ItemName", ItemType);
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "TaskParameter":
TaskParameter = value;
break;
case "PropertyName":
PropertyName = value;
break;
case "ItemName":
ItemType = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
}
}
@@ -0,0 +1,61 @@
//
// ProjectPropertyElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("{Name} Value={Value} Condition={Condition}")]
public class ProjectPropertyElement : ProjectElement
{
string name;
public string Name { get { return name ?? String.Empty; } set { name = value; } }
string internalValue;
public string Value { get { return internalValue ?? String.Empty; } set { internalValue = value; } }
internal ProjectPropertyElement (string name, ProjectRootElement containingProject)
{
Name = name;
ContainingProject = containingProject;
}
internal override string XmlName {
get { return Name; }
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
if (!string.IsNullOrWhiteSpace (Value))
writer.WriteValue (Value);
}
internal override void LoadValue (XmlReader reader)
{
while (reader.Read () & reader.NodeType != XmlNodeType.Text)
;
Value = reader.Value;
}
}
}
@@ -0,0 +1,84 @@
//
// ProjectPropertyGroupElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
using System.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Properties={Count} Condition={Condition} Label={Label}")]
public class ProjectPropertyGroupElement : ProjectElementContainer
{
public ProjectPropertyElement AddProperty (string name, string unevaluatedValue)
{
var property = ContainingProject.CreatePropertyElement (name);
property.Value = unevaluatedValue;
AppendChild (property);
return property;
}
public ProjectPropertyElement SetProperty (string name, string unevaluatedValue)
{
var existing = Properties.Where (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)
&& p.Condition.Length == 0).FirstOrDefault ();
if (existing != null) {
existing.Value = unevaluatedValue;
return existing;
}
return AddProperty (name, unevaluatedValue);
}
internal ProjectPropertyGroupElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public ICollection<ProjectPropertyElement> Properties {
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
new FilteredEnumerable<ProjectPropertyElement> (Children)); }
}
public ICollection<ProjectPropertyElement> PropertiesReversed {
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
new FilteredEnumerable<ProjectPropertyElement> (ChildrenReversed)); }
}
internal override string XmlName {
get { return "PropertyGroup"; }
}
internal override ProjectElement LoadChildElement (string name)
{
return AddProperty (name, null);
}
}
}
@@ -0,0 +1,593 @@
//
// ProjectRootElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Collections.Generic;
using Microsoft.Build.Evaluation;
using Microsoft.Build.Internal;
using System.Text;
using System;
using System.Xml;
using System.IO;
using System.Linq;
using System.Globalization;
using Microsoft.Build.Exceptions;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute("{FullPath} #Children={Count} DefaultTargets={DefaultTargets} "
+ "ToolsVersion={ToolsVersion} InitialTargets={InitialTargets}")]
public class ProjectRootElement : ProjectElementContainer
{
public override string Condition { get { return null; } set { throw new InvalidOperationException (
"Can not set Condition."); } }
string defaultTargets;
public string DefaultTargets {
get { return defaultTargets ?? String.Empty; }
set { defaultTargets = value; }
}
string fullPath;
public string FullPath {
get { return fullPath; }
set {
fullPath = Path.GetFullPath (value);
DirectoryPath = Path.GetDirectoryName (fullPath);
}
}
string directoryPath;
public string DirectoryPath {
get { return directoryPath ?? String.Empty; }
internal set { directoryPath = value; }
}
public ICollection<ProjectPropertyElement> Properties {
get { return new CollectionFromEnumerable<ProjectPropertyElement> (
new FilteredEnumerable<ProjectPropertyElement> (AllChildren)); }
}
public ICollection<ProjectChooseElement> ChooseElements {
get { return new CollectionFromEnumerable<ProjectChooseElement> (
new FilteredEnumerable<ProjectChooseElement> (Children)); }
}
public Encoding Encoding {
get { return Encoding.UTF8; }
}
public bool HasUnsavedChanges {
get { return true; }
}
public ICollection<ProjectImportGroupElement> ImportGroups {
get { return new CollectionFromEnumerable<ProjectImportGroupElement> (
new FilteredEnumerable<ProjectImportGroupElement> (Children)); }
}
public ICollection<ProjectImportGroupElement> ImportGroupsReversed {
get { return new CollectionFromEnumerable<ProjectImportGroupElement> (
new FilteredEnumerable<ProjectImportGroupElement> (ChildrenReversed)); }
}
public ICollection<ProjectImportElement> Imports {
get { return new CollectionFromEnumerable<ProjectImportElement> (
new FilteredEnumerable<ProjectImportElement> (AllChildren)); }
}
string initialTargets;
public string InitialTargets {
get { return initialTargets ?? String.Empty; }
set { initialTargets = value; }
}
public ICollection<ProjectItemDefinitionGroupElement> ItemDefinitionGroups {
get { return new CollectionFromEnumerable<ProjectItemDefinitionGroupElement> (
new FilteredEnumerable<ProjectItemDefinitionGroupElement> (Children)); }
}
public ICollection<ProjectItemDefinitionGroupElement> ItemDefinitionGroupsReversed {
get { return new CollectionFromEnumerable<ProjectItemDefinitionGroupElement> (
new FilteredEnumerable<ProjectItemDefinitionGroupElement> (ChildrenReversed)); }
}
public ICollection<ProjectItemDefinitionElement> ItemDefinitions {
get { return new CollectionFromEnumerable<ProjectItemDefinitionElement> (
new FilteredEnumerable<ProjectItemDefinitionElement> (AllChildren)); }
}
public ICollection<ProjectItemGroupElement> ItemGroups {
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
}
public ICollection<ProjectItemGroupElement> ItemGroupsReversed {
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
new FilteredEnumerable<ProjectItemGroupElement> (ChildrenReversed)); }
}
public ICollection<ProjectItemElement> Items {
get { return new CollectionFromEnumerable<ProjectItemElement> (
new FilteredEnumerable<ProjectItemElement> (AllChildren)); }
}
public DateTime LastWriteTimeWhenRead {
get { return DateTime.MinValue; }
}
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
}
public ICollection<ProjectPropertyGroupElement> PropertyGroupsReversed {
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
new FilteredEnumerable<ProjectPropertyGroupElement> (ChildrenReversed)); }
}
public string RawXml {
get {
using (var writer = new StringWriter (CultureInfo.InvariantCulture)) {
Save (writer);
return writer.ToString ();
}
}
}
public ICollection<ProjectTargetElement> Targets {
get { return new CollectionFromEnumerable<ProjectTargetElement> (
new FilteredEnumerable<ProjectTargetElement> (Children)); }
}
public DateTime TimeLastChanged {
get { return DateTime.Now; }
}
string toolsVersion;
public string ToolsVersion {
get { return toolsVersion ?? "4.0"; }
set { toolsVersion = value; }
}
public ICollection<ProjectUsingTaskElement> UsingTasks {
get { return new CollectionFromEnumerable<ProjectUsingTaskElement> (
new FilteredEnumerable<ProjectUsingTaskElement> (Children)); }
}
public int Version {
get { return 0; }
}
ProjectRootElement (ProjectCollection projectCollection)
{
}
public static ProjectRootElement Create ()
{
return Create (ProjectCollection.GlobalProjectCollection);
}
public static ProjectRootElement Create (ProjectCollection projectCollection)
{
return new ProjectRootElement (projectCollection);
}
public static ProjectRootElement Create (string path)
{
return Create (path, ProjectCollection.GlobalProjectCollection);
}
public static ProjectRootElement Create (XmlReader xmlReader)
{
return Create (xmlReader, ProjectCollection.GlobalProjectCollection);
}
public static ProjectRootElement Create (string path, ProjectCollection projectCollection)
{
var result = Create (projectCollection);
result.FullPath = path;
return result;
}
public static ProjectRootElement Create (XmlReader xmlReader, ProjectCollection projectCollection)
{
// yes, this should create en empty project
var result = Create (projectCollection);
return result;
}
public ProjectImportElement AddImport (string project)
{
var import = CreateImportElement (project);
AppendChild (import);
return import;
}
public ProjectImportGroupElement AddImportGroup ()
{
var importGroup = CreateImportGroupElement ();
AppendChild (importGroup);
return importGroup;
}
public ProjectItemElement AddItem (string itemType, string include)
{
return AddItem (itemType, include, null);
}
public ProjectItemElement AddItem (string itemType, string include,
IEnumerable<KeyValuePair<string, string>> metadata)
{
var @group = ItemGroups.
Where (p => string.IsNullOrEmpty (p.Condition)
&& p.Items.Where (s => s.ItemType.Equals (itemType,
StringComparison.OrdinalIgnoreCase)).FirstOrDefault () != null).
FirstOrDefault ();
if (@group == null)
@group = AddItemGroup ();
return @group.AddItem (itemType, include, metadata);
}
public ProjectItemDefinitionElement AddItemDefinition (string itemType)
{
var @group = ItemDefinitionGroups.
Where (p => string.IsNullOrEmpty (p.Condition)
&& p.ItemDefinitions.Where (s => s.ItemType.Equals (itemType,
StringComparison.OrdinalIgnoreCase)).FirstOrDefault () != null).
FirstOrDefault ();
if (@group == null)
@group = AddItemDefinitionGroup ();
return @group.AddItemDefinition (itemType);
}
public ProjectItemDefinitionGroupElement AddItemDefinitionGroup ()
{
var @group = CreateItemDefinitionGroupElement ();
ProjectElementContainer last = ItemDefinitionGroupsReversed.FirstOrDefault ();
if (last == null)
last = PropertyGroupsReversed.FirstOrDefault ();
InsertAfterChild (@group, last);
return @group;
}
public ProjectItemGroupElement AddItemGroup ()
{
var @group = CreateItemGroupElement ();
ProjectElementContainer last = ItemGroupsReversed.FirstOrDefault ();
if (last == null)
last = PropertyGroupsReversed.FirstOrDefault ();
InsertAfterChild (@group, last);
return @group;
}
public ProjectPropertyElement AddProperty (string name, string value)
{
ProjectPropertyGroupElement parentGroup = null;
foreach (var @group in PropertyGroups) {
if (string.IsNullOrEmpty (@group.Condition)) {
if (parentGroup == null)
parentGroup = @group;
var property = @group.Properties.
Where (p => string.IsNullOrEmpty (p.Condition)
&& p.Name.Equals (name, StringComparison.OrdinalIgnoreCase)).
FirstOrDefault ();
if (property != null) {
property.Value = value;
return property;
}
}
}
if (parentGroup == null)
parentGroup = AddPropertyGroup ();
return parentGroup.AddProperty (name, value);
}
public ProjectPropertyGroupElement AddPropertyGroup ()
{
var @group = CreatePropertyGroupElement ();
var last = PropertyGroupsReversed.FirstOrDefault ();
InsertAfterChild (@group, last);
return @group;
}
public ProjectTargetElement AddTarget (string name)
{
var target = CreateTargetElement (name);
AppendChild (target);
return target;
}
public ProjectUsingTaskElement AddUsingTask (string name, string assemblyFile, string assemblyName)
{
var usingTask = CreateUsingTaskElement (name, assemblyFile, assemblyName);
AppendChild (usingTask);
return usingTask;
}
public ProjectChooseElement CreateChooseElement ()
{
return new ProjectChooseElement (this);
}
public ProjectImportElement CreateImportElement (string project)
{
return new ProjectImportElement (project, this);
}
public ProjectImportGroupElement CreateImportGroupElement ()
{
return new ProjectImportGroupElement (this);
}
public ProjectItemDefinitionElement CreateItemDefinitionElement (string itemType)
{
return new ProjectItemDefinitionElement (itemType, this);
}
public ProjectItemDefinitionGroupElement CreateItemDefinitionGroupElement ()
{
return new ProjectItemDefinitionGroupElement (this);
}
public ProjectItemElement CreateItemElement (string itemType)
{
return new ProjectItemElement (itemType, this);
}
public ProjectItemElement CreateItemElement (string itemType, string include)
{
var item = CreateItemElement (itemType);
item.Include = include;
return item;
}
public ProjectItemGroupElement CreateItemGroupElement ()
{
return new ProjectItemGroupElement (this);
}
public ProjectMetadataElement CreateMetadataElement (string name)
{
return new ProjectMetadataElement (name, this);
}
public ProjectMetadataElement CreateMetadataElement (string name, string unevaluatedValue)
{
var metadata = CreateMetadataElement (name);
metadata.Value = unevaluatedValue;
return metadata;
}
public ProjectOnErrorElement CreateOnErrorElement (string executeTargets)
{
return new ProjectOnErrorElement (executeTargets, this);
}
public ProjectOtherwiseElement CreateOtherwiseElement ()
{
return new ProjectOtherwiseElement (this);
}
public ProjectOutputElement CreateOutputElement (string taskParameter, string itemType,
string propertyName)
{
return new ProjectOutputElement (taskParameter, itemType, propertyName, this);
}
public ProjectExtensionsElement CreateProjectExtensionsElement ()
{
return new ProjectExtensionsElement (this);
}
public ProjectPropertyElement CreatePropertyElement (string name)
{
return new ProjectPropertyElement (name, this);
}
public ProjectPropertyGroupElement CreatePropertyGroupElement ()
{
return new ProjectPropertyGroupElement (this);
}
public ProjectTargetElement CreateTargetElement (string name)
{
return new ProjectTargetElement (name, this);
}
public ProjectTaskElement CreateTaskElement (string name)
{
return new ProjectTaskElement (name, this);
}
public ProjectUsingTaskBodyElement CreateUsingTaskBodyElement (string evaluate, string body)
{
return new ProjectUsingTaskBodyElement (evaluate, body, this);
}
public ProjectUsingTaskElement CreateUsingTaskElement (string taskName, string assemblyFile,
string assemblyName)
{
return new ProjectUsingTaskElement (taskName, assemblyFile, assemblyName, this);
}
public ProjectUsingTaskParameterElement CreateUsingTaskParameterElement (string name, string output,
string required,
string parameterType)
{
return new ProjectUsingTaskParameterElement (name, output, required, parameterType, this);
}
public UsingTaskParameterGroupElement CreateUsingTaskParameterGroupElement ()
{
return new UsingTaskParameterGroupElement (this);
}
public ProjectWhenElement CreateWhenElement (string condition)
{
return new ProjectWhenElement (condition, this);
}
public static ProjectRootElement Open (string path)
{
return Open (path, ProjectCollection.GlobalProjectCollection);
}
public static ProjectRootElement Open (string path, ProjectCollection projectCollection)
{
var result = Create (path, projectCollection);
using (var reader = XmlReader.Create (path))
result.Load (reader);
return result;
}
public void Save ()
{
Save (Encoding);
}
public void Save (Encoding saveEncoding)
{
using (var writer = new StreamWriter (File.Create (FullPath), saveEncoding)) {
Save (writer);
}
}
public void Save (string path)
{
Save (path, Encoding);
}
public void Save (TextWriter writer)
{
using (var xmlWriter = XmlWriter.Create (writer, new XmlWriterSettings { Indent = true,
NewLineChars = "\r\n" })) {
Save (xmlWriter);
}
}
public void Save (string path, Encoding encoding)
{
FullPath = path;
Save (encoding);
}
public static ProjectRootElement TryOpen (string path)
{
return TryOpen (path, ProjectCollection.GlobalProjectCollection);
}
public static ProjectRootElement TryOpen (string path, ProjectCollection projectCollection)
{
// this should be non-null only if the project is already cached
// and caching is not yet implemented
return null;
}
internal override void Load (XmlReader reader)
{
try {
base.Load (reader);
} catch (XmlException ex) {
throw new InvalidProjectFileException (FullPath, ex.LineNumber, ex.LinePosition, 0, 0,
ex.Message, null, null, null);
}
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "PropertyGroup":
var prop = CreatePropertyGroupElement ();
AppendChild (prop);
return prop;
case "ItemGroup":
var item = CreateItemGroupElement ();
AppendChild (item);
return item;
case "Import":
return AddImport (null);
case "Target":
return AddTarget (null);
case "ItemDefinitionGroup":
var def = CreateItemDefinitionGroupElement ();
AppendChild (def);
return def;
case "UsingTask":
return AddUsingTask (null, null, null);
case "Choose":
var choose = CreateChooseElement ();
AppendChild (choose);
return choose;
case "ProjectExtensions":
var ext = CreateProjectExtensionsElement ();
AppendChild (ext);
return ext;
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "ToolsVersion":
ToolsVersion = value;
break;
case "DefaultTargets":
DefaultTargets = value;
break;
case "InitialTargets":
InitialTargets = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override void Save (XmlWriter writer)
{
writer.WriteStartElement (XmlName, "http://schemas.microsoft.com/developer/msbuild/2003");
SaveValue (writer);
writer.WriteEndElement ();
}
internal override void SaveValue (XmlWriter writer)
{
SaveAttribute (writer, "ToolsVersion", ToolsVersion);
SaveAttribute (writer, "DefaultTargets", DefaultTargets);
SaveAttribute (writer, "InitialTargets", InitialTargets);
base.SaveValue (writer);
}
internal override string XmlName {
get { return "Project"; }
}
}
}
@@ -0,0 +1,174 @@
//
// ProjectTargetElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("Name={Name} #Children={Count} Condition={Condition}")]
public class ProjectTargetElement : ProjectElementContainer
{
internal ProjectTargetElement (string name, ProjectRootElement containingProject)
: this(containingProject)
{
Name = name;
}
internal ProjectTargetElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
string afterTargets;
public string AfterTargets {
get { return afterTargets ?? String.Empty; }
set { afterTargets = value; }
}
string beforeTargets;
public string BeforeTargets {
get { return beforeTargets ?? String.Empty; }
set { beforeTargets = value; }
}
string dependsOnTargets;
public string DependsOnTargets {
get { return dependsOnTargets ?? String.Empty; }
set { dependsOnTargets = value; }
}
string inputs;
public string Inputs { get { return inputs ?? String.Empty; } set { inputs = value; } }
public ICollection<ProjectItemGroupElement> ItemGroups {
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
}
string keepDuplicateOutputs;
public string KeepDuplicateOutputs {
get { return keepDuplicateOutputs ?? String.Empty; }
set { keepDuplicateOutputs = value; }
}
string name;
public string Name { get { return name ?? String.Empty; } set { name = value; } }
public ICollection<ProjectOnErrorElement> OnErrors {
get { return new CollectionFromEnumerable<ProjectOnErrorElement> (
new FilteredEnumerable<ProjectOnErrorElement> (Children)); }
}
string outputs;
public string Outputs { get { return outputs ?? String.Empty; } set { outputs = value; } }
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
}
string returns;
public string Returns { get { return returns ?? String.Empty; } set { returns = value; } }
public ICollection<ProjectTaskElement> Tasks {
get { return new CollectionFromEnumerable<ProjectTaskElement> (
new FilteredEnumerable<ProjectTaskElement> (Children)); }
}
public ProjectItemGroupElement AddItemGroup ()
{
var item = ContainingProject.CreateItemGroupElement ();
AppendChild (item);
return item;
}
public ProjectPropertyGroupElement AddPropertyGroup ()
{
var property = ContainingProject.CreatePropertyGroupElement ();
AppendChild (property);
return property;
}
public ProjectTaskElement AddTask (string taskName)
{
var task = ContainingProject.CreateTaskElement (taskName);
AppendChild (task);
return task;
}
internal override string XmlName {
get { return "Target"; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "OnError":
var error = new ProjectOnErrorElement (ContainingProject);
AppendChild (error);
return error;
case "PropertyGroup":
return AddPropertyGroup ();
case "ItemGroup":
return AddItemGroup ();
default:
return AddTask (name);
}
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "Name":
Name = value;
break;
case "DependsOnTargets":
DependsOnTargets = value;
break;
case "Returns":
Returns = value;
break;
case "Inputs":
Inputs = value;
break;
case "Outputs":
Outputs = value;
break;
case "BeforeTargets":
BeforeTargets = value;
break;
case "AfterTargets":
AfterTargets = value;
break;
case "KeepDuplicateOutputs":
KeepDuplicateOutputs = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override void SaveValue (System.Xml.XmlWriter writer)
{
SaveAttribute (writer, "Name", Name);
SaveAttribute (writer, "DependsOnTargets", DependsOnTargets);
SaveAttribute (writer, "Returns", Returns);
SaveAttribute (writer, "Inputs", Inputs);
SaveAttribute (writer, "Outputs", Outputs);
SaveAttribute (writer, "BeforeTargets", BeforeTargets);
SaveAttribute (writer, "AfterTargets", AfterTargets);
SaveAttribute (writer, "KeepDuplicateOutputs", KeepDuplicateOutputs);
base.SaveValue (writer);
}
}
}
@@ -0,0 +1,153 @@
//
// ProjectTaskElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using System.Xml;
using Microsoft.Build.Exceptions;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("{Name} Condition={Condition} ContinueOnError={ContinueOnError} "
+ "#Outputs={Count}")]
public class ProjectTaskElement : ProjectElementContainer
{
internal ProjectTaskElement (string taskName, ProjectRootElement containingProject)
: this(containingProject)
{
Name = taskName;
}
internal ProjectTaskElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
string continueOnError;
public string ContinueOnError {
get { return continueOnError ?? String.Empty; }
set { continueOnError = value; }
}
string name;
public string Name { get { return name ?? String.Empty; } private set { name = value; } }
public ICollection<ProjectOutputElement> Outputs {
get { return new CollectionFromEnumerable<ProjectOutputElement> (
new FilteredEnumerable<ProjectOutputElement> (AllChildren)); }
}
public IDictionary<string, string> Parameters {
get { return parameters; }
}
public ProjectOutputElement AddOutputItem (string taskParameter, string itemType)
{
return AddOutputItem (taskParameter, itemType, null);
}
public ProjectOutputElement AddOutputItem (string taskParameter, string itemType, string condition)
{
var output = new ProjectOutputElement (taskParameter, itemType, null, ContainingProject);
if( condition != null)
output.Condition = condition;
AppendChild (output);
return output;
}
public ProjectOutputElement AddOutputProperty (string taskParameter, string propertyName)
{
return AddOutputProperty (taskParameter, propertyName, null);
}
public ProjectOutputElement AddOutputProperty (string taskParameter, string propertyName,
string condition)
{
var output = new ProjectOutputElement (taskParameter, null, propertyName, ContainingProject);
if( condition != null)
output.Condition = condition;
AppendChild (output);
return output;
}
public string GetParameter (string name)
{
string value;
if (parameters.TryGetValue (name, out value))
return value;
return string.Empty;
}
public void RemoveAllParameters ()
{
parameters.Clear ();
}
public void RemoveParameter (string name)
{
parameters.Remove (name);
}
public void SetParameter (string name, string unevaluatedValue)
{
parameters[name] = unevaluatedValue;
}
internal override string XmlName {
get { return Name; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "Output":
var output = ContainingProject.CreateOutputElement (null, null, null);
AppendChild (output);
return output;
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "ContinueOnError":
ContinueOnError = value;
break;
case "xmlns":
break;
case "Label":
Label = value;
break;
case "Condition":
Condition = value;
break;
default:
SetParameter (name, value);
break;
}
}
internal override void SaveValue (XmlWriter writer)
{
SaveAttribute (writer, "ContinueOnError", ContinueOnError);
foreach (var parameter in parameters) {
SaveAttribute (writer, parameter.Key, parameter.Value);
}
base.SaveValue (writer);
}
private Dictionary<string, string> parameters = new Dictionary<string, string> ();
}
}
@@ -0,0 +1,75 @@
//
// ProjectUsingTaskBodyElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("Evaluate={Evaluate} TaskBody={TaskBody}")]
public class ProjectUsingTaskBodyElement : ProjectElement
{
internal ProjectUsingTaskBodyElement (string evaluate, string body, ProjectRootElement containingProject)
{
Evaluate = evaluate;
TaskBody = body;
ContainingProject = containingProject;
}
string evaluate;
public string Evaluate { get { return evaluate ?? String.Empty; } set { evaluate = value; } }
public override string Condition { get { return null; } set { throw new InvalidOperationException (
"Can not set Condition."); } }
string taskBody;
public string TaskBody { get { return taskBody ?? String.Empty; } set { taskBody = value; } }
internal override string XmlName {
get { return "Task"; }
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
SaveAttribute (writer, "Evaluate", Evaluate);
if (!string.IsNullOrWhiteSpace (TaskBody))
writer.WriteRaw (TaskBody);
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "Evaluate":
Evaluate = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override void LoadValue (XmlReader reader)
{
reader.MoveToElement ();
TaskBody = reader.ReadInnerXml ();
}
}
}
@@ -0,0 +1,123 @@
//
// ProjectUsingTaskElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Exceptions;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("TaskName={TaskName} AssemblyName={AssemblyName} "
+ "AssemblyFile={AssemblyFile} Condition={Condition} "
+ "Runtime={RequiredRuntime} Platform={RequiredPlatform}")]
public class ProjectUsingTaskElement : ProjectElementContainer
{
internal ProjectUsingTaskElement (string taskName, string assemblyFile, string assemblyName,
ProjectRootElement containingProject)
{
TaskName = taskName;
AssemblyFile = assemblyFile;
AssemblyName = assemblyName;
ContainingProject = containingProject;
}
string assemblyFile;
public string AssemblyFile {
get { return assemblyFile ?? String.Empty; }
set { assemblyFile = value; }
}
string assemblyName;
public string AssemblyName {
get { return assemblyName ?? String.Empty; }
set { assemblyName = value; }
}
public UsingTaskParameterGroupElement ParameterGroup {
get { return FirstChild as UsingTaskParameterGroupElement; }
}
public ProjectUsingTaskBodyElement TaskBody {
get { return LastChild as ProjectUsingTaskBodyElement; }
}
string taskFactory;
public string TaskFactory { get { return taskFactory ?? String.Empty; } set { taskFactory = value; } }
string taskName;
public string TaskName { get { return taskName ?? String.Empty; } set { taskName = value; } }
public UsingTaskParameterGroupElement AddParameterGroup ()
{
var @group = ContainingProject.CreateUsingTaskParameterGroupElement ();
PrependChild (@group);
return @group;
}
public ProjectUsingTaskBodyElement AddUsingTaskBody (string evaluate, string taskBody)
{
var body = ContainingProject.CreateUsingTaskBodyElement (evaluate, taskBody);
AppendChild (body);
return body;
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "AssemblyName":
AssemblyName = value;
break;
case "AssemblyFile":
AssemblyFile = value;
break;
case "TaskFactory":
TaskFactory = value;
break;
case "TaskName":
TaskName = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override void SaveValue (System.Xml.XmlWriter writer)
{
SaveAttribute (writer, "AssemblyName", AssemblyName);
SaveAttribute (writer, "AssemblyFile", AssemblyFile);
SaveAttribute (writer, "TaskFactory", TaskFactory);
SaveAttribute (writer, "TaskName", TaskName);
base.SaveValue (writer);
}
internal override string XmlName {
get { return "UsingTask"; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "ParameterGroup":
return AddParameterGroup ();
case "Task":
return AddUsingTaskBody (null, null);
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
}
}
@@ -0,0 +1,86 @@
//
// ProjectUsingTaskParameterElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Xml;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("Name={Name} ParameterType={ParameterType} Output={Output}")]
public class ProjectUsingTaskParameterElement : ProjectElement
{
internal ProjectUsingTaskParameterElement (string name, string output, string required,
string parameterType, ProjectRootElement containingProject)
{
Name = name;
Output = output;
Required = required;
ParameterType = parameterType;
ContainingProject = containingProject;
}
string name;
public string Name { get { return name ?? String.Empty; } set { name = value; } }
public override string Condition { get { return null; } set { throw new InvalidOperationException (
"Can not set Condition."); } }
string output;
public string Output { get { return output ?? String.Empty; } set { output = value; } }
string parameterType;
public string ParameterType {
get { return parameterType ?? String.Empty; }
set { parameterType = value; }
}
string required;
public string Required { get { return required ?? String.Empty; } set { required = value; } }
internal override string XmlName {
get { return Name; }
}
internal override void LoadAttribute (string name, string value)
{
switch (name) {
case "ParameterType":
ParameterType = value;
break;
case "Output":
Output = value;
break;
case "Required":
Required = value;
break;
default:
base.LoadAttribute (name, value);
break;
}
}
internal override void SaveValue (XmlWriter writer)
{
base.SaveValue (writer);
SaveAttribute (writer, "ParameterType", ParameterType);
SaveAttribute (writer, "Required", Required);
SaveAttribute (writer, "Output", Output);
}
}
}
@@ -0,0 +1,81 @@
//
// ProjectWhenElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Exceptions;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Children={Count} Condition={Condition}")]
public class ProjectWhenElement : ProjectElementContainer
{
internal ProjectWhenElement (string condition, ProjectRootElement containingProject)
{
Condition = condition;
ContainingProject = containingProject;
}
public ICollection<ProjectPropertyGroupElement> PropertyGroups {
get { return new CollectionFromEnumerable<ProjectPropertyGroupElement> (
new FilteredEnumerable<ProjectPropertyGroupElement> (Children)); }
}
public ICollection<ProjectItemGroupElement> ItemGroups {
get { return new CollectionFromEnumerable<ProjectItemGroupElement> (
new FilteredEnumerable<ProjectItemGroupElement> (Children)); }
}
public ICollection<ProjectChooseElement> ChooseElements {
get { return new CollectionFromEnumerable<ProjectChooseElement> (
new FilteredEnumerable<ProjectChooseElement> (Children));}
}
internal override string XmlName {
get { return "When"; }
}
internal override ProjectElement LoadChildElement (string name)
{
switch (name) {
case "PropertyGroup":
var property = ContainingProject.CreatePropertyGroupElement ();
AppendChild (property);
return property;
case "ItemGroup":
var item = ContainingProject.CreateItemGroupElement ();
AppendChild (item);
return item;
case "When":
var when = ContainingProject.CreateWhenElement (null);
AppendChild (when);
return when;
default:
throw new InvalidProjectFileException (string.Format (
"Child \"{0}\" is not a known node type.", name));
}
}
}
}
@@ -0,0 +1,69 @@
//
// UsingTaskParameterGroupElement.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using Microsoft.Build.Internal;
namespace Microsoft.Build.Construction
{
[System.Diagnostics.DebuggerDisplayAttribute ("#Parameters={Count}")]
public class UsingTaskParameterGroupElement : ProjectElementContainer
{
internal UsingTaskParameterGroupElement (ProjectRootElement containingProject)
{
ContainingProject = containingProject;
}
public override string Condition { get { return null; } set { throw new InvalidOperationException(
"Can not set Condition."); } }
public ICollection<ProjectUsingTaskParameterElement> Parameters {
get { return new CollectionFromEnumerable<ProjectUsingTaskParameterElement> (
new FilteredEnumerable<ProjectUsingTaskParameterElement> (Children)); }
}
public ProjectUsingTaskParameterElement AddParameter (string name)
{
return AddParameter (name, null, null, null);
}
public ProjectUsingTaskParameterElement AddParameter (string name, string output, string required,
string parameterType)
{
var parameter = ContainingProject.CreateUsingTaskParameterElement (name, output, required,
parameterType);
AppendChild (parameter);
return parameter;
}
internal override string XmlName {
get { return "ParameterGroup"; }
}
internal override ProjectElement LoadChildElement (string name)
{
return AddParameter (name);
}
}
}
@@ -0,0 +1,396 @@
//
// Project.cs
//
// Author:
// Leszek Ciesielski ([email protected])
// Rolf Bjarne Kvinge ([email protected])
//
// (C) 2011 Leszek Ciesielski
// Copyright (C) 2011 Xamarin Inc. (http://www.xamarin.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.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Construction;
using Microsoft.Build.Internal;
using Microsoft.Build.Execution;
using Microsoft.Build.Framework;
using Microsoft.Build.Logging;
namespace Microsoft.Build.Evaluation
{
[DebuggerDisplay("{FullPath} EffectiveToolsVersion={ToolsVersion} #GlobalProperties="
+"{data.globalProperties.Count} #Properties={data.Properties.Count} #ItemTypes="
+"{data.ItemTypes.Count} #ItemDefinitions={data.ItemDefinitions.Count} #Items="
+"{data.Items.Count} #Targets={data.Targets.Count}")]
public class Project
{
public Project (ProjectRootElement xml) : this(xml, null, null)
{
}
public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties,
string toolsVersion)
: this(xml, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
{
}
public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
: this(xml, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default)
{
}
public Project (ProjectRootElement xml, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings)
{
ProjectCollection = projectCollection;
Xml = xml;
GlobalProperties = globalProperties;
ToolsVersion = toolsVersion;
}
public Project (string projectFile) : this(projectFile, null, null)
{
}
public Project (string projectFile, IDictionary<string, string> globalProperties,
string toolsVersion)
: this(projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection, ProjectLoadSettings.Default)
{
}
public Project (string projectFile, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
: this(projectFile, globalProperties, toolsVersion, projectCollection, ProjectLoadSettings.Default)
{
}
public Project (string projectFile, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings)
{
throw new NotImplementedException ();
}
public IDictionary<string, string> GlobalProperties { get; private set; }
public ProjectCollection ProjectCollection { get; private set; }
public string ToolsVersion { get; private set; }
public ProjectRootElement Xml { get; private set; }
public ICollection<ProjectItem> GetItemsIgnoringCondition (string itemType)
{
return new CollectionFromEnumerable<ProjectItem> (
new FilteredEnumerable<ProjectItemElement> (Xml.Items).
Where (p => p.ItemType.Equals (itemType, StringComparison.OrdinalIgnoreCase)).
Select (p => new ProjectItem(p)));
}
public void RemoveItems (IEnumerable<ProjectItem> items)
{
var removal = new List<ProjectItem> (items);
foreach (var item in removal) {
var parent = item.Xml.Parent;
parent.RemoveChild (item.Xml);
if (parent.Count == 0)
parent.Parent.RemoveChild (parent);
}
}
public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude)
{
throw new NotImplementedException ();
}
public IList<ProjectItem> AddItem (string itemType, string unevaluatedInclude,
IEnumerable<KeyValuePair<string, string>> metadata)
{
throw new NotImplementedException ();
}
public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude)
{
throw new NotImplementedException ();
}
public IList<ProjectItem> AddItemFast (string itemType, string unevaluatedInclude,
IEnumerable<KeyValuePair<string, string>> metadata)
{
throw new NotImplementedException ();
}
public bool Build ()
{
throw new NotImplementedException ();
}
public bool Build (IEnumerable<ILogger> loggers)
{
throw new NotImplementedException ();
}
public bool Build (string target)
{
throw new NotImplementedException ();
}
public bool Build (string[] targets)
{
throw new NotImplementedException ();
}
public bool Build (ILogger logger)
{
throw new NotImplementedException ();
}
public bool Build (string[] targets, IEnumerable<ILogger> loggers)
{
throw new NotImplementedException ();
}
public bool Build (IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers)
{
throw new NotImplementedException ();
}
public bool Build (string target, IEnumerable<ILogger> loggers)
{
throw new NotImplementedException ();
}
public bool Build (string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers)
{
throw new NotImplementedException ();
}
public bool Build (string target, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers)
{
throw new NotImplementedException ();
}
public ProjectInstance CreateProjectInstance ()
{
throw new NotImplementedException ();
}
public string ExpandString (string unexpandedValue)
{
throw new NotImplementedException ();
}
public static string GetEvaluatedItemIncludeEscaped (ProjectItem item)
{
throw new NotImplementedException ();
}
public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinition item)
{
throw new NotImplementedException ();
}
public ICollection<ProjectItem> GetItems (string itemType)
{
throw new NotImplementedException ();
}
public ICollection<ProjectItem> GetItemsByEvaluatedInclude (string evaluatedInclude)
{
throw new NotImplementedException ();
}
public IEnumerable<ProjectElement> GetLogicalProject ()
{
throw new NotImplementedException ();
}
public static string GetMetadataValueEscaped (ProjectMetadata metadatum)
{
throw new NotImplementedException ();
}
public static string GetMetadataValueEscaped (ProjectItem item, string name)
{
throw new NotImplementedException ();
}
public static string GetMetadataValueEscaped (ProjectItemDefinition item, string name)
{
throw new NotImplementedException ();
}
public string GetPropertyValue (string name)
{
throw new NotImplementedException ();
}
public static string GetPropertyValueEscaped (ProjectProperty property)
{
throw new NotImplementedException ();
}
public ProjectProperty GetProperty (string name)
{
throw new NotImplementedException ();
}
public void MarkDirty ()
{
throw new NotImplementedException ();
}
public void ReevaluateIfNecessary ()
{
throw new NotImplementedException ();
}
public bool RemoveGlobalProperty (string name)
{
throw new NotImplementedException ();
}
public bool RemoveItem (ProjectItem item)
{
throw new NotImplementedException ();
}
public bool RemoveProperty (ProjectProperty property)
{
throw new NotImplementedException ();
}
public void Save ()
{
throw new NotImplementedException ();
}
public void Save (TextWriter writer)
{
throw new NotImplementedException ();
}
public void Save (string path)
{
throw new NotImplementedException ();
}
public void Save (Encoding encoding)
{
throw new NotImplementedException ();
}
public void Save (string path, Encoding encoding)
{
throw new NotImplementedException ();
}
public void SaveLogicalProject (TextWriter writer)
{
throw new NotImplementedException ();
}
public bool SetGlobalProperty (string name, string escapedValue)
{
throw new NotImplementedException ();
}
public ProjectProperty SetProperty (string name, string unevaluatedValue)
{
throw new NotImplementedException ();
}
public ICollection<ProjectMetadata> AllEvaluatedItemDefinitionMetadata {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectItem> AllEvaluatedItems {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectProperty> AllEvaluatedProperties {
get { throw new NotImplementedException (); }
}
public IDictionary<string, List<string>> ConditionedProperties {
get { throw new NotImplementedException (); }
}
public string DirectoryPath {
get { throw new NotImplementedException (); }
}
public bool DisableMarkDirty { get; set; }
public int EvaluationCounter {
get { throw new NotImplementedException (); }
}
public string FullPath {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public IList<ResolvedImport> Imports {
get { throw new NotImplementedException (); }
}
public IList<ResolvedImport> ImportsIncludingDuplicates {
get { throw new NotImplementedException (); }
}
public bool IsBuildEnabled {
get { throw new NotImplementedException (); }
}
public bool IsDirty {
get { throw new NotImplementedException (); }
}
public IDictionary<string, ProjectItemDefinition> ItemDefinitions {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectItem> Items {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectItem> ItemsIgnoringCondition {
get { throw new NotImplementedException (); }
}
public ICollection<string> ItemTypes {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectProperty> Properties {
get { throw new NotImplementedException (); }
}
public bool SkipEvaluation { get; set; }
public IDictionary<string, ProjectTargetInstance> Targets {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,101 @@
//
// ProjectCollection.cs
//
// Author:
// Leszek Ciesielski ([email protected])
// Rolf Bjarne Kvinge ([email protected])
//
// (C) 2011 Leszek Ciesielski
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using Microsoft.Build.Logging;
using System;
using System.Collections.Generic;
namespace Microsoft.Build.Evaluation
{
public class ProjectCollection : IDisposable
{
public ProjectCollection ()
{
}
public ProjectCollection (IDictionary<string, string> globalProperties)
: this (globalProperties, null, ToolsetDefinitionLocations.Registry | ToolsetDefinitionLocations.ConfigurationFile)
{
}
public ProjectCollection (ToolsetDefinitionLocations toolsetDefinitionLocations)
: this (null, null, toolsetDefinitionLocations)
{
}
public ProjectCollection (IDictionary<string, string> globalProperties, IEnumerable<ILogger> loggers,
ToolsetDefinitionLocations toolsetDefinitionLocations)
: this (globalProperties, loggers, null, toolsetDefinitionLocations, 1, false)
{
}
public ProjectCollection (IDictionary<string, string> globalProperties,
IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers,
ToolsetDefinitionLocations toolsetDefinitionLocations,
int maxNodeCount, bool onlyLogCriticalEvents)
{
throw new NotImplementedException ();
}
public static string Escape (string unescapedString)
{
return unescapedString;
}
public static ProjectCollection GlobalProjectCollection {
get { return globalProjectCollection; }
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (disposing) {
}
}
static ProjectCollection globalProjectCollection = new ProjectCollection ();
public ICollection<Project> GetLoadedProjects (string fullPath)
{
throw new NotImplementedException ();
}
public ToolsetDefinitionLocations ToolsetLocations {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,116 @@
//
// ProjectItem.cs
//
// Author:
// Leszek Ciesielski ([email protected])
// Rolf Bjarne Kvinge ([email protected])
//
// (C) 2011 Leszek Ciesielski
// Copyright (C) 2011 Xamarin Inc.
//
// 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.Diagnostics;
using Microsoft.Build.Construction;
namespace Microsoft.Build.Evaluation
{
[DebuggerDisplay("{ItemType}={EvaluatedInclude} [{UnevaluatedInclude}] #DirectMetadata={DirectMetadataCount}")]
public class ProjectItem
{
internal ProjectItem (ProjectItemElement xml)
{
Xml = xml;
}
public ProjectMetadata GetMetadata (string name)
{
throw new NotImplementedException ();
}
public string GetMetadataValue (string name)
{
throw new NotImplementedException ();
}
public bool HasMetadata (string name)
{
throw new NotImplementedException ();
}
public bool RemoveMetadata (string name)
{
throw new NotImplementedException ();
}
public void Rename (string name)
{
throw new NotImplementedException ();
}
public void SetMetadataValue (string name, string unevaluatedValue)
{
throw new NotImplementedException ();
}
public IEnumerable<ProjectMetadata> DirectMetadata {
get { throw new NotImplementedException (); }
}
public int DirectMetadataCount {
get { throw new NotImplementedException (); }
}
public string EvaluatedInclude {
get { throw new NotImplementedException (); }
}
public bool IsImported {
get { throw new NotImplementedException (); }
}
public string ItemType {
get { throw new NotImplementedException (); }
}
public ICollection<ProjectMetadata> Metadata {
get { throw new NotImplementedException (); }
}
public int MetadataCount {
get { throw new NotImplementedException (); }
}
public Project Project {
get { throw new NotImplementedException (); }
}
public string UnevaluatedInclude {
get { throw new NotImplementedException (); }
}
public ProjectItemElement Xml { get; private set; }
}
}
@@ -0,0 +1,40 @@
// ProjectItemDefinition.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Evaluation
{
public class ProjectItemDefinition
{
private ProjectItemDefinition ()
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,41 @@
//
// ProjectLoadSettings.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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;
namespace Microsoft.Build.Evaluation
{
[Flags]
public enum ProjectLoadSettings
{
Default = 0,
IgnoreMissingImports = 1,
RecordDuplicateButNotCircularImports = 2,
RejectCircularImports = 4
}
}
@@ -0,0 +1,74 @@
// Toolset.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using System;
namespace Microsoft.Build.Evaluation
{
public class ProjectMetadata
{
private ProjectMetadata ()
{
throw new NotImplementedException ();
}
public string EvaluatedValue {
get { throw new NotImplementedException (); }
}
public bool IsImported {
get { throw new NotImplementedException (); }
}
public string ItemType {
get { throw new NotImplementedException (); }
}
public string Name {
get { throw new NotImplementedException (); }
}
public ProjectMetadata Predecessor {
get { throw new NotImplementedException (); }
}
public Project Project {
get { throw new NotImplementedException (); }
}
public string UnevaluatedValue {
get { throw new NotImplementedException (); }
}
public ProjectMetadataElement Xml {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,41 @@
// ProjectProperty.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Evaluation
{
public class ProjectProperty
{
public string EvaluatedValue {
get {
throw new NotImplementedException ();
}
}
}
}
@@ -0,0 +1,49 @@
// ResolvedImport.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using System;
namespace Microsoft.Build.Evaluation
{
[System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct ResolvedImport
{
private ProjectImportElement import;
private ProjectRootElement root;
public ProjectImportElement ImportingElement {
get { return import; }
}
public ProjectRootElement ImportedProject {
get { return root; }
}
}
}
@@ -0,0 +1,63 @@
// Toolset.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Execution;
namespace Microsoft.Build.Evaluation
{
public class Toolset
{
public Toolset (string toolsVersion, string toolsPath,
ProjectCollection projectCollection, string msbuildOverrideTasksPath)
{
throw new NotImplementedException ();
}
public Toolset (string toolsVersion, string toolsPath,
IDictionary<string, string> buildProperties, ProjectCollection projectCollection,
string msbuildOverrideTasksPath)
{
throw new NotImplementedException ();
}
public IDictionary<string, ProjectPropertyInstance> Properties {
get { throw new NotImplementedException (); }
}
public string ToolsPath {
get { throw new NotImplementedException (); }
}
public string ToolsVersion {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,40 @@
// ToolsetDefinitionLocations.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Evaluation
{
[Flags ()]
public enum ToolsetDefinitionLocations
{
None,
ConfigurationFile,
Registry,
}
}
@@ -0,0 +1,94 @@
//
// InvalidProjectFileException.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Runtime.Serialization;
namespace Microsoft.Build.Exceptions
{
[Serializable]
public sealed class InvalidProjectFileException : Exception
{
public InvalidProjectFileException ()
{
}
public InvalidProjectFileException (string message) : base(message)
{
}
private InvalidProjectFileException (SerializationInfo info, StreamingContext context)
: base(info, context)
{
ProjectFile = info.GetString ("projectFile");
LineNumber = info.GetInt32 ("lineNumber");
ColumnNumber = info.GetInt32 ("columnNumber");
EndLineNumber = info.GetInt32 ("endLineNumber");
EndColumnNumber = info.GetInt32 ("endColumnNumber");
ErrorSubcategory = info.GetString ("errorSubcategory");
ErrorCode = info.GetString ("errorCode");
HelpKeyword = info.GetString ("helpKeyword");
HasBeenLogged = info.GetBoolean ("hasBeenLogged");
}
public InvalidProjectFileException (string message, Exception innerException)
: base(message, innerException)
{
}
public InvalidProjectFileException (string projectFile, int lineNumber, int columnNumber,
int endLineNumber, int endColumnNumber, string message,
string errorSubcategory, string errorCode, string helpKeyword)
{
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
info.AddValue ("projectFile", ProjectFile);
info.AddValue ("lineNumber", LineNumber);
info.AddValue ("columnNumber", ColumnNumber);
info.AddValue ("endLineNumber", EndLineNumber);
info.AddValue ("endColumnNumber", EndColumnNumber);
info.AddValue ("errorSubcategory", ErrorSubcategory);
info.AddValue ("errorCode", ErrorCode);
info.AddValue ("helpKeyword", HelpKeyword);
info.AddValue ("hasBeenLogged", HasBeenLogged);
}
public string BaseMessage {
get { return base.Message; }
}
public int ColumnNumber { get; private set; }
public int EndColumnNumber { get; private set; }
public int EndLineNumber { get; private set; }
public string ErrorCode { get; private set; }
public string ErrorSubcategory { get; private set; }
public bool HasBeenLogged { get; private set; }
public string HelpKeyword { get; private set; }
public int LineNumber { get; private set; }
public override string Message {
get { return ProjectFile == null ? base.Message : base.Message + " " + ProjectFile; }
}
public string ProjectFile { get; private set; }
}
}
@@ -0,0 +1,91 @@
// BuildManager.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Evaluation;
using System;
namespace Microsoft.Build.Execution
{
public class BuildManager
{
public BuildManager ()
{
throw new NotImplementedException ();
}
public BuildManager (string hostName)
{
throw new NotImplementedException ();
}
public void BeginBuild (BuildParameters parameters)
{
throw new NotImplementedException ();
}
public BuildResult Build (BuildParameters parameters, BuildRequestData requestData)
{
throw new NotImplementedException ();
}
public BuildResult BuildRequest (BuildRequestData requestData)
{
throw new NotImplementedException ();
}
public void CancelAllSubmissions ()
{
throw new NotImplementedException ();
}
public void EndBuild ()
{
throw new NotImplementedException ();
}
public ProjectInstance GetProjectInstanceForBuild (Project project)
{
throw new NotImplementedException ();
}
public BuildSubmission PendBuildRequest (BuildRequestData requestData)
{
throw new NotImplementedException ();
}
public void ResetCaches ()
{
throw new NotImplementedException ();
}
public static BuildManager DefaultBuildManager {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,159 @@
// BuildParameters.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Evaluation;
using Microsoft.Build.Framework;
using Microsoft.Build.Logging;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
namespace Microsoft.Build.Execution
{
public class BuildParameters
{
public BuildParameters ()
{
throw new NotImplementedException ();
}
public BuildParameters (ProjectCollection projectCollection)
{
throw new NotImplementedException ();
}
public BuildParameters Clone ()
{
throw new NotImplementedException ();
}
public Toolset GetToolset (string toolsVersion)
{
throw new NotImplementedException ();
}
public ThreadPriority BuildThreadPriority {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public CultureInfo Culture {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public string DefaultToolsVersion {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool DetailedSummary {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool EnableNodeReuse {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public IDictionary<string, string> EnvironmentProperties {
get { throw new NotImplementedException (); }
}
public IEnumerable<ForwardingLoggerRecord> ForwardingLoggers {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public IDictionary<string, string> GlobalProperties {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public HostServices HostServices {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool LegacyThreadingSemantics { get; set; }
public IEnumerable<ILogger> Loggers {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public int MaxNodeCount {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public int MemoryUseLimit {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public string NodeExeLocation {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool OnlyLogCriticalEvents {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool ResetCaches { get; set; }
public bool SaveOperatingEnvironment {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public ToolsetDefinitionLocations ToolsetDefinitionLocations {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public ICollection<Toolset> Toolsets {
get { throw new NotImplementedException (); }
}
public CultureInfo UICulture {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool UseSynchronousLogging {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,76 @@
//
// BuildRequestData.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public class BuildRequestData
{
public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild)
: this (projectInstance, targetsToBuild, null, BuildRequestDataFlags.None)
{
}
public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices)
: this (projectInstance, targetsToBuild, hostServices, BuildRequestDataFlags.None)
{
}
public BuildRequestData (ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices,
BuildRequestDataFlags flags)
{
throw new NotImplementedException ();
}
public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties,
string toolsVersion, string[] targetsToBuild, HostServices hostServices)
: this (projectFullPath, globalProperties, toolsVersion, targetsToBuild, hostServices, BuildRequestDataFlags.None)
{
}
public BuildRequestData (string projectFullPath, IDictionary<string, string> globalProperties,
string toolsVersion, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags)
{
throw new NotImplementedException ();
}
public string ExplicitlySpecifiedToolsVersion { get; private set; }
public BuildRequestDataFlags Flags { get; private set; }
public HostServices HostServices { get; private set; }
public string ProjectFullPath { get; private set; }
public ProjectInstance ProjectInstance { get; private set; }
public ICollection<string> TargetNames { get; private set; }
ICollection<ProjectPropertyInstance> GlobalProperties {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,40 @@
//
// BuildRequestDataFlags.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
[Flags]
public enum BuildRequestDataFlags
{
None,
ReplaceExistingProjectInstance,
}
}
@@ -0,0 +1,93 @@
// BuildResult.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public class BuildResult
{
public void AddResultsForTarget (string target, TargetResult result)
{
throw new NotImplementedException ();
}
public bool HasResultsForTarget (string target)
{
throw new NotImplementedException ();
}
public void MergeResults (BuildResult results)
{
throw new NotImplementedException ();
}
public bool CircularDependency {
get { throw new NotImplementedException (); }
}
public int ConfigurationId {
get { throw new NotImplementedException (); }
}
public Exception Exception {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public int GlobalRequestId {
get { throw new NotImplementedException (); }
}
public ITargetResult this [string target] {
get { throw new NotImplementedException (); }
}
public int NodeRequestId {
get { throw new NotImplementedException (); }
}
public BuildResultCode OverallResult {
get { throw new NotImplementedException (); }
}
public int ParentGlobalRequestId {
get { throw new NotImplementedException (); }
}
public IDictionary<string, TargetResult> ResultsByTarget {
get { throw new NotImplementedException (); }
}
public int SubmissionId {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,36 @@
// BuildResultCode.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.
//
namespace Microsoft.Build.Execution
{
public enum BuildResultCode
{
Success,
Failure
}
}
@@ -0,0 +1,40 @@
// BuildSubmission.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public class BuildSubmission
{
private BuildSubmission ()
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,67 @@
//
// HostServices.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using System;
namespace Microsoft.Build.Execution
{
public class HostServices
{
public ITaskHost GetHostObject (string projectFile, string targetName, string taskName)
{
throw new NotImplementedException ();
}
public NodeAffinity GetNodeAffinity (string projectFile)
{
throw new NotImplementedException ();
}
public void OnRenameProject (string oldFullPath, string newFullPath)
{
throw new NotImplementedException ();
}
public void RegisterHostObject (string projectFile, string targetName, string taskName, ITaskHost hostObject)
{
throw new NotImplementedException ();
}
public void SetNodeAffinity (string projectFile, NodeAffinity nodeAffinity)
{
throw new NotImplementedException ();
}
public void UnregisterProject (string projectFullPath)
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,40 @@
// ITargetResult.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using System;
namespace Microsoft.Build.Execution
{
public interface ITargetResult
{
Exception Exception { get; }
ITaskItem[] Items { get; }
TargetResultCode ResultCode { get; }
}
}
@@ -0,0 +1,40 @@
//
// NodeAffinity.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public enum NodeAffinity
{
InProc,
OutOfProc,
Any,
}
}
@@ -0,0 +1,68 @@
//
// ProjectInstance.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using Microsoft.Build.Evaluation;
namespace Microsoft.Build.Execution
{
public class ProjectInstance
{
public ProjectInstance (ProjectRootElement xml)
: this (xml, null, null, ProjectCollection.GlobalProjectCollection)
{
}
public ProjectInstance (string projectFile)
: this (projectFile, null, null, ProjectCollection.GlobalProjectCollection)
{
}
public ProjectInstance (string projectFile, IDictionary<string, string> globalProperties,
string toolsVersion)
: this (projectFile, globalProperties, toolsVersion, ProjectCollection.GlobalProjectCollection)
{
}
public ProjectInstance (ProjectRootElement xml, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
{
throw new NotImplementedException ();
}
public ProjectInstance (string projectFile, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,177 @@
//
// ProjectItemInstance.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using System;
using System.Collections.Generic;
namespace Microsoft.Build.Execution
{
public class ProjectItemInstance
: ITaskItem2
{
private ProjectItemInstance ()
{
throw new NotImplementedException ();
}
public ProjectMetadataInstance GetMetadata (string name)
{
throw new NotImplementedException ();
}
public string GetMetadataValue (string name)
{
throw new NotImplementedException ();
}
public bool HasMetadata (string name)
{
throw new NotImplementedException ();
}
public void RemoveMetadata (string metadataName)
{
throw new NotImplementedException ();
}
public void SetMetadata (IEnumerable<KeyValuePair<string, string>> metadataDictionary)
{
throw new NotImplementedException ();
}
public ProjectMetadataInstance SetMetadata (string name, string evaluatedValue)
{
throw new NotImplementedException ();
}
public int DirectMetadataCount {
get { throw new NotImplementedException (); }
}
public string EvaluatedInclude {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public string ItemType {
get { throw new NotImplementedException (); }
}
public IEnumerable<ProjectMetadataInstance> Metadata {
get { throw new NotImplementedException (); }
}
public int MetadataCount {
get { throw new NotImplementedException (); }
}
public ICollection<string> MetadataNames {
get { throw new NotImplementedException (); }
}
public ProjectInstance Project {
get { throw new NotImplementedException (); }
}
#region ITaskItem2 implementation
string ITaskItem2.GetMetadataValueEscaped (string metadataName)
{
throw new NotImplementedException ();
}
void ITaskItem2.SetMetadataValueLiteral (string metadataName, string metadataValue)
{
throw new NotImplementedException ();
}
System.Collections.IDictionary ITaskItem2.CloneCustomMetadataEscaped ()
{
throw new NotImplementedException ();
}
string ITaskItem2.EvaluatedIncludeEscaped {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
#endregion
#region ITaskItem implementation
System.Collections.IDictionary ITaskItem.CloneCustomMetadata ()
{
throw new NotImplementedException ();
}
void ITaskItem.CopyMetadataTo (ITaskItem destinationItem)
{
throw new NotImplementedException ();
}
string ITaskItem.GetMetadata (string metadataName)
{
throw new NotImplementedException ();
}
void ITaskItem.RemoveMetadata (string metadataName)
{
throw new NotImplementedException ();
}
void ITaskItem.SetMetadata (string metadataName, string metadataValue)
{
throw new NotImplementedException ();
}
string ITaskItem.ItemSpec {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
int ITaskItem.MetadataCount {
get {
throw new NotImplementedException ();
}
}
System.Collections.ICollection ITaskItem.MetadataNames {
get {
throw new NotImplementedException ();
}
}
#endregion
}
}
@@ -0,0 +1,41 @@
//
// ProjectMetadataInstance.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public class ProjectMetadataInstance
{
private ProjectMetadataInstance ()
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,41 @@
//
// ProjectPropertyInstance.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public class ProjectPropertyInstance
{
private ProjectPropertyInstance ()
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,40 @@
// ProjectTargetInstance.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Execution
{
public sealed class ProjectTargetInstance
{
private ProjectTargetInstance ()
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,55 @@
// TargetResult.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using System;
namespace Microsoft.Build.Execution
{
public class TargetResult : ITargetResult
{
internal TargetResult ()
{
throw new NotImplementedException ();
}
public Exception Exception {
get { throw new NotImplementedException (); }
}
public ITaskItem[] Items {
get { throw new NotImplementedException (); }
}
public TargetResultCode ResultCode {
get { throw new NotImplementedException (); }
}
}
}
@@ -0,0 +1,37 @@
// TargetResultCode.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.
//
namespace Microsoft.Build.Execution
{
public enum TargetResultCode : byte
{
Skipped,
Success,
Failure,
}
}
@@ -0,0 +1,104 @@
//
// CollectionFromEnumerable.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using System.Text;
namespace Microsoft.Build.Internal
{
internal class CollectionFromEnumerable<T> : ICollection<T>
{
IEnumerable<T> backingEnumerable;
public CollectionFromEnumerable (IEnumerable<T> enumerable)
{
backingEnumerable = enumerable;
}
public void Add (T item)
{
throw new InvalidOperationException ("This collection is read-only.");
}
public void Clear ()
{
throw new InvalidOperationException ("This collection is read-only.");
}
public bool Contains (T item)
{
List<T> backingList = backingEnumerable as List<T>;
if (backingList != null)
return backingList.Contains (item);
return backingEnumerable.Contains (item);
}
public void CopyTo (T[] array, int arrayIndex)
{
List<T> backingList = backingEnumerable as List<T>;
if (backingList != null) {
backingList.CopyTo (array, arrayIndex);
return;
}
int i = arrayIndex;
foreach (var item in backingEnumerable) {
array[i++] = item;
}
}
public int Count {
get {
var backingList = backingEnumerable as List<T>;
if(backingList == null)
backingEnumerable = backingList = new List<T> (backingEnumerable);
return backingList.Count;
}
}
public bool IsReadOnly {
get { return true; }
}
public bool Remove (T item)
{
throw new InvalidOperationException ("This collection is read-only.");
}
public IEnumerator<T> GetEnumerator ()
{
return backingEnumerable.GetEnumerator ();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
{
return backingEnumerable.GetEnumerator ();
}
}
}
@@ -0,0 +1,60 @@
//
// FilteredEnumerable.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Linq;
using System.Text;
namespace Microsoft.Build.Internal
{
internal class FilteredEnumerable<T> : IEnumerable<T> where T : class
{
System.Collections.IEnumerable backingEnumerable;
public FilteredEnumerable (System.Collections.IEnumerable enumerable)
{
backingEnumerable = enumerable;
}
public IEnumerator<T> GetEnumerator ()
{
foreach (var item in backingEnumerable) {
var typedItem = item as T;
if (typedItem != null)
yield return typedItem;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
{
return GetEnumerator ();
}
}
}
@@ -0,0 +1,53 @@
//
// ReverseEnumerable.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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.Collections.Generic;
namespace Microsoft.Build.Internal
{
internal class ReverseEnumerable<T> : IEnumerable<T>
{
LinkedList<T> backingList;
public ReverseEnumerable (LinkedList<T> list)
{
backingList = list;
}
public IEnumerator<T> GetEnumerator ()
{
for (var node = backingList.Last; node != null; node = node.Previous)
yield return node.Value;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
{
return GetEnumerator ();
}
}
}
@@ -0,0 +1,32 @@
// ColorResetter.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.
//
namespace Microsoft.Build.Logging
{
public delegate void ColorResetter ();
}
@@ -0,0 +1,32 @@
// ColorSetter.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.
//
namespace Microsoft.Build.Logging
{
public delegate void ColorSetter (System.ConsoleColor color);
}
@@ -0,0 +1,89 @@
// ConsoleLogger.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Framework;
using System;
namespace Microsoft.Build.Logging
{
public class ConsoleLogger : INodeLogger
{
public ConsoleLogger ()
: this (LoggerVerbosity.Normal)
{
}
public ConsoleLogger (LoggerVerbosity verbosity)
{
throw new NotImplementedException ();
}
public ConsoleLogger (LoggerVerbosity verbosity, WriteHandler write, ColorSetter colorSet, ColorResetter colorReset)
{
throw new NotImplementedException ();
}
#region INodeLogger implementation
public void Initialize (IEventSource eventSource, int nodeCount)
{
throw new NotImplementedException ();
}
#endregion
#region ILogger implementation
public void Initialize (IEventSource eventSource)
{
throw new NotImplementedException ();
}
public void Shutdown ()
{
throw new NotImplementedException ();
}
public string Parameters {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
public LoggerVerbosity Verbosity {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
#endregion
}
}
@@ -0,0 +1,36 @@
// FileLogger.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Logging
{
public class FileLogger
{
}
}
@@ -0,0 +1,45 @@
// ForwardingLoggerRecord.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Logging
{
public class ForwardingLoggerRecord
{
public ForwardingLoggerRecord (ILogger centralLogger, LoggerDescription forwardingLoggerDescription)
{
this.CentralLogger = centralLogger;
this.ForwardingLoggerDescription = forwardingLoggerDescription;
}
public ILogger CentralLogger { get; private set; }
public LoggerDescription ForwardingLoggerDescription { get; private set; }
}
}
@@ -0,0 +1,43 @@
// LoggerDescription.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Logging
{
public class LoggerDescription
{
public LoggerDescription (string loggerClassName, string loggerAssemblyName,
string loggerAssemblyFile, string loggerSwitchParameters,
LoggerVerbosity verbosity)
{
throw new NotImplementedException ();
}
}
}
@@ -0,0 +1,32 @@
// WriteHandler.cs
//
// Author:
// Rolf Bjarne Kvinge ([email protected])
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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.
//
namespace Microsoft.Build.Logging
{
public delegate void WriteHandler (string message);
}
@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B2012E7F-8F8D-4908-8045-413F2BD1022D}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.Build</RootNamespace>
<AssemblyName>Microsoft.Build</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags />
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Microsoft.Build.Construction\ProjectExtensionsElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectWhenElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectOtherwiseElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectOutputElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectTaskElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectOnErrorElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectUsingTaskParameterElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectUsingTaskBodyElement.cs" />
<Compile Include="Microsoft.Build.Construction\UsingTaskParameterGroupElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectUsingTaskElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectTargetElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectItemDefinitionElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectItemDefinitionGroupElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectChooseElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectElementContainer.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectImportElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectImportGroupElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectItemElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectItemGroupElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectMetadataElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectPropertyElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectPropertyGroupElement.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectRootElement.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectCollection.cs" />
<Compile Include="Microsoft.Build.Exceptions\InvalidProjectFileException.cs" />
<Compile Include="Microsoft.Build.Internal\CollectionFromEnumerable.cs" />
<Compile Include="Microsoft.Build.Evaluation\Project.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectLoadSettings.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectItem.cs" />
<Compile Include="Microsoft.Build.Construction\ProjectCommentElement.cs" />
<Compile Include="Microsoft.Build.Internal\ReverseEnumerable.cs" />
<Compile Include="Microsoft.Build.Internal\FilteredEnumerable.cs" />
<Compile Include="Microsoft.Build.Execution\BuildResult.cs" />
<Compile Include="Microsoft.Build.Execution\ITargetResult.cs" />
<Compile Include="Microsoft.Build.Execution\TargetResultCode.cs" />
<Compile Include="Microsoft.Build.Execution\TargetResult.cs" />
<Compile Include="Microsoft.Build.Execution\BuildResultCode.cs" />
<Compile Include="Microsoft.Build.Logging\FileLogger.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectProperty.cs" />
<Compile Include="Microsoft.Build.Evaluation\ToolsetDefinitionLocations.cs" />
<Compile Include="Microsoft.Build.Logging\ForwardingLoggerRecord.cs" />
<Compile Include="Microsoft.Build.Logging\LoggerDescription.cs" />
<Compile Include="Microsoft.Build.Execution\BuildRequestData.cs" />
<Compile Include="Microsoft.Build.Execution\BuildRequestDataFlags.cs" />
<Compile Include="Microsoft.Build.Execution\HostServices.cs" />
<Compile Include="Microsoft.Build.Execution\NodeAffinity.cs" />
<Compile Include="Microsoft.Build.Execution\ProjectItemInstance.cs" />
<Compile Include="Microsoft.Build.Execution\ProjectInstance.cs" />
<Compile Include="Microsoft.Build.Execution\ProjectPropertyInstance.cs" />
<Compile Include="Microsoft.Build.Execution\ProjectMetadataInstance.cs" />
<Compile Include="Microsoft.Build.Execution\BuildParameters.cs" />
<Compile Include="Microsoft.Build.Logging\ConsoleLogger.cs" />
<Compile Include="Microsoft.Build.Logging\ColorResetter.cs" />
<Compile Include="Microsoft.Build.Logging\ColorSetter.cs" />
<Compile Include="Microsoft.Build.Logging\WriteHandler.cs" />
<Compile Include="Microsoft.Build.Evaluation\Toolset.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectMetadata.cs" />
<Compile Include="Microsoft.Build.Execution\ProjectTargetInstance.cs" />
<Compile Include="Microsoft.Build.Evaluation\ProjectItemDefinition.cs" />
<Compile Include="Microsoft.Build.Evaluation\ResolvedImport.cs" />
<Compile Include="Microsoft.Build.Execution\BuildManager.cs" />
<Compile Include="Microsoft.Build.Execution\BuildSubmission.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,66 @@
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
Microsoft.Build.Construction/ProjectChooseElement.cs
Microsoft.Build.Construction/ProjectCommentElement.cs
Microsoft.Build.Construction/ProjectElementContainer.cs
Microsoft.Build.Construction/ProjectElement.cs
Microsoft.Build.Construction/ProjectExtensionsElement.cs
Microsoft.Build.Construction/ProjectImportElement.cs
Microsoft.Build.Construction/ProjectImportGroupElement.cs
Microsoft.Build.Construction/ProjectItemDefinitionElement.cs
Microsoft.Build.Construction/ProjectItemDefinitionGroupElement.cs
Microsoft.Build.Construction/ProjectItemElement.cs
Microsoft.Build.Construction/ProjectItemGroupElement.cs
Microsoft.Build.Construction/ProjectMetadataElement.cs
Microsoft.Build.Construction/ProjectOnErrorElement.cs
Microsoft.Build.Construction/ProjectOtherwiseElement.cs
Microsoft.Build.Construction/ProjectOutputElement.cs
Microsoft.Build.Construction/ProjectPropertyElement.cs
Microsoft.Build.Construction/ProjectPropertyGroupElement.cs
Microsoft.Build.Construction/ProjectRootElement.cs
Microsoft.Build.Construction/ProjectTargetElement.cs
Microsoft.Build.Construction/ProjectTaskElement.cs
Microsoft.Build.Construction/ProjectUsingTaskBodyElement.cs
Microsoft.Build.Construction/ProjectUsingTaskElement.cs
Microsoft.Build.Construction/ProjectUsingTaskParameterElement.cs
Microsoft.Build.Construction/ProjectWhenElement.cs
Microsoft.Build.Construction/UsingTaskParameterGroupElement.cs
Microsoft.Build.Evaluation/Project.cs
Microsoft.Build.Evaluation/ProjectCollection.cs
Microsoft.Build.Evaluation/ProjectItem.cs
Microsoft.Build.Evaluation/ProjectItemDefinition.cs
Microsoft.Build.Evaluation/ProjectLoadSettings.cs
Microsoft.Build.Evaluation/ProjectMetadata.cs
Microsoft.Build.Evaluation/ProjectProperty.cs
Microsoft.Build.Evaluation/ResolvedImport.cs
Microsoft.Build.Evaluation/Toolset.cs
Microsoft.Build.Evaluation/ToolsetDefinitionLocations.cs
Microsoft.Build.Exceptions/InvalidProjectFileException.cs
Microsoft.Build.Execution/BuildManager.cs
Microsoft.Build.Execution/BuildParameters.cs
Microsoft.Build.Execution/BuildRequestData.cs
Microsoft.Build.Execution/BuildRequestDataFlags.cs
Microsoft.Build.Execution/BuildResult.cs
Microsoft.Build.Execution/BuildResultCode.cs
Microsoft.Build.Execution/BuildSubmission.cs
Microsoft.Build.Execution/HostServices.cs
Microsoft.Build.Execution/ITargetResult.cs
Microsoft.Build.Execution/NodeAffinity.cs
Microsoft.Build.Execution/ProjectInstance.cs
Microsoft.Build.Execution/ProjectItemInstance.cs
Microsoft.Build.Execution/ProjectMetadataInstance.cs
Microsoft.Build.Execution/ProjectPropertyInstance.cs
Microsoft.Build.Execution/ProjectTargetInstance.cs
Microsoft.Build.Execution/TargetResult.cs
Microsoft.Build.Execution/TargetResultCode.cs
Microsoft.Build.Internal/CollectionFromEnumerable.cs
Microsoft.Build.Internal/FilteredEnumerable.cs
Microsoft.Build.Internal/ReverseEnumerable.cs
Microsoft.Build.Logging/ColorResetter.cs
Microsoft.Build.Logging/ColorSetter.cs
Microsoft.Build.Logging/ConsoleLogger.cs
Microsoft.Build.Logging/FileLogger.cs
Microsoft.Build.Logging/ForwardingLoggerRecord.cs
Microsoft.Build.Logging/LoggerDescription.cs
Microsoft.Build.Logging/WriteHandler.cs
@@ -0,0 +1,54 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build", "Microsoft.Build.csproj", "{B2012E7F-8F8D-4908-8045-413F2BD1022D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Test", "Test\Microsoft.Build.Test.csproj", "{5C1BA631-5120-4930-A112-80783328B72B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5C1BA631-5120-4930-A112-80783328B72B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C1BA631-5120-4930-A112-80783328B72B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C1BA631-5120-4930-A112-80783328B72B}.Debug|x86.ActiveCfg = Debug|Any CPU
{5C1BA631-5120-4930-A112-80783328B72B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C1BA631-5120-4930-A112-80783328B72B}.Release|Any CPU.Build.0 = Release|Any CPU
{5C1BA631-5120-4930-A112-80783328B72B}.Release|x86.ActiveCfg = Release|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Release|Any CPU.Build.0 = Release|Any CPU
{B2012E7F-8F8D-4908-8045-413F2BD1022D}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Microsoft.Build.csproj
Policies = $0
$0.TextStylePolicy = $1
$1.FileWidth = 120
$1.TabWidth = 8
$1.NoTabsAfterNonTabs = True
$1.RemoveTrailingWhitespace = True
$1.inheritsSet = VisualStudio
$1.inheritsScope = text/plain
$1.scope = text/plain
$0.TextStylePolicy = $2
$2.inheritsSet = null
$2.scope = text/x-csharp
$0.CSharpFormattingPolicy = $3
$3.inheritsSet = Mono
$3.inheritsScope = text/x-csharp
$3.scope = text/x-csharp
$0.StandardHeader = $4
$4.Text =
$4.inheritsSet = Apache2License
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,2 @@
FunctionalTest.cs
Microsoft.Build.Internal/CollectionFromEnumerableTest.cs
@@ -0,0 +1,145 @@
//
// FunctionalTest.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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 NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Build.Construction;
using Microsoft.Build.Evaluation;
using System.IO;
using System.Globalization;
namespace MonoTests.Microsoft.Build
{
[TestFixture]
public class FunctionalTest
{
[Test]
public void TestFullProjectGeneration ()
{
var project = ProjectRootElement.Create ();
var projectFileName = String.Format ("Test{0}FunctionalTestProject.csproj",
Path.DirectorySeparatorChar);
project.DefaultTargets = "Build";
SetKnownProperties (project.AddPropertyGroup ());
GenerateReferences (project.AddItemGroup ());
GenerateCompileIncludes (project.AddItemGroup ());
project.AddImport ("$(MSBuildToolsPath)\\Microsoft.CSharp.targets");
project.Save (projectFileName);
Assert.AreEqual (projectGuid, GetProjectId (project), "#01");
FileAssert.AreEqual (String.Format ("Test{0}FunctionalTestReferenceProject.csproj",
Path.DirectorySeparatorChar), String.Format ("Test{0}FunctionalTestProject.csproj",
Path.DirectorySeparatorChar), "#02");
}
[Test]
public void TestLoadAndSave ()
{
var project = ProjectRootElement.Open ("Microsoft.Build.csproj");
var projectFileName = String.Format ("Test{0}FunctionalTestProject2.csproj",
Path.DirectorySeparatorChar);
project.Save (projectFileName);
Assert.AreEqual (new Guid ("{B2012E7F-8F8D-4908-8045-413F2BD1022D}"), GetProjectId (project),
"#03");
FileAssert.AreEqual ("Microsoft.Build.csproj", projectFileName, "#04");
}
[Test]
public void TestLoadAndSave3 ()
{
var referenceProject = String.Format (
"Test{0}FunctionalTestReferenceProject3.csproj", Path.DirectorySeparatorChar);
var project = ProjectRootElement.Open (referenceProject);
var projectFileName = String.Format ("Test{0}FunctionalTestProject3.csproj",
Path.DirectorySeparatorChar);
project.Save (projectFileName);
Assert.AreEqual (new Guid ("{793B20A9-E263-4B54-BB31-305B602087CE}"), GetProjectId (project),
"#05");
FileAssert.AreEqual (referenceProject, projectFileName, "#06");
}
public Guid GetProjectId (ProjectRootElement project)
{
var value = project.Properties.Where (p => p.Name == "ProjectGuid").First ().Value;
return Guid.Parse (value);
}
void GenerateCompileIncludes (ProjectItemGroupElement itemGroup)
{
foreach (var include in new[] { "Test.cs", "Test2.cs", "Test3.cs" }) {
itemGroup.AddItem ("Compile", ProjectCollection.Escape (include),
new[] { new KeyValuePair<string, string> ("SubType", "Code") });
}
foreach (var resource in new[] { "Test.resx", "Test2.resx", "Test3.resx" }) {
itemGroup.AddItem ("EmbeddedResource", ProjectCollection.Escape (resource),
new[] { new KeyValuePair<string, string> ("LogicalName", "Name.Space.Test") });
}
}
void GenerateReferences (ProjectItemGroupElement itemGroup)
{
foreach (var reference in new[] { "Test.dll", "Test2.dll", "Test3.dll" }) {
var name = Path.GetFileNameWithoutExtension (reference);
itemGroup.AddItem ("Reference", name, new[] {
new KeyValuePair<string, string> ("Name", name),
new KeyValuePair<string, string> ("HintPath",
ProjectCollection.Escape (reference)) });
}
foreach (var reference in new[] { "mscorlib", "System", "System.Xml" }) {
itemGroup.AddItem ("Reference", reference);
}
}
void SetKnownProperties (ProjectPropertyGroupElement properties)
{
properties.AddProperty ("AssemblyName", Path.GetFileNameWithoutExtension ("ZigZag.exe"));
properties.AddProperty ("ProjectGuid", projectGuid.ToString ("B"));
properties.AddProperty ("CheckForOverflowUnderflow", false.ToString ());
properties.AddProperty ("CodePage", String.Empty);
properties.AddProperty ("DebugSymbols", true.ToString ());
properties.AddProperty ("DebugType", "Full");
properties.AddProperty ("Optimize", false.ToString ());
properties.AddProperty ("Platform", "AnyCPU");
properties.AddProperty ("ProjectTypeGuids", projectTypeGuid.ToString ("B"));
properties.AddProperty ("AllowUnsafeBlocks", false.ToString ());
properties.AddProperty ("WarningLevel", "4");
properties.AddProperty ("OutputPath", ProjectCollection.Escape ("bin\\Debug"));
properties.AddProperty ("OutputType", "winexe");
properties.AddProperty ("DefineConstants", "DEBUG,TRACE");
properties.AddProperty ("TreatWarningsAsErrors", true.ToString ());
}
static readonly Guid projectTypeGuid = Guid.Parse ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}");
static readonly Guid projectGuid = Guid.Parse ("{362F36B0-B26C-42DE-8586-20DF66BD05E8}");
}
}
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>ZigZag</AssemblyName>
<ProjectGuid>{362f36b0-b26c-42de-8586-20df66bd05e8}</ProjectGuid>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<CodePage />
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<Platform>AnyCPU</Platform>
<ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<WarningLevel>4</WarningLevel>
<OutputPath>bin\Debug</OutputPath>
<OutputType>winexe</OutputType>
<DefineConstants>DEBUG,TRACE</DefineConstants>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="Test">
<Name>Test</Name>
<HintPath>Test.dll</HintPath>
</Reference>
<Reference Include="Test2">
<Name>Test2</Name>
<HintPath>Test2.dll</HintPath>
</Reference>
<Reference Include="Test3">
<Name>Test3</Name>
<HintPath>Test3.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Test.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Test2.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Test3.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="Test.resx">
<LogicalName>Name.Space.Test</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Test2.resx">
<LogicalName>Name.Space.Test</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Test3.resx">
<LogicalName>Name.Space.Test</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Build\NuGet.Settings.targets" />
<PropertyGroup>
<ProjectGuid>{793B20A9-E263-4B54-BB31-305B602087CE}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>NuGet.Server</RootNamespace>
<AssemblyName>NuGet.Server</AssemblyName>
<OutputPath>bin</OutputPath>
<UseIISExpress>true</UseIISExpress>
</PropertyGroup>
<ItemGroup>
<Reference Include="Elmah">
<HintPath>..\..\packages\elmah.corelibrary.1.2\lib\Elmah.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Ninject">
<HintPath>..\..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll</HintPath>
</Reference>
<Reference Include="RouteMagic">
<HintPath>..\..\packages\RouteMagic.1.0\lib\net40\RouteMagic.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Services" />
<Reference Include="System.Data.Services.Client" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Activation" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="WebActivator">
<HintPath>..\..\packages\WebActivator.1.4.1\lib\net40\WebActivator.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Common\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="DataServices\Package.cs" />
<Compile Include="DataServices\PackageContext.cs" />
<Compile Include="Publishing\PackageService.cs" />
<Compile Include="Infrastructure\Bindings.cs" />
<Compile Include="Infrastructure\Helpers.cs" />
<Compile Include="Infrastructure\IPackageAuthenticationService.cs" />
<Compile Include="Infrastructure\IServerPackageRepository.cs" />
<Compile Include="Infrastructure\PackageAuthenticationService.cs" />
<Compile Include="Infrastructure\ServerPackageRepository.cs" />
<Compile Include="Infrastructure\NinjectBootstrapper.cs" />
<Compile Include="Infrastructure\DerivedPackageData.cs" />
<Compile Include="DataServices\Packages.svc.cs">
<DependentUpon>Packages.svc</DependentUpon>
</Compile>
<Compile Include="Infrastructure\PackageUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Default.aspx" />
<Content Include="favicon.ico" />
<Content Include="DataServices\Packages.svc" />
<Content Include="license.txt" />
<Content Include="Packages\Readme.txt" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="DataServices\Routes.cs" />
<None Include="Properties\NuGet.Server.nuspec" />
<Content Include="DataServices\Routes.cs.pp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj">
<Project>{F879F274-EFA0-4157-8404-33A19B4E6AEC}</Project>
<Name>Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>18572</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:18572/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -0,0 +1,67 @@
//
// CollectionFromEnumerableTest.cs
//
// Author:
// Leszek Ciesielski ([email protected])
//
// (C) 2011 Leszek Ciesielski
//
// 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 NUnit.Framework;
using Microsoft.Build.Construction;
using System.Collections.Generic;
using System;
namespace MonoTests.Microsoft.Build.Internal
{
[TestFixture]
public class CollectionFromEnumerableTest
{
ICollection<ProjectPropertyElement> subject;
[SetUp]
public void SetUp ()
{
subject = ProjectRootElement.Create ().Properties;
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void TestAdd ()
{
subject.Add (null);
Assert.Fail ("CFE1");
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void TestClear ()
{
subject.Clear ();
Assert.Fail ("CFE2");
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void TestRemove ()
{
subject.Remove (null);
Assert.Fail ("CFE3");
}
}
}
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5C1BA631-5120-4930-A112-80783328B72B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Build.Test</RootNamespace>
<AssemblyName>Microsoft.Build.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FunctionalTest.cs" />
<Compile Include="Microsoft.Build.Internal\CollectionFromEnumerableTest.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Microsoft.Build.Construction\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Build.csproj">
<Project>{B2012E7F-8F8D-4908-8045-413F2BD1022D}</Project>
<Name>Microsoft.Build</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+10 -1
View File
@@ -7,6 +7,8 @@ OTHER_RESOURCES = $(wildcard resources/*.bmp)
RESOURCES = $(RESX_RESOURCES) $(OTHER_RESOURCES)
PREBUILT = $(RESX_RESOURCES:=.prebuilt)
LIBRARY = Mono.Data.Sqlite.dll
LIB_MCS_FLAGS = /unsafe /r:System.dll /r:System.Data.dll /r:System.Transactions.dll /r:System.Xml.dll \
$(RESOURCES:%=-resource:%) -d:SQLITE_STANDARD
@@ -19,8 +21,11 @@ EXTRA_DISTFILES = Test/SqliteTest.cs \
resources/ChangeLog \
resources/DataTypes.xml \
resources/MetaDataCollections.xml \
$(PREBUILT) \
$(wildcard resources/*.bmp)
CLEAN_FILES = $(RESX_RESOURCES)
test-local: test.db
test.db: Test/test.sql
@@ -31,5 +36,9 @@ include ../../build/library.make
$(the_lib): $(RESOURCES)
$(PREBUILT): %.prebuilt: %
cp $* $@
$(RESX_RESOURCES): %.resources: %.resx
$(RESGEN) $<
$(RESGEN) $< || cp $@.prebuilt $@
@@ -2,6 +2,7 @@ Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
Mono.Data.Sqlite_2.0/MonoPInvokeCallbackAttribute.cs
Mono.Data.Sqlite_2.0/SQLite3.cs
Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs
Mono.Data.Sqlite_2.0/SQLiteBase.cs
@@ -0,0 +1,36 @@
//
// MonoPInvokeCallbackAttribute.cs: necessary for AOT ports of Mono
//
// 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 MONOTOUCH
using System;
namespace MonoTouch {
[AttributeUsage (AttributeTargets.Method)]
sealed class MonoPInvokeCallbackAttribute : Attribute {
public MonoPInvokeCallbackAttribute (Type t) {}
}
}
#endif
@@ -28,6 +28,9 @@ namespace Mono.Data.Sqlite
#if !PLATFORM_COMPACTFRAMEWORK
private bool _buildingSchema = false;
#endif
#if MONOTOUCH
GCHandle gch;
#endif
/// <summary>
/// The user-defined functions registered on this connection
@@ -37,12 +40,19 @@ namespace Mono.Data.Sqlite
internal SQLite3(SQLiteDateFormats fmt)
: base(fmt)
{
#if MONOTOUCH
gch = GCHandle.Alloc (this);
#endif
}
protected override void Dispose(bool bDisposing)
{
if (bDisposing)
Close();
#if MONOTOUCH
if (gch.IsAllocated)
gch.Free ();
#endif
}
// It isn't necessary to cleanup any functions we've registered. If the connection
@@ -866,7 +876,60 @@ namespace Mono.Data.Sqlite
int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length);
if (n > 0) throw new SqliteException(n, SQLiteLastError());
}
#if MONOTOUCH
SQLiteUpdateCallback update_callback;
SQLiteCommitCallback commit_callback;
SQLiteRollbackCallback rollback_callback;
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteUpdateCallback))]
static void update (IntPtr puser, int type, IntPtr database, IntPtr table, Int64 rowid)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;
instance.update_callback (puser, type, database, table, rowid);
}
internal override void SetUpdateHook (SQLiteUpdateCallback func)
{
update_callback = func;
if (func == null)
UnsafeNativeMethods.sqlite3_update_hook (_sql, null, IntPtr.Zero);
else
UnsafeNativeMethods.sqlite3_update_hook (_sql, update, GCHandle.ToIntPtr (gch));
}
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteCommitCallback))]
static int commit (IntPtr puser)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;
return instance.commit_callback (puser);
}
internal override void SetCommitHook (SQLiteCommitCallback func)
{
commit_callback = func;
if (func == null)
UnsafeNativeMethods.sqlite3_commit_hook (_sql, null, IntPtr.Zero);
else
UnsafeNativeMethods.sqlite3_commit_hook (_sql, commit, GCHandle.ToIntPtr (gch));
}
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteRollbackCallback))]
static void rollback (IntPtr puser)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;
instance.rollback_callback (puser);
}
internal override void SetRollbackHook (SQLiteRollbackCallback func)
{
rollback_callback = func;
if (func == null)
UnsafeNativeMethods.sqlite3_rollback_hook (_sql, null, IntPtr.Zero);
else
UnsafeNativeMethods.sqlite3_rollback_hook (_sql, rollback, GCHandle.ToIntPtr (gch));
}
#else
internal override void SetUpdateHook(SQLiteUpdateCallback func)
{
UnsafeNativeMethods.sqlite3_update_hook(_sql, func, IntPtr.Zero);
@@ -881,7 +944,7 @@ namespace Mono.Data.Sqlite
{
UnsafeNativeMethods.sqlite3_rollback_hook(_sql, func, IntPtr.Zero);
}
#endif
/// <summary>
/// Helper function to retrieve a column of data from an active statement.
/// </summary>
@@ -253,4 +253,11 @@ namespace Mono.Data.Sqlite
SharedCache = 0x01000000,
Default = 0x06,
}
// subset of the options available in http://www.sqlite.org/c3ref/c_config_getmalloc.html
public enum SQLiteConfig {
SingleThread = 1,
MultiThread = 2,
Serialized = 3,
}
}
@@ -2287,6 +2287,13 @@ namespace Mono.Data.Sqlite
{
_rollbackHandler(this, EventArgs.Empty);
}
// http://www.sqlite.org/c3ref/config.html
public static void SetConfig (SQLiteConfig config)
{
int n = UnsafeNativeMethods.sqlite3_config (config);
if (n > 0) throw new SqliteException (n, null);
}
}
/// <summary>
@@ -686,6 +686,13 @@ namespace Mono.Data.Sqlite
#endif
internal static extern int sqlite3_exec(IntPtr db, byte[] strSql, IntPtr pvCallback, IntPtr pvParam, out IntPtr errMsg);
#if !PLATFORM_COMPACTFRAMEWORK
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
#else
[DllImport(SQLITE_DLL)]
#endif
internal static extern int sqlite3_config (SQLiteConfig config);
#endregion
}
@@ -391,28 +391,9 @@ namespace Mono.Data.Tds.Protocol {
if (tdsVersion < TdsVersion.tds70) {
Append (encoder.GetBytes (s));
} else {
int cindex = 0, index;
int ssize = sizeof (short);
int lenToWrite = s.Length * ssize;
// if nextOutBufferLength points to the last buffer in outBuffer,
// we would get a DivisionByZero while calculating remBufLen
if (outBufferLength - nextOutBufferIndex < ssize)
SendIfFull (ssize);
int remBufLen = outBufferLength - nextOutBufferIndex;
int count = lenToWrite/remBufLen;
if (lenToWrite % remBufLen > 0)
count++;
for (int i = 0; i < count; i++) {
index = System.Math.Min (remBufLen/ssize, lenToWrite/ssize);
for (int j = 0; j < index*ssize; j+=2, cindex++)
AppendInternal ((short)s[cindex]);
lenToWrite -= index*ssize;
// Just make sure to flush the buffer
SendIfFull ((lenToWrite+1)*ssize);
for (int i = 0; i < s.Length; i++) {
SendIfFull (sizeof(short));
AppendInternal ((short)s[i]);
}
}
}
@@ -13,6 +13,9 @@ namespace Mono.Debugger.Soft
internal ArrayMirror (VirtualMachine vm, long id) : base (vm, id) {
}
internal ArrayMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id, type, domain) {
}
public int Length {
get {
GetLengths ();
@@ -102,6 +102,11 @@ namespace Mono.Debugger.Soft
public bool is_thread_pool;
}
struct ObjectRefInfo {
public long type_id;
public long domain_id;
}
enum ValueTypeId {
VALUE_TYPE_ID_NULL = 0xf0,
VALUE_TYPE_ID_TYPE = 0xf1
@@ -317,8 +322,8 @@ namespace Mono.Debugger.Soft
* features might not be available. This allows older clients to communicate
* with newer runtimes, and vice versa.
*/
public const int MAJOR_VERSION = 2;
public const int MINOR_VERSION = 3;
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 5;
enum WPSuspendPolicy {
NONE = 0,
@@ -478,7 +483,8 @@ namespace Mono.Debugger.Soft
IS_COLLECTED = 3,
GET_ADDRESS = 4,
GET_DOMAIN = 5,
SET_VALUES = 6
SET_VALUES = 6,
GET_INFO = 7,
}
class Header {
@@ -1902,6 +1908,15 @@ namespace Mono.Debugger.Soft
return SendReceive (CommandSet.OBJECT_REF, (int)CmdObjectRef.GET_ADDRESS, new PacketWriter ().WriteId (id)).ReadLong ();
}
internal ObjectRefInfo Object_GetInfo (long id) {
ObjectRefInfo res = new ObjectRefInfo ();
PacketReader r = SendReceive (CommandSet.OBJECT_REF, (int)CmdObjectRef.GET_INFO, new PacketWriter ().WriteId (id));
res.type_id = r.ReadId ();
res.domain_id = r.ReadId ();
return res;
}
}
/* This is the interface exposed by the debugger towards the debugger agent */
@@ -133,7 +133,7 @@ namespace Mono.Debugger.Soft {
if (named_args [j] == null)
throw new NotImplementedException ();
}
res [i] = new CustomAttributeDataMirror (vm.GetMethod (attr.ctor_id), ctor_args, named_args);
res [i] = new CustomAttributeDataMirror (ctor, ctor_args, named_args);
}
return res;
@@ -6,19 +6,44 @@ using System.Threading;
namespace Mono.Debugger.Soft
{
public class ObjectMirror : Value {
TypeMirror type;
AppDomainMirror domain;
internal ObjectMirror (VirtualMachine vm, long id) : base (vm, id) {
}
internal ObjectMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id) {
this.type = type;
this.domain = domain;
}
void GetInfo () {
var info = vm.conn.Object_GetInfo (id);
type = vm.GetType (info.type_id);
domain = vm.GetDomain (info.domain_id);
}
public TypeMirror Type {
get {
return vm.GetType (vm.conn.Object_GetType (id));
if (type == null) {
if (vm.conn.Version.AtLeast (2, 5))
GetInfo ();
else
type = vm.GetType (vm.conn.Object_GetType (id));
}
return type;
}
}
public AppDomainMirror Domain {
get {
return vm.GetDomain (vm.conn.Object_GetDomain (id));
if (domain == null) {
if (vm.conn.Version.AtLeast (2, 5))
GetInfo ();
else
domain = vm.GetDomain (vm.conn.Object_GetDomain (id));
}
return domain;
}
}
@@ -8,6 +8,9 @@ namespace Mono.Debugger.Soft
internal StringMirror (VirtualMachine vm, long id) : base (vm, id) {
}
internal StringMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id, type, domain) {
}
public string Value {
get {
return vm.conn.String_GetValue (id);
Loaded 100 of 364 files, more files were not shown because too many files have changed in this diff. Show more