version: use MONERO_VERSION_FULL const as monero core version

This commit is contained in:
xiphon 2020-07-10 13:37:04 +00:00
parent c137a6ea36
commit 36262f029a
6 changed files with 15 additions and 14 deletions

View file

@ -100,11 +100,8 @@ fi
# force version update
get_tag
echo "var GUI_VERSION = \"$TAGNAME\"" > version.js
pushd "$MONERO_DIR"
get_tag
popd
echo "var GUI_MONERO_VERSION = \"$TAGNAME\"" >> version.js
GUI_VERSION=$(echo "$TAGNAME" | sed 's/^v\([[:digit:]]\)/\1/')
echo "var GUI_VERSION = \"$GUI_VERSION\"" > version.js
cd build
if ! QMAKE=$(find_command qmake qmake-qt5); then

View file

@ -26,24 +26,24 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
function (write_static_version_header VERSION_TAG_GUI VERSION_TAG_CORE)
function (write_static_version_header VERSION_TAG_GUI)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/version.js.in" "${CMAKE_CURRENT_SOURCE_DIR}/version.js")
endfunction ()
find_package(Git QUIET)
if ("$Format:$" STREQUAL "")
# We're in a tarball; use hard-coded variables.
write_static_version_header("release" "release")
write_static_version_header("release")
elseif (GIT_FOUND OR Git_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
include(GitGetVersionTag)
git_get_version_tag(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} VERSION_TAG_GUI)
git_get_version_tag(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/monero VERSION_TAG_CORE)
write_static_version_header(${VERSION_TAG_GUI} ${VERSION_TAG_CORE})
STRING(REGEX REPLACE "^v([0-9])" "\\1" VERSION_TAG_GUI ${VERSION_TAG_GUI})
write_static_version_header(${VERSION_TAG_GUI})
else()
message(STATUS "WARNING: Git was not found!")
write_static_version_header("unknown" "unknown")
write_static_version_header("unknown")
endif ()
add_custom_target(genversiongui ALL
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/version.js")

View file

@ -567,7 +567,7 @@ DISTFILES += \
VERSION = $$cat('version.js', lines)
VERSION = $$find(VERSION, 'GUI_VERSION')
VERSION_LONG = $$replace(VERSION, '.*\"v(.*)\"', '\1')
VERSION_LONG = $$replace(VERSION, '.*\"(.*)\"', '\1')
VERSION = $$replace(VERSION, '.*(\d+\.\d+\.\d+\.\d+).*', '\1')
# windows application icon

View file

@ -103,7 +103,7 @@ Rectangle {
MoneroComponents.TextBlock {
font.pixelSize: 14
color: MoneroComponents.Style.dimmedFontColor
text: Version.GUI_MONERO_VERSION + translationManager.emptyString
text: moneroVersion
}
Rectangle {
@ -390,7 +390,7 @@ Rectangle {
onClicked: {
var data = "";
data += "GUI version: " + Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")";
data += "\nEmbedded Monero version: " + Version.GUI_MONERO_VERSION;
data += "\nEmbedded Monero version: " + moneroVersion;
data += "\nWallet path: " + walletLocation.walletPath;
data += "\nWallet creation height: ";

View file

@ -38,6 +38,9 @@
#include <QScreen>
#include <QRegExp>
#include <QThread>
#include <version.h>
#include "clipboardAdapter.h"
#include "filter.h"
#include "oscursor.h"
@ -499,6 +502,8 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
#endif
engine.rootContext()->setContextProperty("builtWithScanner", builtWithScanner);
engine.rootContext()->setContextProperty("moneroVersion", MONERO_VERSION_FULL);
Network network;
engine.rootContext()->setContextProperty("Network", &network);

View file

@ -1,2 +1 @@
var GUI_VERSION = "@VERSION_TAG_GUI@";
var GUI_MONERO_VERSION = "@VERSION_TAG_CORE@";