Skip to content

Commit bb7d9c4

Browse files
committed
[C++]: Share version information between Java to C++ builds
1 parent 58bf6a8 commit bb7d9c4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
1818
cmake_policy(VERSION 3.0.2)
1919

20+
file(STRINGS version.txt SBE_VERSION_TXT LIMIT_COUNT 1 REGEX "^[0-9]+(\\.[0-9])+")
21+
string(REGEX REPLACE "^([0-9]+(\\.[0-9])+).*$" "\\1" SBE_VERSION_NUMERIC "${SBE_VERSION_TXT}")
22+
23+
project("sbe" VERSION "${SBE_VERSION_NUMERIC}")
24+
2025
include(ExternalProject)
2126
include(CheckLibraryExists)
2227

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ plugins {
2121
defaultTasks 'clean', 'build', 'shadowJar', 'install'
2222

2323
def sbeGroup = 'uk.co.real-logic'
24-
def sbeVersion = '1.5.1-SNAPSHOT'
24+
def sbeVersion = new File('version.txt').text.trim()
2525

2626
group = sbeGroup
2727
version = sbeVersion

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.5.1-SNAPSHOT

0 commit comments

Comments
 (0)