mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Features.
This commit is contained in:
parent
56d52e69f3
commit
a96f0367cb
4 changed files with 16 additions and 8 deletions
|
@ -0,0 +1,8 @@
|
|||
package com.beust.kobalt
|
||||
|
||||
class Features {
|
||||
companion object {
|
||||
/** If true, uses timestamps to speed up the tasks */
|
||||
const val USE_TIMESTAMPS = true
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.beust.kobalt.internal
|
||||
|
||||
import com.beust.kobalt.Features
|
||||
import com.beust.kobalt.KobaltException
|
||||
import com.beust.kobalt.TaskResult
|
||||
import com.beust.kobalt.api.*
|
||||
|
@ -170,7 +171,7 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
sourceDirectories.add(sourceDirectory)
|
||||
}
|
||||
val info = createCompilerActionInfo(project, context, isTest = false)
|
||||
if (isOutdated(project, context, info)) {
|
||||
if (! Features.USE_TIMESTAMPS || isOutdated(project, context, info)) {
|
||||
val compiler = ActorUtils.selectAffinityActor(project, context, context.pluginInfo.compilerContributors)
|
||||
if (compiler != null) {
|
||||
return compiler.compile(project, context, info)
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package com.beust.kobalt.misc
|
||||
|
||||
import com.beust.kobalt.IFileSpec
|
||||
import com.beust.kobalt.SystemProperties
|
||||
import com.beust.kobalt.Variant
|
||||
import com.beust.kobalt.*
|
||||
import com.beust.kobalt.api.Kobalt
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.homeDir
|
||||
import com.beust.kobalt.internal.build.BuildFile
|
||||
import com.beust.kobalt.maven.Md5
|
||||
import java.io.File
|
||||
|
@ -198,11 +195,12 @@ class KFiles {
|
|||
} else if (src.isDirectory) {
|
||||
dstFile.mkdirs()
|
||||
} else {
|
||||
if (dstFile.exists() && Md5.toMd5(src) == Md5.toMd5(dstFile)) {
|
||||
if (Features.USE_TIMESTAMPS && dstFile.exists() && Md5.toMd5(src) == Md5.toMd5(dstFile)) {
|
||||
log(2, " Identical files, not copying $src to $dstFile")
|
||||
} else {
|
||||
if (src.copyTo(dstFile, true) != src.length()) {
|
||||
if (onError(src, IOException("src.length() != dst.length()")) == OnErrorAction.TERMINATE)
|
||||
if (onError(src,
|
||||
IOException("src.length() != dst.length()")) == OnErrorAction.TERMINATE)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue