Skip to content

Instantly share code, notes, and snippets.

@wekempf
Created October 13, 2016 16:31
Show Gist options
  • Save wekempf/cf029b93abf2399a6a4dee89386df2e2 to your computer and use it in GitHub Desktop.
Save wekempf/cf029b93abf2399a6a4dee89386df2e2 to your computer and use it in GitHub Desktop.
Cake build script for Wyam.
#tool nuget:?package=Wyam&prerelease
#addin nuget:?package=Cake.Wyam&prerelease
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var isLocal = BuildSystem.IsLocalBuild;
var isRunningOnUnix = IsRunningOnUnix();
var isRunningOnWindows = IsRunningOnWindows();
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Build")
.Does(() =>
{
Wyam(new WyamSettings
{
Recipe = "Blog",
Theme = "CleanBlog"
});
});
Task("Preview")
.Does(() =>
{
Wyam(new WyamSettings
{
Recipe = "Blog",
Theme = "CleanBlog",
Preview = true,
Watch = true
});
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Preview");
Task("AppVeyor")
.IsDependentOn("Build");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment