1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-03 07:29:37 +00:00

Fixed problem where the compiler sometimes deletes a resource file when called. Closes #775

This commit is contained in:
jespergravgaard 2022-06-19 09:14:21 +02:00
parent 13a7063df0
commit 95aa5ec6c4
2 changed files with 3 additions and 3 deletions

View File

@ -420,7 +420,7 @@ public class KickC implements Callable<Integer> {
if(Files.exists(outResourcePath)) { if(Files.exists(outResourcePath)) {
FileTime resModified = Files.getLastModifiedTime(resourcePath); FileTime resModified = Files.getLastModifiedTime(resourcePath);
FileTime outModified = Files.getLastModifiedTime(outResourcePath); FileTime outModified = Files.getLastModifiedTime(outResourcePath);
if(outModified.toMillis() > resModified.toMillis()) { if(outModified.toMillis() >= resModified.toMillis()) {
// Outfile is newer - move on to next file // Outfile is newer - move on to next file
System.out.println("Resource already copied " + outResourcePath); System.out.println("Resource already copied " + outResourcePath);
continue; continue;

View File

@ -276,8 +276,8 @@ public class OutputFileManager {
* @return true if the resources should be copied * @return true if the resources should be copied
*/ */
public boolean shouldCopyResources() { public boolean shouldCopyResources() {
final Path cFileDirectory = primaryCFile.toAbsolutePath().getParent(); final Path cFileDirectory = primaryCFile.toAbsolutePath().getParent().normalize();
final Path outputDirectory = getOutputDirectory().toAbsolutePath(); final Path outputDirectory = getOutputDirectory().toAbsolutePath().normalize();
return !cFileDirectory.equals(outputDirectory); return !cFileDirectory.equals(outputDirectory);
} }