File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1919
2020import org.gradle.internal.logging.text.StyledTextOutput
2121import org.gradle.internal.logging.text.StyledTextOutputFactory
22- import org.gradle.kotlin.dsl.support.serviceOf
2322
2423plugins {
2524 // Apply precompiled plugins.
@@ -41,9 +40,18 @@ configurations.all {
4140 }
4241}
4342
43+ // A provider to get a StyledTextOutputFactory via dependency injection.
44+ interface StyledTextOutputProvider {
45+ @get:Inject
46+ val out : StyledTextOutputFactory
47+ }
48+
4449tasks.named<Jar >(" jar" ) {
50+ // Resolve objects at configuration time to be compatible with the configuration cache.
51+ val objects = objects
52+
4553 doLast {
46- val out = serviceOf< StyledTextOutputFactory >().create(" detekt-rules" )
54+ val out = objects.newInstance< StyledTextOutputProvider >(). out .create(" detekt-rules" )
4755 val message = " The detekt-rules have changed. You need to stop the Gradle daemon to allow the detekt plugin " +
4856 " to reload for the rule changes to take effect."
4957 out .withStyle(StyledTextOutput .Style .Info ).println (message)
You can’t perform that action at this time.
0 commit comments