Skip to content

Commit 8f9c0c0

Browse files
authored
Merge pull request aeron-io#373 from vdidenko/version_txt
Share version between Java and C++ builds
2 parents d13a126 + bb7d9c4 commit 8f9c0c0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
16+
17+
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
18+
cmake_policy(VERSION 3.0.2)
19+
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}")
1724

1825
include(ExternalProject)
1926
include(CheckLibraryExists)

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)