@@ -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 {
172176rootProject.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 }
0 commit comments