using Hast.Common.Interfaces; using Hast.Layer; using Hast.Synthesis.Delegates; using Hast.Synthesis.Models; using System.Collections.Generic; using System.Threading.Tasks; namespace Hast.Synthesis.Services; /// /// If returns it performs any build actions and fills in the given by the . /// public interface IHardwareImplementationComposerBuildProvider : IRequirement, IProgressInvoker, IDependency { /// /// Gets the functions installed by other providers. If any of them returns this provider is /// skipped. /// IDictionary Shortcuts { get; } /// /// Determines if the instance is applicable to the current composition task based on the . /// bool CanCompose(IHardwareImplementationCompositionContext context); /// /// Performs the building and sets up the . /// Task BuildAsync(IHardwareImplementationCompositionContext context, IHardwareImplementation implementation); /// /// If implemented, it adds to the of other instances. /// void AddShortcuts(IEnumerable providers) { // The default behavior is to do nothing. } /// /// If implemented, it performs cleanup tasks and removes temporary resources. This is deferred until all build /// providers have finished. /// Task CleanupAsync(IHardwareImplementationCompositionContext context) => Task.CompletedTask; } /// /// Exposes the Progress event. /// public interface IProgressInvoker { /// /// Invokes the progress event, if any. /// void InvokeProgress(BuildProgressEventArgs eventArgs); }