mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Timestamps for Kotlin compilation.
This commit is contained in:
parent
e3f98ee255
commit
0f630f0756
2 changed files with 9 additions and 4 deletions
|
@ -130,6 +130,8 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
open fun toClassFile(sourceFile: String) = sourceFile + ".class"
|
||||
|
||||
fun addCompilerArgs(project: Project, vararg args: String) {
|
||||
project.projectProperties.put(COMPILER_ARGS, arrayListOf(*args))
|
||||
}
|
||||
|
@ -149,12 +151,13 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
else return sourceFile
|
||||
}
|
||||
|
||||
fun toClassFile(sourceFile: String) = stripSuffix(sourceFile) + ".class"
|
||||
|
||||
actionInfo.sourceFiles.map { it.replace("\\", "/") }.forEach { sourceFile ->
|
||||
val stripped = stripSourceDir(sourceFile)
|
||||
val classFile = File(KFiles.joinDir(project.directory, project.classesDir(context), toClassFile(stripped)))
|
||||
val classFile = File(KFiles.joinDir(project.directory, project.classesDir(context),
|
||||
toClassFile(stripSuffix(stripped))))
|
||||
if (! classFile.exists() || File(sourceFile).lastModified() > classFile.lastModified()) {
|
||||
log(2, "Outdated $sourceFile $classFile " + Date(File(sourceFile).lastModified()) +
|
||||
" " + classFile.lastModified())
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,6 +145,8 @@ class KotlinPlugin @Inject constructor(
|
|||
fun addDokkaConfiguration(project: Project, dokkaConfig: DokkaConfig) {
|
||||
dokkaConfigurations.put(project.name, dokkaConfig)
|
||||
}
|
||||
|
||||
override fun toClassFile(sourceFile: String) = sourceFile + "Kt.class"
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue