mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 18:06:03 +00:00
Get rid of svnversion.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2024 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "JSInterface_Debug.h"
|
||||
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/svn_revision.h"
|
||||
#include "lib/build_version.h"
|
||||
#include "lib/debug.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptRequest.h"
|
||||
@@ -75,17 +75,17 @@ double GetBuildTimestamp()
|
||||
return std::time(nullptr);
|
||||
}
|
||||
|
||||
// Return the revision number at which the current executable was compiled.
|
||||
// - svn revision is generated by calling svnversion and cached in
|
||||
// lib/svn_revision.cpp. it is useful to know when attempting to
|
||||
// reproduce bugs (the main EXE and PDB should be temporarily reverted to
|
||||
// that revision so that they match user-submitted crashdumps).
|
||||
std::wstring GetBuildRevision()
|
||||
// Return the build version of the current executable.
|
||||
// - in nightly builds, build version is generated from the git HEAD branch and
|
||||
// hash and cached in lib/build_version.cpp. it is useful to know when attempting
|
||||
// to reproduce bugs (the main EXE and PDB should be temporarily reverted to
|
||||
// that commit so that they match user-submitted crashdumps).
|
||||
std::wstring GetBuildVersion()
|
||||
{
|
||||
std::wstring svnRevision(svn_revision);
|
||||
if (svnRevision == L"custom build")
|
||||
std::wstring buildVersion(build_version);
|
||||
if (buildVersion == L"custom build")
|
||||
return wstring_from_utf8(g_L10n.Translate("custom build"));
|
||||
return svnRevision;
|
||||
return buildVersion;
|
||||
}
|
||||
|
||||
void RegisterScriptFunctions(const ScriptRequest& rq)
|
||||
@@ -96,6 +96,6 @@ void RegisterScriptFunctions(const ScriptRequest& rq)
|
||||
ScriptFunction::Register<&DisplayErrorDialog>(rq, "DisplayErrorDialog");
|
||||
ScriptFunction::Register<&GetBuildDate>(rq, "GetBuildDate");
|
||||
ScriptFunction::Register<&GetBuildTimestamp>(rq, "GetBuildTimestamp");
|
||||
ScriptFunction::Register<&GetBuildRevision>(rq, "GetBuildRevision");
|
||||
ScriptFunction::Register<&GetBuildVersion>(rq, "GetBuildVersion");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user