-
I have a situation where I need to run restores for dotnet, npm and bower during a build. I was thinking of using build components for this because we have other projects that have these same requirements. Originally I thought of something like below. interface IRestore
{
Target Restore => _ => _.Executes(() => Log.Information("Base restore"));
}
interface IDotNetRestore : IRestore
{
Target IRestore.Restore => _ => _
.Inherits<IRestore>()
.Executes(() => Log.Information("DotNet restore"));
}
interface INpmRestore : IRestore
{
Target IRestore.Restore => _ => _
.Inherits<IRestore>()
.Executes(() => Log.Information("Npm restore"));
}
class Build : NukeBuild, INpmRestore, IDotNetRestore
{
Target RestoreTask => _ => _.DependsOn<IRestore>();
} But that runs into c# problems where it doesn't know which Maybe Im doing something dumb or I just don't understand the nuke api well enough yet, but is there a way to achieve my goal or maybe a better recommendation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should introduce separate targets for that – One example could work like this (for illustration without components):
|
Beta Was this translation helpful? Give feedback.
You should introduce separate targets for that –
RestoreDotNet
,RestoreNpm
, ...One example could work like this (for illustration without components):