Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATCH to indicate RC, Updated Version responses #1643

Merged
merged 4 commits into from Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Expand Up @@ -4,9 +4,6 @@ project (nano-node)
set (CPACK_PACKAGE_VERSION_MAJOR "18")
set (CPACK_PACKAGE_VERSION_MINOR "0")
set (CPACK_PACKAGE_VERSION_PATCH "0")
if (DEFINED GIT_COMMIT)
set (CPACK_PACKAGE_VERSION_PATCH "GIT-${GIT_COMMIT}")
endif ()
set (CPACK_PACKAGE_VENDOR "Nano Currency")

set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
Expand Down Expand Up @@ -307,7 +304,10 @@ if (NANO_GUI OR RAIBLOCKS_GUI)
target_compile_definitions(qt
PRIVATE
-DNANO_VERSION_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR}
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR})
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR}
-DNANO_VERSION_PATCH=${CPACK_PACKAGE_VERSION_PATCH}
-DNANO_MAJOR_MINOR_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
-DNANO_MAJOR_MINOR_RC_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}RC${CPACK_PACKAGE_VERSION_PATCH}")

if (WIN32)
set (PLATFORM_GUI_TARGET_PROPERTIES WIN32)
Expand Down
4 changes: 1 addition & 3 deletions appveyor.yml
Expand Up @@ -13,11 +13,9 @@ environment:
clone_folder: C:\projects\myproject
install:
- cmd: >-
SET GIT_COMMIT=%APPVEYOR_REPO_COMMIT:~0,3%

git submodule update --init --recursive

cmake -DNANO_GUI=ON -DACTIVE_NETWORK=%NETWORK% -DQt5_DIR="C:\Qt\5.9\msvc2017_64\lib\cmake\Qt5" -DNANO_SIMD_OPTIMIZATIONS=TRUE -DBoost_COMPILER="-vc141" -DBOOST_ROOT="C:/Libraries/boost_1_66_0" -DBOOST_LIBRARYDIR="C:/Libraries/boost_1_66_0/lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -DIPHLPAPI_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/iphlpapi.lib" -DWINSOCK2_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/WS2_32.lib" -DGIT_COMMIT=%GIT_COMMIT%
cmake -DNANO_GUI=ON -DACTIVE_NETWORK=%NETWORK% -DQt5_DIR="C:\Qt\5.9\msvc2017_64\lib\cmake\Qt5" -DNANO_SIMD_OPTIMIZATIONS=TRUE -DBoost_COMPILER="-vc141" -DBOOST_ROOT="C:/Libraries/boost_1_66_0" -DBOOST_LIBRARYDIR="C:/Libraries/boost_1_66_0/lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -DIPHLPAPI_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/iphlpapi.lib" -DWINSOCK2_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/WS2_32.lib"



Expand Down
5 changes: 4 additions & 1 deletion nano/core_test/CMakeLists.txt
Expand Up @@ -26,5 +26,8 @@ add_executable (core_test
target_compile_definitions(core_test
PRIVATE
-DNANO_VERSION_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR}
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR})
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR}
-DNANO_VERSION_PATCH=${CPACK_PACKAGE_VERSION_PATCH}
-DNANO_MAJOR_MINOR_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
-DNANO_MAJOR_MINOR_RC_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}RC${CPACK_PACKAGE_VERSION_PATCH}")
target_link_libraries (core_test node secure gtest_main gtest libminiupnpc-static Boost::boost)
9 changes: 8 additions & 1 deletion nano/core_test/rpc.cpp
Expand Up @@ -1713,7 +1713,14 @@ TEST (rpc, version)
ASSERT_EQ (std::to_string (node1->store.version_get (transaction)), response1.json.get<std::string> ("store_version"));
}
ASSERT_EQ (std::to_string (nano::protocol_version), response1.json.get<std::string> ("protocol_version"));
ASSERT_EQ (boost::str (boost::format ("Nano %1%.%2%") % NANO_VERSION_MAJOR % NANO_VERSION_MINOR), response1.json.get<std::string> ("node_vendor"));
if (NANO_VERSION_PATCH == 0)
{
ASSERT_EQ (boost::str (boost::format ("Nano %1%") % NANO_MAJOR_MINOR_VERSION), response1.json.get<std::string> ("node_vendor"));
}
else
{
ASSERT_EQ (boost::str (boost::format ("Nano %1%") % NANO_MAJOR_MINOR_RC_VERSION), response1.json.get<std::string> ("node_vendor"));
}
auto headers (response1.resp.base ());
auto allowed_origin (headers.at ("Access-Control-Allow-Origin"));
auto allowed_headers (headers.at ("Access-Control-Allow-Headers"));
Expand Down
5 changes: 4 additions & 1 deletion nano/nano_node/CMakeLists.txt
Expand Up @@ -14,7 +14,10 @@ target_link_libraries (nano_node
target_compile_definitions(nano_node
PRIVATE
-DNANO_VERSION_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR}
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR})
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR}
-DNANO_VERSION_PATCH=${CPACK_PACKAGE_VERSION_PATCH}
-DNANO_MAJOR_MINOR_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
-DNANO_MAJOR_MINOR_RC_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}RC${CPACK_PACKAGE_VERSION_PATCH}")

