-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Uses Provider<ResolvedComponentResult> as input to Task #70
Conversation
294b917
to
69202fe
Compare
@@ -10,7 +10,6 @@ class GradleVersionArgumentsProvider : ArgumentsProvider { | |||
|
|||
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> = Stream | |||
.of( | |||
ParameterizedPluginArgs(gradleVersion = GradleVersion.version("7.3.3"), withConfigurationCache = false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test fails for 7.3 because resolutionRoot
is not available in this version.
internal const val DEPENDENCY_GUARD_TASK_NAME = "dependencyGuard" | ||
|
||
internal const val DEPENDENCY_GUARD_BASELINE_TASK_NAME = "dependencyGuardBaseline" | ||
} | ||
|
||
override fun apply(target: Project) { | ||
val extension = target.extensions.create( | ||
DEPENDENCY_GUARD_TASK_NAME, | ||
DEPENDENCY_GUARD_EXTENSION_NAME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not required in this diff, but is zero risk and slightly more explicit.
appendLine("") | ||
val availableConfigNames = availableConfigurations | ||
.filter { isClasspathConfig(it) } | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were using the return
at the end of the if
block, but if/else
reads better IMO as this is an exahaustive if/else
@@ -19,8 +20,8 @@ internal val Project.projectConfigurations: ConfigurationContainer | |||
configurations | |||
} | |||
|
|||
internal fun ConfigurationContainer.getResolvedComponentResult(name: String): ResolvedComponentResult = this | |||
internal fun ConfigurationContainer.getResolvedComponentResult(name: String): Provider<ResolvedComponentResult> = this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using recommended pattern in Config Cache Documentation: https://docs.gradle.org/current/userguide/configuration_cache.html
@@ -57,7 +58,7 @@ internal abstract class DependencyGuardListTask : DefaultTask() { | |||
abstract val projectPath: Property<String> | |||
|
|||
@get:Input | |||
abstract val monitoredConfigurationsMap: MapProperty<DependencyGuardConfiguration, ResolvedComponentResult> | |||
abstract val monitoredConfigurationsMap: MapProperty<DependencyGuardConfiguration, Provider<ResolvedComponentResult>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using recommended pattern in Config Cache Documentation: https://docs.gradle.org/current/userguide/configuration_cache.html
Following documentation on config cache https://docs.gradle.org/current/userguide/configuration_cache.html
Hopefully fixes #67 and #68
Chose to drop support for Gradle 7.3.x.
resolutionRoot
was unavailable prior to Gradle 7.4.