diff options
Diffstat (limited to 'mcs/class/Microsoft.Build.Framework')
20 files changed, 436 insertions, 25 deletions
diff --git a/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs b/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs index 1c7777bfa7..2110fd0668 100644 --- a/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs +++ b/mcs/class/Microsoft.Build.Framework/Assembly/AssemblyInfo.cs @@ -44,9 +44,9 @@ using System.Runtime.InteropServices; [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: AssemblyVersion (XBuildConsts.AssemblyVersion)] +[assembly: SatelliteContractVersion (XBuildConsts.AssemblyVersion)] +[assembly: AssemblyInformationalVersion (XBuildConsts.FileVersion)] [assembly: NeutralResourcesLanguage ("en-US")] @@ -56,5 +56,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign (true)] [assembly: AssemblyKeyFile("../msfinal.pub")] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (XBuildConsts.FileVersion)] diff --git a/mcs/class/Microsoft.Build.Framework/Makefile b/mcs/class/Microsoft.Build.Framework/Makefile index 0cb68bfac6..73f43fb74c 100644 --- a/mcs/class/Microsoft.Build.Framework/Makefile +++ b/mcs/class/Microsoft.Build.Framework/Makefile @@ -2,24 +2,17 @@ thisdir = class/Microsoft.Build.Framework SUBDIRS = include ../../build/rules.make -LIBRARY = Microsoft.Build.Framework.dll +XBUILD_DIR=$(topdir)/tools/xbuild +include $(XBUILD_DIR)/xbuild.make -ifeq (1.0, $(FRAMEWORK_VERSION)) -LIBRARY_NAME = dummy-Microsoft.Build.Framework.dll -NO_INSTALL = yes -NO_TEST = yes -NO_SIGN_ASSEMBLY = yes -endif +LIBRARY = Microsoft.Build.Framework.dll LIB_MCS_FLAGS = \ /r:$(corlib) \ /r:System.dll -include ../../build/library.make - -export TESTING_MONO=a -XBUILD_DIR=../../tools/xbuild -include $(XBUILD_DIR)/xbuild_targets.make - EXTRA_DISTFILES = \ Mono.XBuild.Framework/AssemblyLoadInfo.cs + +include ../../build/library.make +include $(XBUILD_DIR)/xbuild_test.make diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources index 3b83e2da7b..bb3c1d6d07 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources @@ -1,10 +1,13 @@ ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs +../../tools/xbuild/XBuildConsts.cs Assembly/AssemblyInfo.cs Microsoft.Build.Framework/AnyEventHandler.cs +Microsoft.Build.Framework/BuildEngineResult.cs Microsoft.Build.Framework/BuildErrorEventArgs.cs Microsoft.Build.Framework/BuildErrorEventHandler.cs Microsoft.Build.Framework/BuildEventArgs.cs +Microsoft.Build.Framework/BuildEventContext.cs Microsoft.Build.Framework/BuildFinishedEventArgs.cs Microsoft.Build.Framework/BuildFinishedEventHandler.cs Microsoft.Build.Framework/BuildMessageEventArgs.cs @@ -21,14 +24,21 @@ Microsoft.Build.Framework/ExternalProjectFinishedEventArgs.cs Microsoft.Build.Framework/ExternalProjectStartedEventArgs.cs Microsoft.Build.Framework/IBuildEngine.cs Microsoft.Build.Framework/IBuildEngine2.cs +Microsoft.Build.Framework/IBuildEngine3.cs +Microsoft.Build.Framework/IBuildEngine4.cs Microsoft.Build.Framework/ICancelableTask.cs +Microsoft.Build.Framework/IEventRedirector.cs Microsoft.Build.Framework/IEventSource.cs +Microsoft.Build.Framework/IForwardingLogger.cs Microsoft.Build.Framework/ILogger.cs Microsoft.Build.Framework/INodeLogger.cs Microsoft.Build.Framework/ITask.cs +Microsoft.Build.Framework/ITaskFactory.cs +Microsoft.Build.Framework/ITaskFactory2.cs Microsoft.Build.Framework/ITaskHost.cs Microsoft.Build.Framework/ITaskItem.cs Microsoft.Build.Framework/ITaskItem2.cs +Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs Microsoft.Build.Framework/LoadInSeparateAppDomainAttribute.cs Microsoft.Build.Framework/LoggerException.cs Microsoft.Build.Framework/LoggerVerbosity.cs @@ -38,6 +48,7 @@ Microsoft.Build.Framework/ProjectFinishedEventArgs.cs Microsoft.Build.Framework/ProjectFinishedEventHandler.cs Microsoft.Build.Framework/ProjectStartedEventArgs.cs Microsoft.Build.Framework/ProjectStartedEventHandler.cs +Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs Microsoft.Build.Framework/RequiredAttribute.cs Microsoft.Build.Framework/TargetFinishedEventArgs.cs Microsoft.Build.Framework/TargetFinishedEventHandler.cs @@ -46,5 +57,7 @@ Microsoft.Build.Framework/TargetStartedEventHandler.cs Microsoft.Build.Framework/TaskCommandLineEventArgs.cs Microsoft.Build.Framework/TaskFinishedEventArgs.cs Microsoft.Build.Framework/TaskFinishedEventHandler.cs +Microsoft.Build.Framework/TaskPropertyInfo.cs Microsoft.Build.Framework/TaskStartedEventArgs.cs Microsoft.Build.Framework/TaskStartedEventHandler.cs + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs new file mode 100644 index 0000000000..05b65f1bb4 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEngineResult.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [SerializableAttribute] + public struct BuildEngineResult + { + public BuildEngineResult (bool result, List<IDictionary<string, ITaskItem[]>> targetOutputsPerProject) + { + this.result = result; + this.outputs = targetOutputsPerProject; + } + + readonly bool result; + public bool Result { + get { return result; } + } + + readonly IList<IDictionary<string, ITaskItem[]>> outputs; + public IList<IDictionary<string, ITaskItem[]>> TargetOutputsPerProject { + get { return outputs; } + } + } +} diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs index 60be917bf4..fd2c709dd0 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs @@ -41,7 +41,8 @@ namespace Microsoft.Build.Framework string senderName; int threadId; DateTime timestamp; - + BuildEventContext context; + protected BuildEventArgs () : this (null, null, null) { @@ -49,12 +50,19 @@ namespace Microsoft.Build.Framework protected BuildEventArgs (string message, string helpKeyword, string senderName) + : this (message, helpKeyword, senderName, DateTime.Now) + { + } + + protected BuildEventArgs (string message, string helpKeyword, + string senderName, DateTime eventTimestamp) { this.message = message; this.helpKeyword = helpKeyword; this.senderName = senderName; this.threadId = Thread.CurrentThread.GetHashCode (); - this.timestamp = DateTime.Now; + this.timestamp = eventTimestamp; + this.context = BuildEventContext.NewInstance (); } public string HelpKeyword { @@ -87,7 +95,16 @@ namespace Microsoft.Build.Framework return timestamp; } } + + public BuildEventContext BuildEventContext { + get { return context; } + set { + if (value == null) + throw new ArgumentNullException ("value"); + context = value; + } + } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs new file mode 100644 index 0000000000..2a550f46dc --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs @@ -0,0 +1,94 @@ +using System; + + +namespace Microsoft.Build.Framework +{ + [Serializable] + public class BuildEventContext + { + static readonly Random rnd = new Random (); + + public static BuildEventContext Invalid = new BuildEventContext ( + InvalidSubmissionId, + InvalidNodeId, + InvalidProjectInstanceId, + InvalidTargetId, + InvalidProjectContextId, + InvalidTaskId); + + internal static BuildEventContext NewInstance () + { + return new BuildEventContext (rnd.Next (), rnd.Next (), rnd.Next (), rnd.Next ()); + } + + public BuildEventContext (int nodeId, int targetId, int projectContextId, int taskId) + : this (nodeId, rnd.Next (), targetId, projectContextId, taskId) + { + } + + public BuildEventContext (int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId) + : this (rnd.Next (), nodeId, projectInstanceId, targetId, projectContextId, taskId) + { + } + + public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId) + { + SubmissionId = submissionId; + NodeId = nodeId; + ProjectInstanceId = projectInstanceId; + TargetId = targetId; + ProjectContextId = projectContextId; + TaskId = taskId; + } + + public const int InvalidSubmissionId = -1; + public const int InvalidNodeId = -2; + public const int InvalidProjectInstanceId = -1; + public const int InvalidTargetId = -1; + public const int InvalidProjectContextId = -2; + public const int InvalidTaskId = -1; + + public int SubmissionId { get; private set; } + public int NodeId { get; private set; } + public int ProjectInstanceId { get; private set; } + public int TargetId { get; private set; } + public int ProjectContextId { get; private set; } + public int TaskId { get; private set; } + + // MSDN document says "true if the references are equal, false otherwise." but that doesn't make sense. + public override bool Equals (object other) + { + var o = other as BuildEventContext; + return (object) o != null && + o.NodeId == NodeId && + o.ProjectContextId == ProjectContextId && + o.ProjectInstanceId == ProjectInstanceId && + o.SubmissionId == SubmissionId && + o.TargetId == TargetId && + o.TaskId == TaskId; + } + + public override int GetHashCode () + { + return + (NodeId << 5) + + (ProjectContextId << 4) + + (ProjectInstanceId << 3) + + (SubmissionId << 2) + + (TargetId << 1) + + TaskId; + } + + public static bool operator == (BuildEventContext left, BuildEventContext right) + { + return (object) left == null ? (object)right == null : left.Equals (right); + } + + public static bool operator != (BuildEventContext left, BuildEventContext right) + { + return (object) left == null ? (object)right != null : !left.Equals (right); + } + } +} + + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs index 6397a9e0d1..6595f05f0d 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildFinishedEventArgs.cs @@ -43,7 +43,25 @@ namespace Microsoft.Build.Framework { public BuildFinishedEventArgs (string message, string helpKeyword, bool succeeded) - : base (message, helpKeyword, null) + : this (message, helpKeyword, succeeded, DateTime.Now) + { + } + + public BuildFinishedEventArgs (string message, + string helpKeyword, + bool succeeded, + DateTime eventTimestamp) + : base (message, helpKeyword, null, eventTimestamp) + { + this.succeeded = succeeded; + } + + public BuildFinishedEventArgs (string message, + string helpKeyword, + bool succeeded, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, null, eventTimestamp, messageArgs) { this.succeeded = succeeded; } @@ -56,4 +74,4 @@ namespace Microsoft.Build.Framework { } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs index 8a48d844cc..54b0303b30 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStartedEventArgs.cs @@ -29,6 +29,7 @@ #if NET_2_0 using System; +using System.Collections.Generic; namespace Microsoft.Build.Framework { [Serializable] @@ -40,10 +41,34 @@ namespace Microsoft.Build.Framework { public BuildStartedEventArgs (string message, string helpKeyword) + : this (message, helpKeyword, DateTime.Now) + { + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + IDictionary<string, string> environmentOfBuild) : base (message, helpKeyword, null) { + // deal with environmentOfBuild + throw new NotImplementedException (); + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + DateTime eventTimestamp) + : base (message, helpKeyword, null, eventTimestamp) + { + } + + public BuildStartedEventArgs (string message, + string helpKeyword, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, null, eventTimestamp, messageArgs) + { } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs index e3bf6c235d..cad96026ff 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildStatusEventArgs.cs @@ -33,7 +33,7 @@ using System; namespace Microsoft.Build.Framework { [Serializable] - public abstract class BuildStatusEventArgs : BuildEventArgs { + public abstract class BuildStatusEventArgs : LazyFormattedBuildEventArgs { protected BuildStatusEventArgs () { @@ -45,7 +45,24 @@ namespace Microsoft.Build.Framework : base (message, helpKeyword, senderName) { } + + protected BuildStatusEventArgs (string message, + string helpKeyword, + string senderName, + DateTime eventTimestamp) + : base (message, helpKeyword, senderName, eventTimestamp) + { + } + + protected BuildStatusEventArgs (string message, + string helpKeyword, + string senderName, + DateTime eventTimestamp, + params object [] messageArgs) + : base (message, helpKeyword, senderName, eventTimestamp, messageArgs) + { + } } } -#endif
\ No newline at end of file +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs new file mode 100644 index 0000000000..b4ce06a39e --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine3.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [MonoTODO] + public interface IBuildEngine3 : IBuildEngine2 + { + BuildEngineResult BuildProjectFilesInParallel ( + string[] projectFileNames, + string[] targetNames, + IDictionary[] globalProperties, + IList<string>[] removeGlobalProperties, + string[] toolsVersion, + bool returnTargetOutputs + ); + void Reacquire (); + void Yield (); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs new file mode 100644 index 0000000000..c2c16b4501 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine4.cs @@ -0,0 +1,15 @@ +#if NET_4_5 +using System; + +namespace Microsoft.Build.Framework +{ + [MonoTODO] + public interface IBuildEngine4 : IBuildEngine3 + { + object GetRegisteredTaskObject (object key, RegisteredTaskObjectLifetime lifetime); + void RegisterTaskObject (object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection); + object UnregisterTaskObject (object key, RegisteredTaskObjectLifetime lifetime); + } +} + +#endif diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs new file mode 100644 index 0000000000..3078c209d1 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IEventRedirector.cs @@ -0,0 +1,10 @@ +using System; + +namespace Microsoft.Build.Framework +{ + public interface IEventRedirector + { + void ForwardEvent (BuildEventArgs buildEvent); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs new file mode 100644 index 0000000000..4b08961e0f --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IForwardingLogger.cs @@ -0,0 +1,15 @@ +using System; + +#if NET_4_0 + +namespace Microsoft.Build.Framework +{ + public interface IForwardingLogger : INodeLogger, ILogger + { + IEventRedirector BuildEventRedirector { get; set; } + int NodeId { get; set; } + } +} + +#endif + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs new file mode 100644 index 0000000000..0d6820b8dc --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + public interface ITaskFactory + { + string FactoryName { get; } + Type TaskType { get; } + void CleanupTask (ITask task); + ITask CreateTask (IBuildEngine taskFactoryLoggingHost); + TaskPropertyInfo [] GetTaskParameters (); + bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs new file mode 100644 index 0000000000..9b53560ec7 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskFactory2.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + public interface ITaskFactory2 : ITaskFactory + { + ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters); + bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost); + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs new file mode 100644 index 0000000000..398578430f --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs @@ -0,0 +1,55 @@ +// +// LazyFormattedBuildEventArgs.cs +// +// Author: +// Atsushi Enomoto <atsushi@xamarin.com> +// +// (C) 2013 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.Threading; + +namespace Microsoft.Build.Framework +{ + [Serializable] + public abstract class LazyFormattedBuildEventArgs : BuildEventArgs + { + + protected LazyFormattedBuildEventArgs () + : this (null, null, null) + { + } + + protected LazyFormattedBuildEventArgs (string message, string helpKeyword, + string senderName) + : this (message, helpKeyword, senderName, DateTime.Now) + { + } + + protected LazyFormattedBuildEventArgs (string message, string helpKeyword, + string senderName, DateTime eventTimestamp, + params object [] messageArgs) + : base (string.Format (message, messageArgs), helpKeyword, senderName, eventTimestamp) + { + } + } +} diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs new file mode 100644 index 0000000000..121107824c --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs @@ -0,0 +1,11 @@ +#if NET_4_5 +namespace Microsoft.Build.Framework +{ + public enum RegisteredTaskObjectLifetime + { + AppDomain, + Build + } +} +#endif + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs new file mode 100644 index 0000000000..a6fbfaaf63 --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/TaskPropertyInfo.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Build.Framework +{ + [Serializable] + public class TaskPropertyInfo + { + public TaskPropertyInfo (string name, Type typeOfParameter, bool output, bool required) + { + Name = name; + PropertyType = typeOfParameter; + Output = output; + Required = required; + } + + public string Name { get; private set; } + public bool Output { get; private set; } + public Type PropertyType { get; private set; } + public bool Required { get; private set; } + } +} + diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources index 45374e536e..b7c639277a 100644 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources +++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework_test.dll.sources @@ -1,5 +1,6 @@ Microsoft.Build.Framework/BuildErrorEventArgsTest.cs Microsoft.Build.Framework/BuildEventArgsTest.cs +Microsoft.Build.Framework/BuildEventContextTest.cs Microsoft.Build.Framework/BuildFinishedEventArgsTest.cs Microsoft.Build.Framework/BuildMessageEventArgsTest.cs Microsoft.Build.Framework/BuildStartedEventArgsTest.cs diff --git a/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs b/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs new file mode 100644 index 0000000000..ea8ff11abd --- /dev/null +++ b/mcs/class/Microsoft.Build.Framework/Test/Microsoft.Build.Framework/BuildEventContextTest.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.Build.Framework; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.Framework +{ + [TestFixture] + public class BuildEventContextTest + { + [Test] + public void Compare () + { + Assert.IsTrue (BuildEventContext.Invalid == BuildEventContext.Invalid, "#1"); + Assert.IsFalse (BuildEventContext.Invalid != BuildEventContext.Invalid, "#2"); + var inst = new BuildEventContext (0, 0, 0, 0); + Assert.IsFalse (BuildEventContext.Invalid == inst, "#3"); + Assert.IsTrue (BuildEventContext.Invalid != inst, "#4"); + Assert.IsFalse (BuildEventContext.Invalid == null, "#5"); + Assert.IsTrue (BuildEventContext.Invalid != null, "#6"); + Assert.IsFalse (BuildEventContext.Invalid.Equals (null), "#7"); + Assert.IsFalse (BuildEventContext.Invalid.Equals (inst), "#8"); + Assert.IsTrue (BuildEventContext.Invalid.Equals (BuildEventContext.Invalid), "#9"); + Assert.IsFalse (inst.Equals (null), "#10"); + Assert.IsTrue (inst.Equals (inst), "#11"); + Assert.IsFalse (inst.Equals (BuildEventContext.Invalid), "#12"); + } + } +} + |