Skip to content

Commit f58c69a

Browse files
committed
Fix "doRelease" task
1 parent ad4d5b7 commit f58c69a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build.gradle

+9-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ task doRelease {
112112
checkLastVersionValueTask,
113113
'initializeSonatypeStagingRepository',
114114
'clean',
115-
'build',
116-
project.getTasksByName('publishToSonatype', true)
115+
'build'
117116
)
118117
}
119118

@@ -122,3 +121,11 @@ model {
122121
dependsOn updateLastVersionValueTask
123122
}
124123
}
124+
// dependency on 'publishToSonatype' must be added in a 'afterEvaluate' bloc, see https://github.com/gradle/gradle/issues/16543#issuecomment-2529428010
125+
afterEvaluate {
126+
model {
127+
tasks.doRelease {
128+
dependsOn project.getTasksByName('publishToSonatype', true)
129+
}
130+
}
131+
}

0 commit comments

Comments
 (0)