mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Fix for #104: if depended-on project changes dependent project's jar should be updated.
This commit is contained in:
parent
66c4f9a1e0
commit
c90fbb6a41
2 changed files with 18 additions and 3 deletions
|
@ -82,7 +82,8 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI
|
|||
var upToDate = false
|
||||
var taskOutputChecksum : String? = null
|
||||
inputChecksumFor(taskName)?.let { inputChecksum ->
|
||||
if (inputChecksum == iit.inputChecksum) {
|
||||
val dependsOnDirtyProjects = project.projectInfo.dependsOnDirtyProjects(project)
|
||||
if (inputChecksum == iit.inputChecksum && ! dependsOnDirtyProjects) {
|
||||
outputChecksumFor(taskName)?.let { outputChecksum ->
|
||||
taskOutputChecksum = iit.outputChecksum()
|
||||
if (outputChecksum == taskOutputChecksum) {
|
||||
|
@ -91,10 +92,15 @@ class IncrementalManager(val fileName: String = IncrementalManager.BUILD_INFO_FI
|
|||
logIncremental(2, "Incremental task $taskName output is out of date, running it")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (dependsOnDirtyProjects) {
|
||||
logIncremental(2, "Project ${project.name} depends on dirty project, running $taskName")
|
||||
} else {
|
||||
logIncremental(2, "Incremental task $taskName input is out of date, running it"
|
||||
+ " old: $inputChecksum new: ${iit.inputChecksum}")
|
||||
}
|
||||
project.projectInfo.isDirty = true
|
||||
}
|
||||
}
|
||||
if (! upToDate) {
|
||||
val result = iit.task(project)
|
||||
|
|
|
@ -28,6 +28,13 @@ interface IProjectInfo {
|
|||
* The list of projects that this project depends on
|
||||
*/
|
||||
val dependsOn: ArrayList<Project>
|
||||
|
||||
var isDirty: Boolean
|
||||
|
||||
/**
|
||||
* @return true if any of the projects we depend on is dirty.
|
||||
*/
|
||||
fun dependsOnDirtyProjects(project: Project) = project.projectInfo.dependsOn.any { it.projectInfo.isDirty }
|
||||
}
|
||||
|
||||
abstract class BaseProjectInfo : IProjectInfo {
|
||||
|
@ -43,4 +50,6 @@ abstract class BaseProjectInfo : IProjectInfo {
|
|||
}
|
||||
|
||||
override val dependsOn = arrayListOf<Project>()
|
||||
|
||||
override var isDirty = false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue