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
parent
d0d8779b88
commit
32c7b8c436
|
@ -19,6 +19,9 @@ namespace CitizenMP.Server.Installer
|
||||||
[Option("log", DefaultValue = true, HelpText = "Write a log file \"build.log\" to the output folder.")]
|
[Option("log", DefaultValue = true, HelpText = "Write a log file \"build.log\" to the output folder.")]
|
||||||
public bool WriteLogFile { get; set; }
|
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)]
|
[ValueOption(0)]
|
||||||
public string OutputPath { get; set; }
|
public string OutputPath { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using System.Xml.XPath;
|
||||||
using CommandLine;
|
using CommandLine;
|
||||||
using LibGit2Sharp;
|
using LibGit2Sharp;
|
||||||
using Microsoft.Build.BuildEngine;
|
using Microsoft.Build.BuildEngine;
|
||||||
|
@ -149,7 +151,7 @@ namespace CitizenMP.Server.Installer
|
||||||
|
|
||||||
// Check if we need to update by parsing AssemblyConfigurationAttribute in server assembly.
|
// Check if we need to update by parsing AssemblyConfigurationAttribute in server assembly.
|
||||||
// Should have a space-separated segment saying "CommitHash=<commit hash here>".
|
// Should have a space-separated segment saying "CommitHash=<commit hash here>".
|
||||||
if (binOutputDirectory.Exists)
|
if (!options.ForceBuild && binOutputDirectory.Exists)
|
||||||
{
|
{
|
||||||
var serverBins = binOutputDirectory
|
var serverBins = binOutputDirectory
|
||||||
.EnumerateFiles("*Server.exe", SearchOption.TopDirectoryOnly)
|
.EnumerateFiles("*Server.exe", SearchOption.TopDirectoryOnly)
|
||||||
|
|
Loading…
Reference in New Issue