Skip to content

Commit

Permalink
#83 support task caching in multi-module projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jk1 committed Jul 13, 2018
1 parent cc71b61 commit e9deaaf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/groovy/com/github/jk1/license/ReportTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import org.gradle.api.DefaultTask
import org.gradle.api.file.FileCollection
import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.*

@CacheableTask
class ReportTask extends DefaultTask {
Expand All @@ -38,9 +34,9 @@ class ReportTask extends DefaultTask {

@InputFiles
FileCollection getClasspath() {
ProjectReader.findConfigured(getProject()).inject(project.files(), { FileCollection memo, eachConfiguration ->
memo + eachConfiguration
})
(getProject().subprojects + getProject())
.collectMany { ProjectReader.findConfigured(it) }
.inject(project.files(), { FileCollection memo, eachConfiguration -> memo + eachConfiguration })
}

@Input
Expand Down

0 comments on commit e9deaaf

Please sign in to comment.