This is an automated email from the ASF dual-hosted git repository.

mpochatkin pushed a commit to branch IGNITE-19383
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 75e5f0dcaae52d2d5e1c6e91be768d5043da4bb1
Author: Mikhail Pochatkin <[email protected]>
AuthorDate: Fri Jun 14 16:05:24 2024 +0300

    IGNITE-19383 Add git last commit hash to version
---
 build.gradle | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 073b50ac26..8aabc554c6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -73,7 +73,12 @@ ext {
 
 allprojects {
     group 'org.apache.ignite'
-    version = "3.0.0-SNAPSHOT"
+    def gitLastCommitHash = new ByteArrayOutputStream()
+    exec {
+        commandLine "git", "rev-parse", "--short", "HEAD"
+        standardOutput = gitLastCommitHash
+    }
+    version = "3.0.0-SNAPSHOT-$gitLastCommitHash"
 
     tasks.withType(Jar) {
         duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -114,6 +119,10 @@ allprojects {
     }
 }
 
+task printVersion {
+    println project.version
+}
+
 subprojects {
     apply plugin: 'base'
 

Reply via email to