Skip to content

Commit bbc7292

Browse files
committed
Implement IBuildEngine4 in the TaskRunner.
1 parent 7ec133b commit bbc7292

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

src/TaskRunner/BuildEngine.cs

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System;
22
using System.Collections;
3+
using System.Collections.Generic;
34
using Microsoft.Build.Framework;
45

56
namespace TaskRunner
67
{
7-
public class BuildEngine : IBuildEngine
8+
public class BuildEngine : IBuildEngine4
89
{
910
public int ColumnNumberOfTaskNode => 0;
1011

@@ -14,9 +15,26 @@ public class BuildEngine : IBuildEngine
1415

1516
public string ProjectFileOfTaskNode => null;
1617

18+
public bool IsRunningMultipleNodes => false;
19+
1720
public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs)
1821
{
19-
throw new NotImplementedException();
22+
throw new NotImplementedException(nameof(BuildProjectFile));
23+
}
24+
25+
public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs, string toolsVersion)
26+
{
27+
throw new NotImplementedException(nameof(BuildProjectFile));
28+
}
29+
30+
public BuildEngineResult BuildProjectFilesInParallel(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<string>[] removeGlobalProperties, string[] toolsVersion, bool returnTargetOutputs)
31+
{
32+
throw new NotImplementedException(nameof(BuildProjectFilesInParallel));
33+
}
34+
35+
public bool BuildProjectFilesInParallel(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IDictionary[] targetOutputsPerProject, string[] toolsVersion, bool useResultsCache, bool unloadProjectsOnCompletion)
36+
{
37+
throw new NotImplementedException(nameof(BuildProjectFilesInParallel));
2038
}
2139

2240
public void LogCustomEvent(CustomBuildEventArgs e)
@@ -38,5 +56,35 @@ public void LogWarningEvent(BuildWarningEventArgs e)
3856
{
3957
Console.WriteLine(e.Message);
4058
}
59+
60+
public void Reacquire()
61+
{
62+
throw new NotImplementedException(nameof(Reacquire));
63+
}
64+
65+
public void Yield()
66+
{
67+
throw new NotImplementedException(nameof(Yield));
68+
}
69+
70+
private Dictionary<object, object> registeredTaskObjects = new Dictionary<object, object>();
71+
72+
public void RegisterTaskObject(object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection)
73+
{
74+
registeredTaskObjects[key] = obj;
75+
}
76+
77+
public object GetRegisteredTaskObject(object key, RegisteredTaskObjectLifetime lifetime)
78+
{
79+
registeredTaskObjects.TryGetValue(key, out var value);
80+
return value;
81+
}
82+
83+
public object UnregisterTaskObject(object key, RegisteredTaskObjectLifetime lifetime)
84+
{
85+
registeredTaskObjects.TryGetValue(key, out var value);
86+
registeredTaskObjects.Remove(key);
87+
return value;
88+
}
4189
}
4290
}

0 commit comments

Comments
 (0)