Skip to content

Commit

Permalink
HRCPP-132 Update the version and add mapping to assembly versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
erlyfall authored and tristantarrant committed Mar 5, 2014
1 parent e8460f0 commit f452945
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion templates/AssemblyInfo.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -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("")]
2 changes: 1 addition & 1 deletion templates/wix.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Product Id="$(var.CPACK_WIX_PRODUCT_GUID)"
Name="$(var.CPACK_PACKAGE_NAME)"
Language="1033"
Version="$(var.CPACK_PACKAGE_VERSION)"
Version="${HOTROD_ASSEMBLY_VERSION}"
Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">

Expand Down

0 comments on commit f452945

Please sign in to comment.