Skip to content

Commit 93a5eb3

Browse files
rozzajyemin
authored andcommitted
Added publishArchives version checking task
JAVA-2903
1 parent f3fc596 commit 93a5eb3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

gradle/deploy.gradle

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,29 @@ configure(subprojects - [project(':util'), project(':driver-legacy')]) {
6262

6363
task uploadSnapshotArchives(dependsOn: uploadArchives) {
6464
if (!version.endsWith("-SNAPSHOT")) {
65-
enabled = false;
66-
dependsOn = [];
65+
enabled = false
66+
dependsOn = []
67+
}
68+
}
69+
70+
task publishArchives(dependsOn: uploadArchives) {
71+
String gitVersion = getGitVersion()
72+
if (gitVersion != version) {
73+
dependsOn = []
74+
}
75+
doFirst {
76+
if (gitVersion != version) {
77+
def cause = """
78+
| Version mismatch:
79+
| =================
80+
|
81+
| $version != $gitVersion
82+
|
83+
| The project version does not match the git tag.
84+
|""".stripMargin()
85+
throw new IllegalStateException(cause)
86+
}
87+
println("Publishing: ${project.name} : $gitVersion")
6788
}
6889
}
6990

0 commit comments

Comments
 (0)