File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,30 +18,6 @@ repositories {
1818 mavenCentral()
1919}
2020
21- // Task to get the current Git commit hash
22- task getCommitHash {
23- doLast {
24- def commitHash = ' git rev-parse --short HEAD' . execute(). text. trim()
25- project. ext. commitHash = commitHash
26- }
27- }
28-
29- // Update the version with the commit hash
30- task updateVersion {
31- dependsOn getCommitHash
32- doLast {
33- def commitHash = project. ext. commitHash
34- version = " ${ version} -${ commitHash} "
35- println " Updated version to: $version "
36- }
37- }
38-
39- gradle. projectsEvaluated {
40- tasks. withType(JavaCompile ) {
41- dependsOn tasks. updateVersion
42- }
43- }
44-
4521if (hasProperty(' target' ) && target == ' android' ) {
4622
4723 apply plugin : ' com.android.library'
@@ -117,10 +93,10 @@ if (hasProperty('target') && target == 'android') {
11793 }
11894 publications {
11995 maven(MavenPublication ) {
120- artifactId = ' permify'
121- from components. java
122- // Include the commit hash in the published version
123- version = " ${ version} "
96+ artifactId = ' permify'
97+ from components. java
98+ def commitHash = ' git rev-parse --short HEAD ' . execute() . text . trim()
99+ version = " ${ version} - ${ commitHash } "
124100 }
125101 }
126102 }
You can’t perform that action at this time.
0 commit comments