@@ -3,29 +3,15 @@ import java.nio.charset.StandardCharsets
3
3
plugins {
4
4
id " hr-java-library"
5
5
}
6
- ext {
7
- // Select which repository to use for publishing the documentation
8
- // Example:
9
- // ./gradlew uploadDocumentation \
10
- // -PdocPublishRepoUri="[email protected] :DavideD/hibernate.org.git" \
11
- // -PdocPublishBranch="staging"
12
- if ( ! project. hasProperty(' docPublishRepoUri' ) ) {
13
- docPublishRepoUri
= ' [email protected] :hibernate/hibernate.org.git'
14
- }
15
- if ( ! project. hasProperty(' docPublishBranch' ) ) {
16
- docPublishBranch = ' staging'
17
- }
18
- }
19
6
20
7
description = ' Release module'
21
8
// (Optional) before uploading the documentation, you can check
22
9
// the generated website under release/build/hibernate.org with:
23
10
// ./gradlew gitPublishCopy
24
11
25
- // To publish the documentation:
26
- // 1. Add the relevant SSH key to your SSH agent.
27
- // 2. Execute this:
28
- // ./gradlew uploadDocumentation -PdocPublishBranch=production
12
+ // The generated documentation are copied to the
13
+ // rootProject.layout.buildDirectory.dir("staging-deploy/documentation") by the updateDocumentationTask
14
+ // while the publishing is delegated to the https://github.com/hibernate/hibernate-release-scripts
29
15
30
16
// To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation):
31
17
// ./gradlew ciRelease -PreleaseVersion=x.y.z.Final -PdevelopmentVersion=x.y.z-SNAPSHOT -PgitRemote=origin -PgitBranch=main
@@ -36,9 +22,6 @@ final Directory documentationDir = project(":documentation").layout.buildDirecto
36
22
// Relative path on the static website where the documentation is located
37
23
final String docWebsiteRelativePath = " reactive/documentation/${ projectVersion.family} "
38
24
39
- // The location of the docs when the website has been cloned
40
- final Directory docWebsiteReactiveFolder = project. layout. buildDirectory. dir( " docs-website/${ docWebsiteRelativePath} " ). get()
41
-
42
25
def releaseChecksTask = tasks. register( " releaseChecks" ) {
43
26
description ' Checks and preparation for release'
44
27
group ' Release'
@@ -101,30 +84,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
101
84
}
102
85
assemble. dependsOn assembleDocumentationTask
103
86
104
- /**
105
- * Clone the website
106
- */
107
- def removeDocsWebsiteTask = tasks. register( ' removeDocsWebsite' , Delete ) {
108
- delete project. layout. buildDirectory. dir( " docs-website" )
109
- }
110
-
111
- def cloneDocsWebsiteTask = tasks. register( ' cloneDocsWebsite' , Exec ) {
112
- dependsOn removeDocsWebsiteTask
113
- // Assure that the buildDir exists. Otherwise this task will fail.
114
- dependsOn compileJava
115
- workingDir project. layout. buildDirectory
116
- commandLine ' git' , ' clone' , docPublishRepoUri, ' -b' , docPublishBranch, ' --sparse' , ' --depth' , ' 1' , ' docs-website'
117
- }
118
-
119
- def sparseCheckoutDocumentationTask = tasks. register( ' sparseCheckoutDocumentation' , Exec ) {
120
- dependsOn cloneDocsWebsiteTask
121
- workingDir project. layout. buildDirectory. dir( " docs-website" )
122
- commandLine ' git' , ' sparse-checkout' , ' set' , docWebsiteRelativePath
123
- }
124
-
125
- /**
126
- * Update the docs on the cloned website
127
- */
128
87
def changeToReleaseVersionTask = tasks. register( ' changeToReleaseVersion' ) {
129
88
description ' Updates `gradle/version.properties` file to the specified release-version'
130
89
group ' Release'
@@ -139,70 +98,28 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
139
98
140
99
def updateDocumentationTask = tasks. register( ' updateDocumentation' ) {
141
100
description " Update the documentation on the cloned static website"
142
- dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
101
+ dependsOn assembleDocumentationTask
143
102
mustRunAfter changeToReleaseVersion
144
103
145
104
// copy documentation outputs into target/documentation:
146
105
// * this is used in building the dist bundles
147
106
// * it is also used as a base to build a staged directory for documentation upload
148
107
149
108
doLast {
150
- // delete the folders in case some files have been removed
151
- delete docWebsiteReactiveFolder. dir(" javadocs" ), docWebsiteReactiveFolder. dir(" reference" )
152
-
153
109
// Aggregated JavaDoc
154
- copy {
155
- from documentationDir. dir(" javadocs" )
156
- into docWebsiteReactiveFolder. dir(" javadocs" )
157
- }
158
-
159
110
copy {
160
111
from documentationDir. dir(" javadocs" )
161
112
into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/javadocs" )
162
113
}
163
114
164
115
// Reference Documentation
165
- copy {
166
- from documentationDir. dir(" asciidoc/reference/html_single" )
167
- into docWebsiteReactiveFolder. dir(" reference/html_single" )
168
- }
169
-
170
116
copy {
171
117
from documentationDir. dir(" asciidoc/reference/html_single" )
172
118
into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/reference/html_single" )
173
119
}
174
120
}
175
121
}
176
122
177
- def stageDocChangesTask = tasks. register( ' stageDocChanges' , Exec ) {
178
- dependsOn updateDocumentationTask
179
- workingDir project. layout. buildDirectory. dir( " docs-website" )
180
- commandLine ' git' , ' add' , ' -A' , ' .'
181
- }
182
-
183
- def commitDocChangesTask = tasks. register( ' commitDocChanges' , Exec ) {
184
- dependsOn stageDocChangesTask
185
- workingDir project. layout. buildDirectory. dir( " docs-website" )
186
- commandLine ' git' , ' commit' , ' -m' , " [HR] Hibernate Reactive documentation for ${ projectVersion} "
187
- }
188
-
189
- def pushDocChangesTask = tasks. register( ' pushDocChanges' , Exec ) {
190
- description " Push documentation changes on the remote repository"
191
- dependsOn commitDocChangesTask
192
- workingDir project. layout. buildDirectory. dir( " docs-website" )
193
- commandLine ' git' , ' push' , ' --atomic' , ' origin' , docPublishBranch
194
- }
195
-
196
- def uploadDocumentationTask = tasks. register( ' uploadDocumentation' ) {
197
- description " Upload documentation on the website"
198
- group " Release"
199
- dependsOn pushDocChangesTask
200
-
201
- doLast {
202
- logger. lifecycle " Documentation published on '${ docPublishRepoUri} ' branch '${ docPublishBranch} '"
203
- }
204
- }
205
-
206
123
def gitPreparationForReleaseTask = tasks. register( ' gitPreparationForRelease' ) {
207
124
dependsOn releaseChecksTask, changeToReleaseVersionTask
208
125
finalizedBy updateDocumentationTask
@@ -248,7 +165,7 @@ void updateVersionFile(var version) {
248
165
}
249
166
250
167
def publishReleaseArtifactsTask = tasks. register( ' publishReleaseArtifacts' ) {
251
- dependsOn uploadDocumentationTask
168
+ dependsOn updateDocumentationTask
252
169
253
170
mustRunAfter gitPreparationForReleaseTask
254
171
}
0 commit comments