Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
agc93 committed Aug 10, 2017
1 parent 2616cc1 commit 2f1d2b6
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions build.cake
@@ -0,0 +1,70 @@
#addin nuget:?package=Cake.Yarn
#addin nuget:?package=Cake.Npm
#addin nuget:?package=Cake.Gulp
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////
Setup(ctx =>
{
// Executed BEFORE the first task.
Information("Running tasks...");
});
Teardown(ctx =>
{
// Executed AFTER the last task.
Information("Finished running tasks.");
});

///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////

Task("Install")
.Does(() => {
Yarn.Install();
});

Task("Static")
.Does(() => {
Gulp.Local.Execute(s => s.WithArguments("static"));
});

Task("Run-Unit-Tests")
.IsDependentOn("Static")
.Does(() => {
NpmRunScript("test");
});

Task("Prepublish")
.Does(() => {
Gulp.Local.Execute(s => s.WithArguments("prepublish"));
});

Task("Pack")
.Does(() => {
NpmPack();
});

Task("Default")
.IsDependentOn("Install")
.IsDependentOn("Run-Unit-Tests");

Task("Publish")
.IsDependentOn("Install")
.IsDependentOn("Run-Unit-Tests")
.IsDependentOn("Prepublish")
.Does(() => {
NpmPublish();
});


RunTarget(target);

0 comments on commit 2f1d2b6

Please sign in to comment.