Skip to content

Commit 25c77e7

Browse files
committed
fix
1 parent 4a7c515 commit 25c77e7

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

release/build.gradle

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,40 @@ final String docWebsiteReactiveFolder = project.layout.buildDirectory.dir( "docs
3939
/**
4040
* Assembles all documentation into the {buildDir}/documentation directory.
4141
*/
42-
tasks.register( 'assembleDocumentation' ) {
42+
def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
4343
dependsOn ':documentation:assemble'
4444
group 'Documentation'
4545
description 'Render the documentation'
4646
}
47-
assemble.dependsOn assembleDocumentation
47+
assemble.dependsOn assembleDocumentationTask
4848

4949
/**
5050
* Clone the website
5151
*/
52-
tasks.register( 'removeDocsWebsite', Delete ) {
52+
def removeDocsWebsiteTask = tasks.register( 'removeDocsWebsite', Delete ) {
5353
delete project.layout.buildDirectory.dir( "docs-website" )
5454
}
5555

56-
// Depending on compileJava makes sure that the buildDir exists. Otherwise this task will fail.
57-
tasks.register( 'cloneDocsWebsite', Exec ) {
58-
dependsOn removeDocsWebsite, compileJava
56+
def cloneDocsWebsiteTask = tasks.register( 'cloneDocsWebsite', Exec ) {
57+
dependsOn removeDocsWebsiteTask
58+
// Assure that the buildDir exists. Otherwise this task will fail.
59+
dependsOn compileJava
5960
workingDir project.layout.buildDirectory
6061
commandLine 'git', 'clone', docPublishRepoUri, '-b', docPublishBranch, '--sparse', '--depth', '1', 'docs-website'
6162
}
6263

63-
tasks.register( 'sparseCheckoutDocumentation', Exec ) {
64-
dependsOn cloneDocsWebsite
64+
def sparseCheckoutDocumentationTask =tasks.register( 'sparseCheckoutDocumentation', Exec ) {
65+
dependsOn cloneDocsWebsiteTask
6566
workingDir project.layout.buildDirectory.dir( "docs-website" )
6667
commandLine 'git', 'sparse-checkout', 'set', docWebsiteRelativePath
6768
}
6869

6970
/**
7071
* Update the docs on the cloned website
7172
*/
72-
tasks.register( 'updateDocumentation' ) {
73-
dependsOn assembleDocumentation, sparseCheckoutDocumentation
74-
description = "Update the documentation on the cloned static website"
73+
def updateDocumentationTask = tasks.register( 'updateDocumentation' ) {
74+
description "Update the documentation on the cloned static website"
75+
dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
7576

7677
// copy documentation outputs into target/documentation:
7778
// * this is used in building the dist bundles
@@ -95,40 +96,40 @@ tasks.register( 'updateDocumentation' ) {
9596
}
9697
}
9798

98-
/**
99-
* Push documentation changes on the remote repository
100-
*/
101-
tasks.register( 'stageDocChanges', Exec ) {
102-
dependsOn updateDocumentation
99+
def stageDocChangesTask = tasks.register( 'stageDocChanges', Exec ) {
100+
dependsOn updateDocumentationTask
103101
workingDir project.layout.buildDirectory.dir( "docs-website" )
104102
commandLine 'git', 'add', '-A', '.'
105103
}
106104

107-
tasks.register( 'commitDocChanges', Exec ) {
108-
dependsOn stageDocChanges
109-
workingDir "${project.buildDir}/docs-website"
105+
def commitDocChangesTask = tasks.register( 'commitDocChanges', Exec ) {
106+
dependsOn stageDocChangesTask
107+
workingDir project.layout.buildDirectory.dir( "docs-website" )
110108
commandLine 'git', 'commit', '-m', "[HR] Hibernate Reactive documentation for ${projectVersion}"
111109
}
112110

113-
tasks.register( 'pushDocChanges', Exec ) {
114-
dependsOn commitDocChanges
111+
def pushDocChangesTask = tasks.register( 'pushDocChanges', Exec ) {
112+
description "Push documentation changes on the remote repository"
113+
dependsOn commitDocChangesTask
115114
workingDir project.layout.buildDirectory.dir( "docs-website" )
116115
commandLine 'git', 'push', '--atomic', 'origin', docPublishBranch
117116
}
118117

119-
tasks.register( 'publishDocumentation' ) {
120-
dependsOn pushDocChanges
121-
group = "Release"
122-
description = "Upload documentation on the website"
118+
def publishDocumentationTask = tasks.register( 'publishDocumentation' ) {
119+
description "Upload documentation on the website"
120+
dependsOn pushDocChangesTask
121+
group "Release"
123122

124123
doLast {
125124
logger.lifecycle "Documentation published on '${docPublishRepoUri}' branch '${docPublishBranch}'"
126125
}
127126
}
128127

129-
tasks.register( "releasePrepare" ) {
130-
group = "Release"
131-
description = "Performs release preparations on local check-out, including updating changelog"
128+
def releasePrepareTask = tasks.register( "releasePrepare" ) {
129+
description "Performs release preparations on local check-out, including updating changelog"
130+
group "Release"
131+
dependsOn commitDocChangesTask
132+
132133
doFirst {
133134
if ( !project.hasProperty( 'releaseVersion' ) || !project.hasProperty( 'developmentVersion' )
134135
|| !project.hasProperty( 'gitRemote' ) || !project.hasProperty( 'gitBranch' ) ) {
@@ -162,9 +163,9 @@ tasks.register( "releasePrepare" ) {
162163
/*
163164
* Release everything
164165
*/
165-
tasks.register( 'ciRelease' ) {
166-
group = "Release"
167-
description = "Triggers the release on CI: creates commits to change the version (release, then development), creates a tag, pushes everything. Then CI will take over and perform the release."
166+
def ciReleaseTask = tasks.register( 'ciRelease' ) {
167+
description "Triggers the release on CI: creates commits to change the version (release, then development), creates a tag, pushes everything. Then CI will take over and perform the release."
168+
group "Release"
168169
dependsOn releasePrepare
169170

170171
doFirst {

0 commit comments

Comments
 (0)