Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b57288
commit 721d110
Showing
3 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,18 +1,23 @@ | |||
using System; | using System.Collections.Generic; | ||
using cake; | using System.Linq; | ||
|
|
||
namespace bs | namespace cake | ||
{ | { | ||
public class ActionScheduler | public class ActionScheduler | ||
{ | { | ||
public void Add(string target, TargetGenerateSettings tgs, string[] dependenciesRequiringRegeneration) | private Dictionary<TargetGenerateSettings, List<string>> _scheduledActions = new Dictionary<TargetGenerateSettings, List<string>>(); | ||
|
|||
public void Add(IEnumerable<string> dependenciesRequiringRegeneration, TargetGenerateSettings tgs) | |||
{ | { | ||
throw new NotImplementedException(); | _scheduledActions.Add(tgs, new List<string>(dependenciesRequiringRegeneration)); | ||
} | } | ||
|
|
||
public TargetGenerateSettings FindJobToRun() | public TargetGenerateSettings FindJobToRun() | ||
{ | { | ||
throw new NotImplementedException(); | var findJobToRun = _scheduledActions.Where(kvp => kvp.Value.Count == 0).Select(kvp=>kvp.Key).FirstOrDefault(); | ||
if (findJobToRun!=null) | |||
_scheduledActions.Remove(findJobToRun); | |||
return findJobToRun; | |||
} | } | ||
} | } | ||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters