Skip to content
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: pluginJarFiles.from() can accept a Configuration directly. #1311

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/main/kotlin/com/github/spotbugs/snom/SpotBugsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ abstract class SpotBugsTask : DefaultTask(), VerificationTask {

private var enableWorkerApi: Boolean = true

@get:Internal
@get:Classpath
abstract val pluginJarFiles: ConfigurableFileCollection

@get:Internal
@get:Classpath
abstract val spotbugsClasspath: ConfigurableFileCollection

@get:Nested
Expand Down Expand Up @@ -372,18 +372,11 @@ abstract class SpotBugsTask : DefaultTask(), VerificationTask {

analyseClassFile.set(project.layout.buildDirectory.file("$name-analyse-class-file.txt"))

val pluginConfiguration = project.configurations.getByName(SpotBugsPlugin.PLUGINS_CONFIG_NAME)
pluginJarFiles.from(
project.provider { pluginConfiguration.files },
)
val configuration = project.configurations.getByName(SpotBugsPlugin.CONFIG_NAME)
val spotbugsSlf4j = project.configurations.getByName(SpotBugsPlugin.SLF4J_CONFIG_NAME)
spotbugsClasspath.from(
project.layout.files(
project.provider { spotbugsSlf4j.files },
project.provider { configuration.files },
),
)
val pluginConfiguration = project.configurations.named(SpotBugsPlugin.PLUGINS_CONFIG_NAME)
pluginJarFiles.from(pluginConfiguration)
val configuration = project.configurations.named(SpotBugsPlugin.CONFIG_NAME)
val spotbugsSlf4j = project.configurations.named(SpotBugsPlugin.SLF4J_CONFIG_NAME)
spotbugsClasspath.from(configuration, spotbugsSlf4j)
}

/**
Expand Down
Loading