Skip to content

Commit be02a4e

Browse files
committed
Fix incremental execution of GatherLicenseTask: the task now is non-incremental in case overides are present
Ideally the task should be incremental in all the cases, however, override tracking is not implemented yet.
1 parent 9594032 commit be02a4e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/GatherLicenseTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ open class GatherLicenseTask @Inject constructor(
9797
) : DefaultTask() {
9898
init {
9999
// TODO: capture [licenseOverrides] as input
100-
outputs.upToDateWhen { false }
100+
outputs.upToDateWhen { licenseOverrides.isEmpty() }
101101
}
102102

103103
@InputFiles

plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/LicenseOverrides.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class LicenseOverrides {
2424
private val map = mutableMapOf<String, LicenseOverride>()
2525
private val usedOverrides = mutableSetOf<String>()
2626

27+
fun isEmpty(): Boolean = map.isEmpty()
28+
2729
val unusedOverrides: Set<String> get() = map.keys.minus(usedOverrides)
2830

2931
fun configurationComplete() {

0 commit comments

Comments
 (0)