Added --force option to enforce builds even for up-to-date servers.

I am mostly using this for debugging reasons since I'm tired of manually deleting folders.
develop
Icedream 2015-01-19 09:31:57 +01:00
parent d0d8779b88
commit 32c7b8c436
2 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,9 @@ namespace CitizenMP.Server.Installer
[Option("log", DefaultValue = true, HelpText = "Write a log file \"build.log\" to the output folder.")]
public bool WriteLogFile { get; set; }
[Option("force", DefaultValue = false, HelpText = "Enforce rebuilding the server even if the server's version is up-to-date.")]
public bool ForceBuild { get; set; }
[ValueOption(0)]
public string OutputPath { get; set; }

View File

@ -6,6 +6,8 @@ using System.Linq;
using System.Net;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System.Xml.XPath;
using CommandLine;
using LibGit2Sharp;
using Microsoft.Build.BuildEngine;
@ -149,7 +151,7 @@ namespace CitizenMP.Server.Installer
// Check if we need to update by parsing AssemblyConfigurationAttribute in server assembly.
// Should have a space-separated segment saying "CommitHash=<commit hash here>".
if (binOutputDirectory.Exists)
if (!options.ForceBuild && binOutputDirectory.Exists)
{
var serverBins = binOutputDirectory
.EnumerateFiles("*Server.exe", SearchOption.TopDirectoryOnly)