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

configuration cache #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final
val dependencies: DependencyHandler = project.dependencies

setupEnvironment(configurations)
initDependencies(configurations)
initDependencies(configurations, dependencies)
generatePOMInfo(mavenReader, configurations, dependencies)

// Create CSV report
Expand Down Expand Up @@ -164,7 +164,10 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final
}

/** Iterate through all configurations and collect dependencies. */
private fun initDependencies(configurations: ConfigurationContainer) {
private fun initDependencies(
configurations: ConfigurationContainer,
dependencies: DependencyHandler,
) {
// Add POM information to our POM configuration
val configurationSet = linkedSetOf<Configuration>()
val configurationList = mutableListOf("api", "compile", "implementation")
Expand Down Expand Up @@ -193,7 +196,7 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final
val gav = "${id.group}:${id.name}:${id.version}@pom"
configurations
.getByName(pomConfiguration)
.dependencies += project.dependencies.add(pomConfiguration, gav)
.dependencies += dependencies.add(pomConfiguration, gav)
}
}

Expand Down Expand Up @@ -272,7 +275,7 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final
private fun getParentPomFile(
model: Model,
configurations: ConfigurationContainer,
dependencies: DependencyHandler
dependencies: DependencyHandler,
): File? {
// Get parent POM information
val parent = model.parent
Expand Down