Fix IC with daemon

JPS IC with daemon was not working since
the commit 514635e965

Before that change `IncrementalCompilation.isEnabled`
returned `true` when the corresponding system property was not set.
After the change `isEnabled` returns `true` only if
the system property is set and equals to `"true"`.

The property was never set up for the daemon if `CompilerMode.JPS_COMPILER`
was used (the property was set up in a JPS process or in the daemon in case
it was used with Gradle).

     #KT-19414 fixed
This commit is contained in:
Alexey Tsvetkov
2017-08-02 22:49:20 +03:00
parent 82c62b4d8e
commit f0becd0040
2 changed files with 7 additions and 5 deletions
@@ -71,9 +71,9 @@ private object EmptyICReporter : ICReporter {
}
}
inline fun <R> withIC(fn: ()->R): R {
inline fun <R> withIC(enabled: Boolean = true, fn: ()->R): R {
val isEnabledBackup = IncrementalCompilation.isEnabled()
IncrementalCompilation.setIsEnabled(true)
IncrementalCompilation.setIsEnabled(enabled)
try {
return fn()