MXS-1942: Use MaxScale version in MaxCtrl

Displaying the MaxScale version helps identify which package the
executable was bundled with. As the MaxCtrl source is a part of MaxScale,
there's no need for separate versioning.
This commit is contained in:
Markus Mäkelä 2018-07-05 10:57:09 +03:00
parent 9e039ed024
commit f5110209f7
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 20 additions and 1 deletions

View File

@ -3,6 +3,9 @@ if (BUILD_MAXCTRL)
find_package(NodeJS)
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

View File

@ -14,7 +14,9 @@
var fs = require('fs')
var program = require('yargs');
const maxctrl_version = '1.0.0';
// Note: The version.js file is generated at configuation time. If you are
// building in-source, manually create the file
const maxctrl_version = require('./version.js').version;
program
.version(maxctrl_version)

14
maxctrl/lib/version.js.in Normal file
View File

@ -0,0 +1,14 @@
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2020-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
exports.version = "@MAXSCALE_VERSION@"