Skip to content

Commit b1fa4dc

Browse files
committed
fix: moved versioning into the build
1 parent f7e5e9e commit b1fa4dc

1 file changed

Lines changed: 4 additions & 28 deletions

File tree

build.gradle

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff 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-
4521
if (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
}

0 commit comments

Comments
 (0)