diff --git a/build.cake b/build.cake index ea262f37..dfcac9d4 100644 --- a/build.cake +++ b/build.cake @@ -38,7 +38,7 @@ Dependencies.Add("ExeToProcessWithNativeAndEmbeddedMixed"); Dependencies.Add("Costura.Template"); Components.Add("Costura.Fody"); -Dependencies.Add("Costura"); +Components.Add("Costura"); TestProjects.Add("Costura.Fody.Tests"); diff --git a/deployment/cake/lib-generic.cake b/deployment/cake/lib-generic.cake index 4b5fd12f..f0d3c15f 100644 --- a/deployment/cake/lib-generic.cake +++ b/deployment/cake/lib-generic.cake @@ -516,6 +516,12 @@ private static bool ShouldProcessProject(BuildContext buildContext, string proje return true; } + if (ShouldBuildProject(buildContext, projectName)) + { + // Always build + return true; + } + // Experimental mode where we ignore projects that are not on the deploy list when not in CI mode, but // it can only work if they are not part of unit tests (but that should never happen) // if (buildContext.Tests.Items.Count == 0) @@ -532,6 +538,21 @@ private static bool ShouldProcessProject(BuildContext buildContext, string proje //------------------------------------------------------------- +private static bool ShouldBuildProject(BuildContext buildContext, string projectName) +{ + // Allow the build server to configure this via "Build[ProjectName]" + var slug = GetProjectSlug(projectName); + var keyToCheck = string.Format("Build{0}", slug); + + var shouldBuild = buildContext.BuildServer.GetVariableAsBool(keyToCheck, true); + + buildContext.CakeContext.Information($"Value for '{keyToCheck}': {shouldBuild}"); + + return shouldBuild; +} + +//------------------------------------------------------------- + private static bool ShouldDeployProject(BuildContext buildContext, string projectName) { // Allow the build server to configure this via "Deploy[ProjectName]"