11import java.nio.charset.StandardCharsets
22
3- ext {
4- // Select which repository to use for publishing the documentation
5- // Example:
6- // ./gradlew uploadDocumentation \
7- // -PdocPublishRepoUri="git@github.com:DavideD/hibernate.org.git" \
8- // -PdocPublishBranch="staging"
9- if ( ! project. hasProperty(' docPublishRepoUri' ) ) {
10- docPublishRepoUri = ' git@github.com:hibernate/hibernate.org.git'
11- }
12- if ( ! project. hasProperty(' docPublishBranch' ) ) {
13- docPublishBranch = ' staging'
14- }
15- }
16-
173description = ' Release module'
184// (Optional) before uploading the documentation, you can check
195// the generated website under release/build/hibernate.org with:
206// ./gradlew gitPublishCopy
217
22- // To publish the documentation:
23- // 1. Add the relevant SSH key to your SSH agent.
24- // 2. Execute this:
25- // ./gradlew uploadDocumentation -PdocPublishBranch=production
8+ // The generated documentation are copied to the
9+ // rootProject.layout.buildDirectory.dir("staging-deploy/documentation") by the updateDocumentationTask
10+ // while the publishing is delegated to the https://github.com/hibernate/hibernate-release-scripts
2611
2712// To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation):
2813// ./gradlew ciRelease -PreleaseVersion=x.y.z.Final -PdevelopmentVersion=x.y.z-SNAPSHOT -PgitRemote=origin -PgitBranch=main
@@ -33,9 +18,6 @@ final Directory documentationDir = project(":documentation").layout.buildDirecto
3318// Relative path on the static website where the documentation is located
3419final String docWebsiteRelativePath = " reactive/documentation/${ projectVersion.family} "
3520
36- // The location of the docs when the website has been cloned
37- final Directory docWebsiteReactiveFolder = project. layout. buildDirectory. dir( " docs-website/${ docWebsiteRelativePath} " ). get()
38-
3921def releaseChecksTask = tasks. register( " releaseChecks" ) {
4022 description ' Checks and preparation for release'
4123 group ' Release'
@@ -98,30 +80,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
9880}
9981assemble. dependsOn assembleDocumentationTask
10082
101- /**
102- * Clone the website
103- */
104- def removeDocsWebsiteTask = tasks. register( ' removeDocsWebsite' , Delete ) {
105- delete project. layout. buildDirectory. dir( " docs-website" )
106- }
107-
108- def cloneDocsWebsiteTask = tasks. register( ' cloneDocsWebsite' , Exec ) {
109- dependsOn removeDocsWebsiteTask
110- // Assure that the buildDir exists. Otherwise this task will fail.
111- dependsOn compileJava
112- workingDir project. layout. buildDirectory
113- commandLine ' git' , ' clone' , docPublishRepoUri, ' -b' , docPublishBranch, ' --sparse' , ' --depth' , ' 1' , ' docs-website'
114- }
115-
116- def sparseCheckoutDocumentationTask = tasks. register( ' sparseCheckoutDocumentation' , Exec ) {
117- dependsOn cloneDocsWebsiteTask
118- workingDir project. layout. buildDirectory. dir( " docs-website" )
119- commandLine ' git' , ' sparse-checkout' , ' set' , docWebsiteRelativePath
120- }
121-
122- /**
123- * Update the docs on the cloned website
124- */
12583def changeToReleaseVersionTask = tasks. register( ' changeToReleaseVersion' ) {
12684 description ' Updates `gradle/version.properties` file to the specified release-version'
12785 group ' Release'
@@ -136,70 +94,28 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
13694
13795def updateDocumentationTask = tasks. register( ' updateDocumentation' ) {
13896 description " Update the documentation on the cloned static website"
139- dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
97+ dependsOn assembleDocumentationTask
14098 mustRunAfter changeToReleaseVersion
14199
142100 // copy documentation outputs into target/documentation:
143101 // * this is used in building the dist bundles
144102 // * it is also used as a base to build a staged directory for documentation upload
145103
146104 doLast {
147- // delete the folders in case some files have been removed
148- delete docWebsiteReactiveFolder. dir(" javadocs" ), docWebsiteReactiveFolder. dir(" reference" )
149-
150105 // Aggregated JavaDoc
151- copy {
152- from documentationDir. dir(" javadocs" )
153- into docWebsiteReactiveFolder. dir(" javadocs" )
154- }
155-
156106 copy {
157107 from documentationDir. dir(" javadocs" )
158108 into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/javadocs" )
159109 }
160110
161111 // Reference Documentation
162- copy {
163- from documentationDir. dir(" asciidoc/reference/html_single" )
164- into docWebsiteReactiveFolder. dir(" reference/html_single" )
165- }
166-
167112 copy {
168113 from documentationDir. dir(" asciidoc/reference/html_single" )
169114 into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/reference/html_single" )
170115 }
171116 }
172117}
173118
174- def stageDocChangesTask = tasks. register( ' stageDocChanges' , Exec ) {
175- dependsOn updateDocumentationTask
176- workingDir project. layout. buildDirectory. dir( " docs-website" )
177- commandLine ' git' , ' add' , ' -A' , ' .'
178- }
179-
180- def commitDocChangesTask = tasks. register( ' commitDocChanges' , Exec ) {
181- dependsOn stageDocChangesTask
182- workingDir project. layout. buildDirectory. dir( " docs-website" )
183- commandLine ' git' , ' commit' , ' -m' , " [HR] Hibernate Reactive documentation for ${ projectVersion} "
184- }
185-
186- def pushDocChangesTask = tasks. register( ' pushDocChanges' , Exec ) {
187- description " Push documentation changes on the remote repository"
188- dependsOn commitDocChangesTask
189- workingDir project. layout. buildDirectory. dir( " docs-website" )
190- commandLine ' git' , ' push' , ' --atomic' , ' origin' , docPublishBranch
191- }
192-
193- def uploadDocumentationTask = tasks. register( ' uploadDocumentation' ) {
194- description " Upload documentation on the website"
195- group " Release"
196- dependsOn pushDocChangesTask
197-
198- doLast {
199- logger. lifecycle " Documentation published on '${ docPublishRepoUri} ' branch '${ docPublishBranch} '"
200- }
201- }
202-
203119def gitPreparationForReleaseTask = tasks. register( ' gitPreparationForRelease' ) {
204120 dependsOn releaseChecksTask, changeToReleaseVersionTask
205121 finalizedBy updateDocumentationTask
@@ -245,7 +161,7 @@ void updateVersionFile(var version) {
245161}
246162
247163def publishReleaseArtifactsTask = tasks. register( ' publishReleaseArtifacts' ) {
248- dependsOn uploadDocumentationTask
164+ dependsOn updateDocumentationTask
249165
250166 mustRunAfter gitPreparationForReleaseTask
251167}
0 commit comments