本文整理汇总了C#中Microsoft.Build.BackEnd.BuildRequestEntry.Continue方法的典型用法代码示例。如果您正苦于以下问题:C# BuildRequestEntry.Continue方法的具体用法?C# BuildRequestEntry.Continue怎么用?C# BuildRequestEntry.Continue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BackEnd.BuildRequestEntry
的用法示例。
在下文中一共展示了BuildRequestEntry.Continue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSimpleStateProgression
public void TestSimpleStateProgression()
{
// Start in Ready
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.Equal(entry.State, BuildRequestEntryState.Ready);
Assert.Equal(entry.Request, request);
Assert.Null(entry.Result);
// Move to active. Should not be any results yet.
IDictionary<int, BuildResult> results = entry.Continue();
Assert.Equal(entry.State, BuildRequestEntryState.Active);
Assert.Null(entry.Result);
Assert.Null(results);
// Wait for results, move to waiting.
BuildRequest waitingRequest = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest);
Assert.Equal(entry.State, BuildRequestEntryState.Waiting);
Assert.Equal(entry.Request, request);
Assert.Null(entry.Result);
// Provide the results, move to ready.
BuildResult requiredResult = new BuildResult(waitingRequest);
requiredResult.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult);
Assert.Equal(entry.State, BuildRequestEntryState.Ready);
Assert.Equal(entry.Request, request);
Assert.Null(entry.Result);
// Continue the build, move to active.
results = entry.Continue();
Assert.Equal(entry.State, BuildRequestEntryState.Active);
Assert.Null(entry.Result);
Assert.Equal(results.Count, 1);
Assert.True(results.ContainsKey(requiredResult.NodeRequestId));
Assert.Equal(results[requiredResult.NodeRequestId], requiredResult);
// Complete the build, move to completed.
BuildResult result = new BuildResult(request);
result.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
entry.Complete(result);
Assert.Equal(entry.State, BuildRequestEntryState.Complete);
Assert.NotNull(entry.Result);
Assert.Equal(entry.Result, result);
}
示例2: TestResultsWithNoMatch1
public void TestResultsWithNoMatch1()
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
entry.Continue();
Assert.AreEqual(entry.State, BuildRequestEntryState.Active);
BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest1);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
BuildRequest randomRequest = CreateNewBuildRequest(3, new string[0]);
BuildResult requiredResult = new BuildResult(randomRequest);
requiredResult.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
}
示例3: TestMixedWaitingRequests
public void TestMixedWaitingRequests()
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
entry.Continue();
Assert.AreEqual(entry.State, BuildRequestEntryState.Active);
BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest1);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
BuildRequest waitingRequest2 = CreateNewBuildRequest(-1, new string[1] { "xor" });
entry.WaitForResult(waitingRequest2);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
Assert.IsNull(entry.GetRequestsToIssueIfReady(), "Entry should not be ready to issue because there are unresolved configurations");
entry.ResolveConfigurationRequest(-1, 3);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
BuildResult requiredResult1 = new BuildResult(waitingRequest1);
requiredResult1.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult1);
Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
BuildResult requiredResult2 = new BuildResult(waitingRequest2);
requiredResult2.AddResultsForTarget("xor", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult2);
Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
}
示例4: BuildRequest
/// <summary>
/// Build a request entry
/// </summary>
/// <param name="entry"></param>
public void BuildRequest(NodeLoggingContext nodeLoggingContext, BuildRequestEntry entry)
{
_requestedEntry = entry;
if (null == _requestedEntry.RequestConfiguration.Project)
{
Project mockProject = new Project(XmlReader.Create(new System.IO.StringReader(
@"<Project ToolsVersion='4.0' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='t'>
</Target>
</Project>")));
_requestedEntry.RequestConfiguration.Project = mockProject.CreateProjectInstance();
}
_currentProjectDefinition = _testDataProvider[_requestedEntry.Request.ConfigurationId];
_requestedEntry.Continue();
_builderThread = new Thread(BuilderThreadProc);
_builderThread.Name = "Builder Thread for Request: " + entry.Request.ConfigurationId.ToString();
_builderThread.Start();
}
示例5: TestNoCompleteToWaiting
public void TestNoCompleteToWaiting()
{
Assert.Throws<InternalErrorException>(() =>
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
Assert.Equal(entry.State, BuildRequestEntryState.Ready);
entry.Continue();
Assert.Equal(entry.State, BuildRequestEntryState.Active);
BuildResult requiredResult = new BuildResult(request);
requiredResult.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
entry.Complete(requiredResult);
Assert.Equal(entry.State, BuildRequestEntryState.Complete);
BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest1);
}
);
}
示例6: TestMultipleWaitingRequests
public void TestMultipleWaitingRequests()
{
BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
BuildRequestData data1 = new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null);
BuildRequestConfiguration config = new BuildRequestConfiguration(1, data1, "2.0");
BuildRequestEntry entry = new BuildRequestEntry(request, config);
entry.Continue();
Assert.Equal(entry.State, BuildRequestEntryState.Active);
BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
entry.WaitForResult(waitingRequest1);
Assert.Equal(entry.State, BuildRequestEntryState.Waiting);
BuildRequest waitingRequest2 = CreateNewBuildRequest(2, new string[1] { "xor" });
entry.WaitForResult(waitingRequest2);
Assert.Equal(entry.State, BuildRequestEntryState.Waiting);
BuildResult requiredResult1 = new BuildResult(waitingRequest1);
requiredResult1.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult1);
Assert.Equal(entry.State, BuildRequestEntryState.Waiting);
BuildResult requiredResult2 = new BuildResult(waitingRequest2);
requiredResult2.AddResultsForTarget("xor", TestUtilities.GetEmptySucceedingTargetResult());
entry.ReportResult(requiredResult2);
Assert.Equal(entry.State, BuildRequestEntryState.Ready);
}
示例7: BuildRequest
/// <summary>
/// Starts a build request
/// </summary>
/// <param name="loggingContext">The logging context for the node.</param>
/// <param name="entry">The entry to build.</param>
public void BuildRequest(NodeLoggingContext loggingContext, BuildRequestEntry entry)
{
ErrorUtilities.VerifyThrowArgumentNull(loggingContext, "loggingContext");
ErrorUtilities.VerifyThrowArgumentNull(entry, "entry");
ErrorUtilities.VerifyThrow(null != _componentHost, "Host not set.");
ErrorUtilities.VerifyThrow(_targetBuilder == null, "targetBuilder not null");
ErrorUtilities.VerifyThrow(_nodeLoggingContext == null, "nodeLoggingContext not null");
ErrorUtilities.VerifyThrow(_requestEntry == null, "requestEntry not null");
ErrorUtilities.VerifyThrow(!_terminateEvent.WaitOne(0), "Cancel already called");
_nodeLoggingContext = loggingContext;
_blockType = BlockType.Unblocked;
_requestEntry = entry;
_requestEntry.Continue();
_continueResults = null;
_targetBuilder = (ITargetBuilder)_componentHost.GetComponent(BuildComponentType.TargetBuilder);
VerifyEntryInActiveState();
InitializeOperatingEnvironment();
StartBuilderThread();
}
示例8: BuildRequest
public void BuildRequest(NodeLoggingContext context, BuildRequestEntry entry)
{
Assert.Null(_builderThread); // "Received BuildRequest while one was in progress"
_continueEvent = new AutoResetEvent(false);
_cancelEvent = new AutoResetEvent(false);
_entry = entry;
entry.Continue();
_builderThread = new Thread(BuilderThreadProc);
_builderThread.Start();
}