@@ -79,36 +79,45 @@ internal class BaseConventionPlugin(private val project: Project) {
7979 .orElse(" false" )
8080 .map { it.toBoolean() }
8181
82- val taskGraph = gradle.taskGraph
83- val isFunctionalTest : Provider < Boolean > = providers.provider { taskGraph.hasTask( " :functionalTest " ) }
82+ // Both these values are static and safe to get during configuration
83+ val shouldSign = ! isCi.get() && ! isSnapshot.get()
8484
8585 tasks.withType(Sign ::class .java).configureEach { t ->
86+ // Disabling this task is better than configuring it with `onlyIf()`. The latter is evaluated at execution time,
87+ // so the task still has to get serialized during the CC store phase, which takes a very long time when Sign task
88+ // inputs must be serialized. Apparently the task is "some of the worst code in Gradle in terms of laziness"
89+ // (personal communication).
90+ t.enabled = shouldSign
91+
8692 with (t) {
8793 inputs.property(" version" , publishedVersion)
88- inputs.property(" is-snapshot" , isSnapshot)
89- inputs.property(" is-ci" , isCi)
90- inputs.property(" is-functional-test" , isFunctionalTest)
91-
92- // Don't sign snapshots
93- onlyIf(" Not a snapshot" ) {
94- ! (inputs.properties[" is-snapshot" ] as Boolean )
95- }
96- // We currently don't support publishing from CI
97- onlyIf(" release environment" ) {
98- ! (inputs.properties[" is-ci" ] as Boolean )
99- }
100- // Don't sign when running functional tests
101- onlyIf(" not running functional tests" ) {
102- ! (inputs.properties[" is-functional-test" ] as Boolean )
103- }
104-
94+ // inputs.property("is-snapshot", isSnapshot)
95+ // inputs.property("is-ci", isCi)
96+ // inputs.property("is-functional-test", isFunctionalTest)
97+ //
98+ // // Don't sign snapshots
99+ // onlyIf("Not a snapshot") {
100+ // !(inputs.properties["is-snapshot"] as Boolean)
101+ // }
102+ // // We currently don't support publishing from CI
103+ // onlyIf("release environment") {
104+ // !(inputs.properties["is-ci"] as Boolean)
105+ // }
106+ // // Don't sign when running functional tests
107+ // onlyIf("not running functional tests") {
108+ // !(inputs.properties["is-functional-test"] as Boolean)
109+ // }
110+ //
105111 doFirst {
106112 val version = inputs.properties[" version" ] as String
107113 logger.quiet(" Signing v$version " )
108114 }
109115 }
110116 }
111117
118+ val taskGraph = gradle.taskGraph
119+ val isFunctionalTest: Provider <Boolean > = providers.provider { taskGraph.hasTask(" :functionalTest" ) }
120+
112121 tasks.withType(DokkaGeneratePublicationTask ::class .java).configureEach { t ->
113122 val key = " is-functional-test"
114123 t.inputs.property(key, isFunctionalTest)
0 commit comments