mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Disable incremental compilation if build file was modified.
This commit is contained in:
parent
edeaae8c4b
commit
a90ef6e6fa
3 changed files with 10 additions and 2 deletions
|
@ -41,4 +41,10 @@ class InternalContext {
|
||||||
private val incrementalSuccesses = hashSetOf<String>()
|
private val incrementalSuccesses = hashSetOf<String>()
|
||||||
fun previousTaskWasIncrementalSuccess(projectName: String) = incrementalSuccesses.contains(projectName) ?: false
|
fun previousTaskWasIncrementalSuccess(projectName: String) = incrementalSuccesses.contains(projectName) ?: false
|
||||||
fun setIncrementalSuccess(projectName: String) = incrementalSuccesses.add(projectName)
|
fun setIncrementalSuccess(projectName: String) = incrementalSuccesses.add(projectName)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keep track of whether the build file was modified. If this boolean is true, incremental compilation
|
||||||
|
* will be disabled.
|
||||||
|
*/
|
||||||
|
var buildFileOutOfDate: Boolean = false
|
||||||
}
|
}
|
|
@ -91,9 +91,9 @@ class IncrementalManager @Inject constructor(val args: Args) {
|
||||||
var upToDate = false
|
var upToDate = false
|
||||||
var taskOutputChecksum : String? = null
|
var taskOutputChecksum : String? = null
|
||||||
|
|
||||||
if (args.noIncremental) {
|
if (args.noIncremental || (Kobalt.context?.internalContext?.buildFileOutOfDate as Boolean)) {
|
||||||
//
|
//
|
||||||
// If the user turned off incremental builds, always run this task
|
// If the user turned off incremental builds or if the build file was modified, always run this task
|
||||||
//
|
//
|
||||||
logIncremental(LEVEL, "Incremental builds are turned off, running $taskName")
|
logIncremental(LEVEL, "Incremental builds are turned off, running $taskName")
|
||||||
upToDate = false
|
upToDate = false
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.beust.kobalt.app
|
||||||
|
|
||||||
import com.beust.kobalt.KobaltException
|
import com.beust.kobalt.KobaltException
|
||||||
import com.beust.kobalt.Plugins
|
import com.beust.kobalt.Plugins
|
||||||
|
import com.beust.kobalt.api.Kobalt
|
||||||
import com.beust.kobalt.api.KobaltContext
|
import com.beust.kobalt.api.KobaltContext
|
||||||
import com.beust.kobalt.api.Project
|
import com.beust.kobalt.api.Project
|
||||||
import com.beust.kobalt.internal.build.BuildFile
|
import com.beust.kobalt.internal.build.BuildFile
|
||||||
|
@ -111,6 +112,7 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
|
||||||
generateJarFile(context, BuildFile(Paths.get(pluginSourceFile.path), "Plugins",
|
generateJarFile(context, BuildFile(Paths.get(pluginSourceFile.path), "Plugins",
|
||||||
Paths.get(buildScriptJar)), buildScriptJarFile, buildFile)
|
Paths.get(buildScriptJar)), buildScriptJarFile, buildFile)
|
||||||
VersionFile.generateVersionFile(buildScriptJarFile.parentFile)
|
VersionFile.generateVersionFile(buildScriptJarFile.parentFile)
|
||||||
|
Kobalt.context.internalContext.buildFileOutOfDate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue