Skip to content

Commit a909833

Browse files
committed
[SPARK-51577] Make gradle build to automatically append SNAPSHOT suffix to version for non-release builds
What changes were proposed in this pull request? This PR makes gradle build automatically append -SNAPSHOT suffix to version for non-release builds Why are the changes needed? This would help to reduce one duplicate hard-coded version in gradle scripts, as we already defined version in gradle properties Does this PR introduce any user-facing change? No How was this patch tested? pass the CIs Was this patch authored or co-authored using generative AI tooling? No
1 parent 9cf0bac commit a909833

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17): "Java 17
3434

3535
allprojects {
3636
group = "org.apache.spark.k8s.operator"
37-
version = "0.1.0-SNAPSHOT"
38-
}
37+
if (!project.hasProperty('release')) {
38+
version += "-SNAPSHOT"
39+
}}
3940

4041
tasks.register('buildDockerImage', Exec) {
4142
String cmd = "docker build --build-arg APP_VERSION=${version} -t spark-kubernetes-operator:${version} -f build-tools/docker/Dockerfile ."

0 commit comments

Comments
 (0)