@@ -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="git@github.com:DavideD/hibernate.org.git" \
11- // -PdocPublishBranch="staging"
12- if ( ! project. hasProperty(' docPublishRepoUri' ) ) {
13- docPublishRepoUri = ' git@github.com: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,70 +98,28 @@ 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- }
158-
159110 copy {
160111 from documentationDir. dir(" javadocs" )
161112 into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/javadocs" )
162113 }
163114
164115 // Reference Documentation
165- copy {
166- from documentationDir. dir(" asciidoc/reference/html_single" )
167- into docWebsiteReactiveFolder. dir(" reference/html_single" )
168- }
169-
170116 copy {
171117 from documentationDir. dir(" asciidoc/reference/html_single" )
172118 into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/reference/html_single" )
173119 }
174120 }
175121}
176122
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-
206123def gitPreparationForReleaseTask = tasks. register( ' gitPreparationForRelease' ) {
207124 dependsOn releaseChecksTask, changeToReleaseVersionTask
208125 finalizedBy updateDocumentationTask
@@ -248,7 +165,7 @@ void updateVersionFile(var version) {
248165}
249166
250167def publishReleaseArtifactsTask = tasks. register( ' publishReleaseArtifacts' ) {
251- dependsOn uploadDocumentationTask
168+ dependsOn updateDocumentationTask
252169
253170 mustRunAfter gitPreparationForReleaseTask
254171}
0 commit comments