From f4529454df43364604c617ef7c5decebebe81b70 Mon Sep 17 00:00:00 2001 From: Ion Savin Date: Tue, 4 Mar 2014 11:31:27 +0200 Subject: [PATCH] HRCPP-132 Update the version and add mapping to assembly versioning --- CMakeLists.txt | 28 ++++++++++++++++++++++++---- templates/AssemblyInfo.cs.in | 3 ++- templates/wix.xml.in | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cd48d95..7a21b547 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,30 @@ cmake_minimum_required(VERSION 2.8) project(infinispan-hotrod-cs) -set (CPACK_PACKAGE_VERSION_MAJOR "1") -set (CPACK_PACKAGE_VERSION_MINOR "0") -set (CPACK_PACKAGE_VERSION_PATCH "0") +set (HOTROD_VERSION_MAJOR "7") +set (HOTROD_VERSION_MINOR "0") +set (HOTROD_VERSION_PATCH "0") +set (HOTROD_VERSION_LABEL "Alpha1") + +# Map from version label to assembly revision. +set (REVISION_Alpha1 "0") +set (REVISION_Beta1 "10") +set (REVISION_CR1 "20") +set (REVISION_Final "30") + +# CPack version. +set (CPACK_PACKAGE_VERSION_MAJOR "${HOTROD_VERSION_MAJOR}") +set (CPACK_PACKAGE_VERSION_MINOR "${HOTROD_VERSION_MINOR}") +set (CPACK_PACKAGE_VERSION_PATCH "${HOTROD_VERSION_PATCH}-${HOTROD_VERSION_LABEL}") set (HOTROD_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +# Assembly version. +get_property (HOTROD_VERSION_REVISION VARIABLE PROPERTY "REVISION_${HOTROD_VERSION_LABEL}") +if ("${HOTROD_VERSION_REVISION}" STREQUAL "") + message (FATAL_ERROR "No revision mapping defined for HOTROD_VERSION_LABEL '${HOTROD_VERSION_LABEL}'. ${HOTROD_VERSION_REVISION}") +endif ("${HOTROD_VERSION_REVISION}" STREQUAL "") +set (HOTROD_ASSEMBLY_VERSION "${HOTROD_VERSION_MAJOR}.${HOTROD_VERSION_MINOR}.${HOTROD_VERSION_PATCH}.${HOTROD_VERSION_REVISION}") + ### Generated and build the SWIG wrapper ### if (NOT DEFINED HOTRODCPP32_HOME AND DEFINED ENV{HOTRODCPP32_HOME}) set (HOTRODCPP32_HOME $ENV{HOTRODCPP32_HOME}) @@ -218,7 +237,8 @@ endforeach (arch) install (FILES "README.md" DESTINATION .) install (FILES "License.txt" DESTINATION .) -set (CPACK_WIX_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/templates/wix.xml.in") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/wix.xml.in" wix.xml) +set (CPACK_WIX_TEMPLATE "wix.xml") set (CPACK_WIX_UPGRADE_GUID "7cc17657-80b5-417f-9209-710682f852f4") # This value should not change. include (CPack) diff --git a/templates/AssemblyInfo.cs.in b/templates/AssemblyInfo.cs.in index c9c3225b..92da0844 100644 --- a/templates/AssemblyInfo.cs.in +++ b/templates/AssemblyInfo.cs.in @@ -2,5 +2,6 @@ using System.Reflection; using System.Resources; using System.Globalization; -[assembly: AssemblyVersion("${HOTROD_VERSION}.0")] +[assembly: AssemblyVersion("${HOTROD_ASSEMBLY_VERSION}")] +[assembly: AssemblyInformationalVersionAttribute("${HOTROD_VERSION}")] [assembly: AssemblyCulture("")] diff --git a/templates/wix.xml.in b/templates/wix.xml.in index 2b7a387e..a540846c 100644 --- a/templates/wix.xml.in +++ b/templates/wix.xml.in @@ -6,7 +6,7 @@