set_target_properties (nano_node
PROPERTIES
Expand Down
10 changes: 9 additions & 1 deletion nano/nano_node/entry.cpp
@@ -1,6 +1,7 @@
#include <nano/lib/utility.hpp>
#include <nano/nano_node/daemon.hpp>
#include <nano/node/cli.hpp>
#include <nano/node/common.hpp>
#include <nano/node/node.hpp>
#include <nano/node/rpc.hpp>
#include <nano/node/testing.hpp>
Expand Down Expand Up @@ -815,7 +816,14 @@ int main (int argc, char * const * argv)
}
else if (vm.count ("version"))
{
std::cout << "Version " << NANO_VERSION_MAJOR << "." << NANO_VERSION_MINOR << std::endl;
if (NANO_VERSION_PATCH == 0)
{
std::cout << "Version " << NANO_MAJOR_MINOR_VERSION << std::endl;
}
else
{
std::cout << "Version " << NANO_MAJOR_MINOR_RC_VERSION << std::endl;
}
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion nano/node/CMakeLists.txt
Expand Up @@ -70,4 +70,7 @@ target_link_libraries (node
target_compile_definitions(node
PRIVATE
-DNANO_VERSION_MAJOR=${CPACK_PACKAGE_VERSION_MAJOR}
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR})
-DNANO_VERSION_MINOR=${CPACK_PACKAGE_VERSION_MINOR}
-DNANO_VERSION_PATCH=${CPACK_PACKAGE_VERSION_PATCH}
-DNANO_MAJOR_MINOR_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
-DNANO_MAJOR_MINOR_RC_VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}RC${CPACK_PACKAGE_VERSION_PATCH}")
10 changes: 9 additions & 1 deletion nano/node/node.cpp
Expand Up @@ -1748,7 +1748,15 @@ startup_time (std::chrono::steady_clock::now ())
}
}
});
BOOST_LOG (log) << "Node starting, version: " << NANO_VERSION_MAJOR << "." << NANO_VERSION_MINOR;
if (NANO_VERSION_PATCH == 0)
{
BOOST_LOG (log) << "Node starting, version: " << NANO_MAJOR_MINOR_VERSION;
}
else
{
BOOST_LOG (log) << "Node starting, version: " << NANO_MAJOR_MINOR_RC_VERSION;
}

BOOST_LOG (log) << boost::str (boost::format ("Work pool running %1% threads") % work.threads.size ());
if (!init_a.error ())
{
Expand Down
9 changes: 8 additions & 1 deletion nano/node/rpc.cpp
Expand Up @@ -3094,7 +3094,14 @@ void nano::rpc_handler::version ()
response_l.put ("rpc_version", "1");
response_l.put ("store_version", std::to_string (node.store_version ()));
response_l.put ("protocol_version", std::to_string (nano::protocol_version));
response_l.put ("node_vendor", boost::str (boost::format ("Nano %1%.%2%") % NANO_VERSION_MAJOR % NANO_VERSION_MINOR));
if (NANO_VERSION_PATCH == 0)
{
response_l.put ("node_vendor", boost::str (boost::format ("Nano %1%") % NANO_MAJOR_MINOR_VERSION));
}
else
{
response_l.put ("node_vendor", boost::str (boost::format ("Nano %1%") % NANO_MAJOR_MINOR_RC_VERSION));
}
response_errors ();
}

Expand Down
9 changes: 8 additions & 1 deletion nano/qt/qt.cpp
Expand Up @@ -81,7 +81,14 @@ wallet (wallet_a)
{
network = "Test";
}
version = new QLabel (boost::str (boost::format ("Version %1%.%2% %3% network") % NANO_VERSION_MAJOR % NANO_VERSION_MINOR % network).c_str ());
if (NANO_VERSION_PATCH == 0)
{
version = new QLabel (boost::str (boost::format ("Version %1% %2% network") % NANO_MAJOR_MINOR_VERSION % network).c_str ());
}
else
{
version = new QLabel (boost::str (boost::format ("Version %1% %2% network") % NANO_MAJOR_MINOR_RC_VERSION % network).c_str ());
}
self_layout->addWidget (your_account_label);
self_layout->addStretch ();
self_layout->addWidget (version);
Expand Down