Skip to content

Commit 9a454b3

Browse files
committed
[Gradle Release Plugin] - pre tag commit: '2.31.0'.
2 parents 1982603 + e208f7a commit 9a454b3

File tree

249 files changed

+12106
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+12106
-161
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
Doma [![Build Status](https://travis-ci.org/domaframework/doma.svg?branch=master)](https://travis-ci.org/domaframework/doma) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.seasar.doma/doma/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.seasar.doma/doma)
1+
Doma [![Build Status](https://travis-ci.org/domaframework/doma.svg?branch=master)](https://travis-ci.org/domaframework/doma) [![Join the chat at https://gitter.im/domaframework/doma](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/domaframework/doma?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
22
========================================
33

4-
[![Join the chat at https://gitter.im/domaframework/doma](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/domaframework/doma?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5-
64
Doma is a database access framework for Java.
75
Doma uses [Pluggable Annotation Processing API][apt] to generate source code and validate sql mappings **at compile time**.
86

@@ -57,8 +55,8 @@ Build with Gradle
5755

5856
```groovy
5957
dependencies {
60-
implementation "org.seasar.doma:doma-core:2.30.0-beta-6-SNAPSHOT"
61-
annotationProcessor "org.seasar.doma:doma-processor:2.30.0-beta-6-SNAPSHOT"
58+
implementation "org.seasar.doma:doma-core:2.31.0"
59+
annotationProcessor "org.seasar.doma:doma-processor:2.31.0"
6260
}
6361
```
6462

build.gradle.kts

Lines changed: 82 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
plugins {
22
base
3+
kotlin("jvm") version "1.3.72" apply false
4+
kotlin("kapt") version "1.3.72" apply false
35
id("com.diffplug.eclipse.apt") version "3.22.0" apply false
46
id("com.diffplug.gradle.spotless") version "3.27.2"
57
id("de.marcphilipp.nexus-publish") version "0.4.0" apply false
68
id("net.researchgate.release") version "2.8.1"
79
}
810

911
val encoding: String by project
10-
val isSnapshot = project.version.toString().endsWith("SNAPSHOT")
12+
val isSnapshot = version.toString().endsWith("SNAPSHOT")
13+
val releaseVersion = properties["release.releaseVersion"].toString()
14+
val newVersion = properties["release.newVersion"].toString()
1115
val secretKeyRingFile: String? =
1216
findProperty("signing.secretKeyRingFile")?.toString()?.let {
1317
if (it.isEmpty()) null
1418
else file(it).absolutePath
1519
}
1620

17-
fun replaceVersionArtifactClass() {
21+
fun replaceVersionInArtifact(ver: String) {
1822
ant.withGroovyBuilder {
1923
"replaceregexp"("match" to """(private static final String VERSION = ")[^"]*(")""",
20-
"replace" to "\\1${version}\\2",
24+
"replace" to "\\1${ver}\\2",
2125
"encoding" to encoding,
2226
"flags" to "g") {
2327
"fileset"("dir" to ".") {
@@ -43,14 +47,14 @@ subprojects {
4347

4448
extra["signing.secretKeyRingFile"] = secretKeyRingFile
4549

46-
val replaceVersionJava by tasks.registering {
50+
val replaceVersionInJava by tasks.registering {
4751
doLast {
48-
replaceVersionArtifactClass()
52+
replaceVersionInArtifact(version.toString())
4953
}
5054
}
5155

5256
val compileJava by tasks.existing(JavaCompile::class) {
53-
dependsOn(tasks.named("replaceVersionJava"))
57+
dependsOn(replaceVersionInJava)
5458
options.encoding = encoding
5559
}
5660

@@ -59,6 +63,57 @@ subprojects {
5963
options.compilerArgs = listOf("-proc:none")
6064
}
6165

66+
val test by tasks.existing(Test::class) {
67+
maxHeapSize = "1g"
68+
useJUnitPlatform()
69+
}
70+
71+
dependencies {
72+
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.6.2")
73+
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.6.2")
74+
}
75+
76+
configure<JavaPluginExtension> {
77+
sourceCompatibility = JavaVersion.VERSION_1_8
78+
targetCompatibility = JavaVersion.VERSION_1_8
79+
}
80+
81+
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
82+
java {
83+
googleJavaFormat("1.7")
84+
}
85+
kotlin {
86+
ktlint("0.36.0")
87+
trimTrailingWhitespace()
88+
endWithNewline()
89+
}
90+
}
91+
92+
configure<org.gradle.plugins.ide.eclipse.model.EclipseModel> {
93+
classpath {
94+
file {
95+
whenMerged {
96+
val classpath = this as org.gradle.plugins.ide.eclipse.model.Classpath
97+
classpath.entries.removeAll {
98+
when (it) {
99+
is org.gradle.plugins.ide.eclipse.model.Output -> it.path == ".apt_generated"
100+
else -> false
101+
}
102+
}
103+
}
104+
withXml {
105+
val node = asNode()
106+
node.appendNode("classpathentry", mapOf("kind" to "src", "output" to "bin/main", "path" to ".apt_generated"))
107+
}
108+
}
109+
}
110+
jdt {
111+
javaRuntimeName = "JavaSE-1.8"
112+
}
113+
}
114+
}
115+
116+
configure(subprojects.filter { it.name in listOf("doma-core", "doma-processor", "doma-criteria") }) {
62117
val javadoc by tasks.existing(Javadoc::class) {
63118
options.encoding = encoding
64119
(options as StandardJavadocDocletOptions).apply {
@@ -76,24 +131,12 @@ subprojects {
76131
}
77132
}
78133

79-
val test by tasks.existing(Test::class) {
80-
maxHeapSize = "1g"
81-
useJUnitPlatform()
82-
}
83-
84134
val build by tasks.existing {
85135
val publishToMavenLocal by tasks.existing
86136
dependsOn(publishToMavenLocal)
87137
}
88138

89-
dependencies {
90-
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.6.2")
91-
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.6.2")
92-
}
93-
94139
configure<JavaPluginExtension> {
95-
sourceCompatibility = JavaVersion.VERSION_1_8
96-
targetCompatibility = JavaVersion.VERSION_1_8
97140
withJavadocJar()
98141
withSourcesJar()
99142
}
@@ -142,60 +185,40 @@ subprojects {
142185
sign(publishing.publications)
143186
isRequired = !isSnapshot
144187
}
188+
}
145189

146-
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
147-
java {
148-
googleJavaFormat("1.7")
149-
}
150-
}
190+
rootProject.apply {
191+
apply(from = "release.gradle")
151192

152-
configure<org.gradle.plugins.ide.eclipse.model.EclipseModel> {
153-
classpath {
154-
file {
155-
whenMerged {
156-
val classpath = this as org.gradle.plugins.ide.eclipse.model.Classpath
157-
classpath.entries.removeAll {
158-
when (it) {
159-
is org.gradle.plugins.ide.eclipse.model.Output -> it.path == ".apt_generated"
160-
else -> false
161-
}
162-
}
163-
}
164-
withXml {
165-
val node = asNode()
166-
node.appendNode("classpathentry", mapOf("kind" to "src", "output" to "bin/main", "path" to ".apt_generated"))
193+
fun replaceVersionInDocs(ver: String) {
194+
ant.withGroovyBuilder {
195+
"replaceregexp"("match" to """("org.seasar.doma:doma-(core|processor|criteria)?:)[^"]*(")""",
196+
"replace" to "\\1${ver}\\3",
197+
"encoding" to encoding,
198+
"flags" to "g") {
199+
"fileset"("dir" to ".") {
200+
"include"("name" to "README.md")
201+
"include"("name" to "docs/**/*.rst")
167202
}
168203
}
169204
}
170-
jdt {
171-
javaRuntimeName = "JavaSE-1.8"
172-
}
173205
}
174-
}
175-
176-
rootProject.apply {
177-
apply(from = "release.gradle")
178206

179207
val replaceVersion by tasks.registering {
180-
mustRunAfter(tasks.named("updateVersion"))
181208
doLast {
182-
replaceVersionArtifactClass()
183-
ant.withGroovyBuilder {
184-
"replaceregexp"("match" to """("org.seasar.doma:doma(-core|-processor)?:)[^"]*(")""",
185-
"replace" to "\\1${version}\\3",
186-
"encoding" to encoding,
187-
"flags" to "g") {
188-
"fileset"("dir" to ".") {
189-
"include"("name" to "README.md")
190-
"include"("name" to "docs/**/*.rst")
191-
}
192-
}
193-
}
209+
replaceVersionInArtifact(releaseVersion)
210+
replaceVersionInDocs(releaseVersion)
194211
}
195212
}
196213

197-
val commitNewVersion by tasks.existing {
214+
val beforeReleaseBuild by tasks.existing {
198215
dependsOn(replaceVersion)
216+
}
217+
218+
val updateVersion by tasks.existing {
219+
doLast {
220+
replaceVersionInArtifact(newVersion)
221+
}
199222
}
200223

201224
configure<com.diffplug.gradle.spotless.SpotlessExtension> {

docs/build.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Write your build.gradle as follows:
3535
.. code-block:: groovy
3636
3737
dependencies {
38-
implementation "org.seasar.doma:doma-core:2.30.0-beta-6-SNAPSHOT"
39-
annotationProcessor "org.seasar.doma:doma-processor:2.30.0-beta-6-SNAPSHOT"
38+
implementation "org.seasar.doma:doma-core:2.31.0"
39+
annotationProcessor "org.seasar.doma:doma-processor:2.31.0"
4040
}
4141
4242
To simplify your build.script, we recommend that you use the `Doma Compile Plugin`_.

0 commit comments

Comments
 (0)