Skip to content

Commit c5a23ab

Browse files
committed
Set new version number to the Artifact.java file
1 parent 9025e13 commit c5a23ab

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

build.gradle.kts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,20 @@ val secretKeyRingFile: String? =
1414
else file(it).absolutePath
1515
}
1616

17-
allprojects {
18-
val replaceVersionJava by tasks.registering {
19-
doLast {
20-
ant.withGroovyBuilder {
21-
"replaceregexp"("match" to """(private static final String VERSION = ")[^"]*(")""",
22-
"replace" to "\\1${version}\\2",
23-
"encoding" to encoding,
24-
"flags" to "g") {
25-
"fileset"("dir" to ".") {
26-
"include"("name" to "**/Artifact.java")
27-
}
28-
}
17+
fun replaceVersionArtifactClass() {
18+
ant.withGroovyBuilder {
19+
"replaceregexp"("match" to """(private static final String VERSION = ")[^"]*(")""",
20+
"replace" to "\\1${version}\\2",
21+
"encoding" to encoding,
22+
"flags" to "g") {
23+
"fileset"("dir" to ".") {
24+
"include"("name" to "**/Artifact.java")
2925
}
3026
}
3127
}
28+
}
3229

30+
allprojects {
3331
repositories {
3432
mavenCentral()
3533
}
@@ -45,6 +43,12 @@ subprojects {
4543

4644
extra["signing.secretKeyRingFile"] = secretKeyRingFile
4745

46+
val replaceVersionJava by tasks.registering {
47+
doLast {
48+
replaceVersionArtifactClass()
49+
}
50+
}
51+
4852
val compileJava by tasks.existing(JavaCompile::class) {
4953
dependsOn(tasks.named("replaceVersionJava"))
5054
options.encoding = encoding
@@ -172,9 +176,10 @@ subprojects {
172176
rootProject.apply {
173177
apply(from = "release.gradle")
174178

175-
val replaceVersionDoc by tasks.registering {
179+
val replaceVersion by tasks.registering {
176180
mustRunAfter(tasks.named("updateVersion"))
177181
doLast {
182+
replaceVersionArtifactClass()
178183
ant.withGroovyBuilder {
179184
"replaceregexp"("match" to """("org.seasar.doma:doma(-core|-processor)?:)[^"]*(")""",
180185
"replace" to "\\1${version}\\3",
@@ -189,10 +194,6 @@ rootProject.apply {
189194
}
190195
}
191196

192-
val replaceVersion by tasks.registering {
193-
dependsOn(replaceVersionDoc, tasks.named("replaceVersionJava"))
194-
}
195-
196197
val commitNewVersion by tasks.existing {
197198
dependsOn(replaceVersion)
198199
}

doma-core/src/main/java/org/seasar/doma/internal/Artifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public final class Artifact {
77

88
private static final String NAME = "Doma";
99

10-
private static final String VERSION = "2.30.0-beta-4";
10+
private static final String VERSION = "2.30.0-beta-5-SNAPSHOT";
1111

1212
public static String getName() {
1313
return NAME;

0 commit comments

Comments
 (0)