1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 08:38:13 -07:00

Disable smart incremental build.

Until I can find a better way of implementing it.
This commit is contained in:
Cedric Beust 2016-04-02 05:13:09 -07:00
parent 676ab50617
commit edeaae8c4b
2 changed files with 22 additions and 14 deletions

View file

@ -20,13 +20,8 @@ class KobaltContext(val args: Args) {
fun findPlugin(name: String) = Plugins.findPlugin(name) fun findPlugin(name: String) = Plugins.findPlugin(name)
/** /** For internal use only */
* When an incremental task decides it's up to date, it sets this boolean to true so that subsequent val internalContext = InternalContext()
* tasks in that project can be skipped as well. This is an internal field that should only be set by Kobalt.
*/
private val incrementalSuccesses = hashSetOf<String>()
fun previousTaskWasIncrementalSuccess(projectName: String) = incrementalSuccesses.contains(projectName) ?: false
fun setIncrementalSuccess(projectName: String) = incrementalSuccesses.add(projectName)
// //
// Injected // Injected
@ -38,3 +33,12 @@ class KobaltContext(val args: Args) {
lateinit var settings: KobaltSettings lateinit var settings: KobaltSettings
} }
class InternalContext {
/**
* When an incremental task decides it's up to date, it sets this boolean to true so that subsequent
* tasks in that project can be skipped as well. This is an internal field that should only be set by Kobalt.
*/
private val incrementalSuccesses = hashSetOf<String>()
fun previousTaskWasIncrementalSuccess(projectName: String) = incrementalSuccesses.contains(projectName) ?: false
fun setIncrementalSuccess(projectName: String) = incrementalSuccesses.add(projectName)
}

View file

@ -97,12 +97,16 @@ class IncrementalManager @Inject constructor(val args: Args) {
// //
logIncremental(LEVEL, "Incremental builds are turned off, running $taskName") logIncremental(LEVEL, "Incremental builds are turned off, running $taskName")
upToDate = false upToDate = false
} else if (iti.context.previousTaskWasIncrementalSuccess(project.name)) { // } else if (iti.context.internalContext.previousTaskWasIncrementalSuccess(project.name)) {
// // //
// If the previous task was an incremental success, no need to run this task // // If the previous task was an incremental success, no need to run this task.
// //
logIncremental(LEVEL, "Previous incremental task was a success, not running $shortTaskName") // Disabled for now since this can only work if exactly the previous task was
upToDate = true // an incremental success. If it was a regular task, then this boolean should be
// set back to false, which is currently not done.
// //
// logIncremental(LEVEL, "Previous incremental task was a success, not running $shortTaskName")
// upToDate = true
} else { } else {
// //
// First, compare the input checksums // First, compare the input checksums
@ -156,7 +160,7 @@ class IncrementalManager @Inject constructor(val args: Args) {
// Identical input and output checksums, don't run the task // Identical input and output checksums, don't run the task
// //
logIncremental(LEVEL, "Incremental task \"$taskName\" is up to date, not running it") logIncremental(LEVEL, "Incremental task \"$taskName\" is up to date, not running it")
iti.context.setIncrementalSuccess(project.name) iti.context.internalContext.setIncrementalSuccess(project.name)
TaskResult() TaskResult()
} }
} }