Skip to content

Instantly share code, notes, and snippets.

@patriksvensson
Last active August 29, 2015 14:26
Show Gist options
  • Save patriksvensson/b58652071427973a898b to your computer and use it in GitHub Desktop.
Save patriksvensson/b58652071427973a898b to your computer and use it in GitHub Desktop.
GitReleaseManager
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var config = Argument("config", "Debug");
//////////////////////////////////////////////////////////////////////
// DIRECTORIES
//////////////////////////////////////////////////////////////////////
var rootDirectory = Directory("../");
var buildScriptDirectory = Directory("./");
var artifactsPath = rootDirectory + Directory("BuildArtifacts");
var sourceDirectory = rootDirectory + Directory("Source");
///////////////////////////////////////////////////////////////////////////////
// DIAGNOSTICS
///////////////////////////////////////////////////////////////////////////////
Task("Show-Info")
.Does(() =>
{
// Output arguments.
Information("Configuration: {0}", config);
// Output directories.
Information("Root: {0}", MakeAbsolute(rootDirectory));
Information("Build scripts: {0}", MakeAbsolute(buildScriptDirectory));
Information("Artifacts: {0}", MakeAbsolute(artifactsPath));
Information("Source directory: {0}", MakeAbsolute(sourceDirectory));
});
//////////////////////////////////////////////////////////////////////
// PRIVATE TASKS
//////////////////////////////////////////////////////////////////////
Task("__EchoAppVeyorEnvironmentVariables")
.WithCriteria(AppVeyor.IsRunningOnAppVeyor);
Task("__VerifyConfiguration");
Task("__CreateBuildArtifactsDirectory");
Task("__RemoveBuildArtifactsDirectory");
Task("__InstallChocolatey");
Task("__InstallReSharperCommandLineTools");
Task("__UpdateReSharperCommandLineTools");
Task("__InstallPSBuild");
Task("__InstallGitVersion");
Task("__UpdateGitVersion");
//////////////////////////////////////////////////////////////////////
// PRIMARY TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("RebuildSolution");
Task("PackageSolution")
.Description("Complete build, including creation of Chocolatey Package.")
.IsDependentOn("RebuildSolution")
.IsDependentOn("PackageChocolatey");
Task("InspectCodeForProblems")
.Description("Complete build, including running dupfinder, and inspectcode.")
.IsDependentOn("PackageSolution")
.IsDependentOn("RunDupFinder")
.IsDependentOn("RunInspectCode");
Task("DeployDevelopSolutionToMyGet")
.Description("Complete build, including creation of Chocolatey Package and Deployment to MyGet.org")
.IsDependentOn("InspectCodeForProblems")
.IsDependentOn("DeployDevelopPackageToMyGet");
Task("DeployMasterSolutionToMyGet")
.Description("Complete build, including creation of Chocolatey Package and Deployment to MyGet.org")
.IsDependentOn("InspectCodeForProblems")
.IsDependentOn("DeployMasterPackageToMyGet");
Task("DeploySolutionToChocolatey")
.Description("Complete build, including creation of Chocolatey Package and Deployment to Chocolatey.org.")
.IsDependentOn("InspectCodeForProblems")
.IsDependentOn("DeployPackageToChocolateyAndNuGet");
//////////////////////////////////////////////////////////////////////
// BUILD TASKS
//////////////////////////////////////////////////////////////////////
Task("RunGitVersion")
.IsDependentOn("__InstallGitVersion");
Task("RunInspectCode")
.IsDependentOn("__InstallReSharperCommandLineTools");
Task("RunDupFinder")
.IsDependentOn("__InstallReSharperCommandLineTools");
Task("OutputNugetVersion");
Task("NugetPackageRestore")
.IsDependentOn("OutputNugetVersion");
Task("BuildSolution")
.IsDependentOn("__RemoveBuildArtifactsDirectory")
.IsDependentOn("__VerifyConfiguration")
.IsDependentOn("__InstallPSBuild")
.IsDependentOn("__EchoAppVeyorEnvironmentVariables")
.IsDependentOn("RunGitVersion")
.IsDependentOn("NugetPackageRestore");
Task("RunCodeCoverage");
Task("RebuildSolution")
.IsDependentOn("CleanSolution")
.IsDependentOn("__CreateBuildArtifactsDirectory")
.IsDependentOn("BuildSolution")
.IsDependentOn("RunCodeCoverage");
Task("CleanSolution")
.IsDependentOn("__InstallPSBuild")
.IsDependentOn("__RemoveBuildArtifactsDirectory")
.IsDependentOn("__VerifyConfiguration");
//////////////////////////////////////////////////////////////////////
// PACKAGING TASKS
//////////////////////////////////////////////////////////////////////
Task("PackageChocolatey");
Task("DeployDevelopPackageToMyGet");
Task("DeployMasterPackageToMyGet");
Task("DeployPackageToChocolateyAndNuGet");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment