@@ -3,29 +3,15 @@ import java.nio.charset.StandardCharsets
33plugins {
44 id " hr-java-library"
55}
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- }
196
207description = ' Release module'
218// (Optional) before uploading the documentation, you can check
229// the generated website under release/build/hibernate.org with:
2310// ./gradlew gitPublishCopy
2411
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
2915
3016// To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation):
3117// ./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
3622// Relative path on the static website where the documentation is located
3723final String docWebsiteRelativePath = " reactive/documentation/${ projectVersion.family} "
3824
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-
4225def releaseChecksTask = tasks. register( " releaseChecks" ) {
4326 description ' Checks and preparation for release'
4427 group ' Release'
@@ -101,30 +84,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
10184}
10285assemble. dependsOn assembleDocumentationTask
10386
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- */
12887def changeToReleaseVersionTask = tasks. register( ' changeToReleaseVersion' ) {
12988 description ' Updates `gradle/version.properties` file to the specified release-version'
13089 group ' Release'
@@ -139,57 +98,25 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
13998
14099def updateDocumentationTask = tasks. register( ' updateDocumentation' ) {
141100 description " Update the documentation on the cloned static website"
142- dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
101+ dependsOn assembleDocumentationTask
143102 mustRunAfter changeToReleaseVersion
144103
145104 // copy documentation outputs into target/documentation:
146105 // * this is used in building the dist bundles
147106 // * it is also used as a base to build a staged directory for documentation upload
148107
149108 doLast {
150- // delete the folders in case some files have been removed
151- delete docWebsiteReactiveFolder. dir(" javadocs" ), docWebsiteReactiveFolder. dir(" reference" )
152-
153109 // Aggregated JavaDoc
154- copy {
155- from documentationDir. dir(" javadocs" )
156- into docWebsiteReactiveFolder . dir(" javadocs" )
157- }
110+ copy {
111+ from documentationDir. dir(" javadocs" )
112+ into rootProject . layout . buildDirectory . dir(" staging-deploy/documentation/ javadocs" )
113+ }
158114
159115 // Reference Documentation
160- copy {
161- from documentationDir. dir(" asciidoc/reference/html_single" )
162- into docWebsiteReactiveFolder. dir(" reference/html_single" )
163- }
164- }
165- }
166-
167- def stageDocChangesTask = tasks. register( ' stageDocChanges' , Exec ) {
168- dependsOn updateDocumentationTask
169- workingDir project. layout. buildDirectory. dir( " docs-website" )
170- commandLine ' git' , ' add' , ' -A' , ' .'
171- }
172-
173- def commitDocChangesTask = tasks. register( ' commitDocChanges' , Exec ) {
174- dependsOn stageDocChangesTask
175- workingDir project. layout. buildDirectory. dir( " docs-website" )
176- commandLine ' git' , ' commit' , ' -m' , " [HR] Hibernate Reactive documentation for ${ projectVersion} "
177- }
178-
179- def pushDocChangesTask = tasks. register( ' pushDocChanges' , Exec ) {
180- description " Push documentation changes on the remote repository"
181- dependsOn commitDocChangesTask
182- workingDir project. layout. buildDirectory. dir( " docs-website" )
183- commandLine ' git' , ' push' , ' --atomic' , ' origin' , docPublishBranch
184- }
185-
186- def uploadDocumentationTask = tasks. register( ' uploadDocumentation' ) {
187- description " Upload documentation on the website"
188- group " Release"
189- dependsOn pushDocChangesTask
190-
191- doLast {
192- logger. lifecycle " Documentation published on '${ docPublishRepoUri} ' branch '${ docPublishBranch} '"
116+ copy {
117+ from documentationDir. dir(" asciidoc/reference/html_single" )
118+ into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/reference/html_single" )
119+ }
193120 }
194121}
195122
@@ -238,7 +165,7 @@ void updateVersionFile(var version) {
238165}
239166
240167def publishReleaseArtifactsTask = tasks. register( ' publishReleaseArtifacts' ) {
241- dependsOn uploadDocumentationTask
168+ dependsOn updateDocumentationTask
242169
243170 mustRunAfter gitPreparationForReleaseTask
244171}
0 commit comments