You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by al...@apache.org on 2023/09/19 14:30:19 UTC

[fineract] branch develop updated: FINERACT-1979: Better versioning plugin for Gradle builds

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

aleks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3fe997e47 FINERACT-1979: Better versioning plugin for Gradle builds
3fe997e47 is described below

commit 3fe997e472f0fa7901b0ce7415271110fe53137c
Author: Kristof Jozsa <kr...@gmail.com>
AuthorDate: Mon Sep 18 17:36:48 2023 +0200

    FINERACT-1979: Better versioning plugin for Gradle builds
---
 .github/workflows/build-docker-mariadb.yml    |  4 +++-
 .github/workflows/build-docker-postgresql.yml |  4 +++-
 .github/workflows/build-documentation.yml     |  4 +++-
 .github/workflows/build-mariadb.yml           |  4 +++-
 .github/workflows/build-mysql.yml             |  4 +++-
 .github/workflows/build-postgresql.yml        |  4 +++-
 .github/workflows/smoke-activemq.yml          |  4 +++-
 .github/workflows/smoke-kafka.yml             |  4 +++-
 .github/workflows/sonarqube.yml               |  4 +++-
 .github/workflows/stale.yml                   |  2 +-
 build.gradle                                  | 25 +++++++++++++++++++------
 11 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/build-docker-mariadb.yml b/.github/workflows/build-docker-mariadb.yml
index 682cfd422..5cbab46e6 100644
--- a/.github/workflows/build-docker-mariadb.yml
+++ b/.github/workflows/build-docker-mariadb.yml
@@ -12,7 +12,9 @@ jobs:
       GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
 
     steps:
-      - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/build-docker-postgresql.yml b/.github/workflows/build-docker-postgresql.yml
index 9c2122981..8ff00cfd8 100644
--- a/.github/workflows/build-docker-postgresql.yml
+++ b/.github/workflows/build-docker-postgresql.yml
@@ -12,7 +12,9 @@ jobs:
       GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
 
     steps:
-      - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml
index b0a2bbca8..1706d7c76 100644
--- a/.github/workflows/build-documentation.yml
+++ b/.github/workflows/build-documentation.yml
@@ -11,7 +11,9 @@ jobs:
       GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
     steps:
       - name: Checkout
-        uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/build-mariadb.yml b/.github/workflows/build-mariadb.yml
index b8e4e70ca..4b1c3d8d9 100644
--- a/.github/workflows/build-mariadb.yml
+++ b/.github/workflows/build-mariadb.yml
@@ -30,7 +30,9 @@ jobs:
         GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
     steps:
       - name: Checkout
-        uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/build-mysql.yml b/.github/workflows/build-mysql.yml
index d3e440830..cfcace45c 100644
--- a/.github/workflows/build-mysql.yml
+++ b/.github/workflows/build-mysql.yml
@@ -30,7 +30,9 @@ jobs:
         GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
     steps:
       - name: Checkout
-        uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/build-postgresql.yml b/.github/workflows/build-postgresql.yml
index 0936c732f..2bfdcf4cb 100644
--- a/.github/workflows/build-postgresql.yml
+++ b/.github/workflows/build-postgresql.yml
@@ -31,7 +31,9 @@ jobs:
         GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
     steps:
       - name: Checkout
-        uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/smoke-activemq.yml b/.github/workflows/smoke-activemq.yml
index 2819022e2..5b4a1cc5d 100644
--- a/.github/workflows/smoke-activemq.yml
+++ b/.github/workflows/smoke-activemq.yml
@@ -12,7 +12,9 @@ jobs:
       GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
 
     steps:
-      - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/smoke-kafka.yml b/.github/workflows/smoke-kafka.yml
index 13ccc221f..347f9a79e 100644
--- a/.github/workflows/smoke-kafka.yml
+++ b/.github/workflows/smoke-kafka.yml
@@ -12,7 +12,9 @@ jobs:
       GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
 
     steps:
-      - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml
index 27e3acaeb..802bbee68 100644
--- a/.github/workflows/sonarqube.yml
+++ b/.github/workflows/sonarqube.yml
@@ -20,7 +20,9 @@ jobs:
         GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
     steps:
       - name: Checkout
-        uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
       - name: Set up JDK 17
         uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
         with:
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index ca79a7bdf..9eb23f958 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -15,7 +15,7 @@ jobs:
       pull-requests: write  # for actions/stale to close stale PRs
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8
+    - uses: actions/stale@v8
       with:
         repo-token: ${{ secrets.GITHUB_TOKEN }}
         # stale-issue-message: 'Stale issue message'
diff --git a/build.gradle b/build.gradle
index 5acb6f9ed..6beb37499 100644
--- a/build.gradle
+++ b/build.gradle
@@ -67,6 +67,7 @@ buildscript {
 }
 
 plugins {
+    id 'me.qoomon.git-versioning' version '6.4.2'
     id "org.barfuin.gradle.taskinfo" version "2.1.0"
     id 'com.adarshr.test-logger' version '3.2.0'
     id 'com.diffplug.spotless' version '6.19.0' apply false
@@ -85,7 +86,6 @@ plugins {
     id 'org.asciidoctor.jvm.gems' version '3.3.2' apply false
     id 'org.asciidoctor.kindlegen.base' version '3.2.0' apply false
     id 'com.google.cloud.tools.jib' version '3.3.2' apply false
-    id 'fr.brouillard.oss.gradle.jgitver' version '0.10.0-rc03'
     id 'org.sonarqube' version '4.2.1.3168'
     id 'com.github.andygoossens.modernizer' version '1.8.0' apply false
     id 'com.github.spotbugs' version '5.0.14' apply false
@@ -99,17 +99,30 @@ description = '''\
 Run as:
 gradle clean bootRun'''
 
+version = "0.0.0-SNAPSHOT"
+gitVersioning.apply {
+    refs {
+        considerTagsOnBranches = true
+
+        tag("(?<version>.*)") {
+            version = "\${ref.version}"
+        }
+
+        branch(".+") {
+            version = "\${describe.tag.version.major}.\${describe.tag.version.minor}.\${describe.tag.version.patch.next}-SNAPSHOT"
+        }
+    }
+    rev {
+        version = "\${commit}"
+    }
+}
+
 ext['groovy.version'] = '4.0.6'
 ext['swaggerFile'] = "$rootDir/fineract-provider/build/classes/java/main/static/fineract.json".toString()
 
 allprojects  {
     group = 'org.apache.fineract'
 
-    jgitver {
-        strategy 'PATTERN'
-        versionPattern ( project.hasProperty('fineract.release.version') ? '${v}' : '${M}.${m}.${p}-${meta.GIT_SHA1_8}' )
-    }
-
     repositories {
         mavenCentral()
     }