cbeust / kobalt

A Kotlin-based build system for the JVM.
Apache License 2.0
433 stars 60 forks source link

publishToMavenLocal doesn't overwrite existing files #423

Closed ethauvin closed 7 years ago

ethauvin commented 7 years ago
erik@Havok 16:12 /k/maven/repository/net/thauvin/erik/kobalt-versioneye/0.4.5
$ ll
total 41K
-rw-r--r-- 1 erik 197609  23K Apr 19 15:48 kobalt-versioneye-0.4.5.jar
───── kobalt-versioneye:publishToMavenLocal
Deploying 8 files to local maven /K:/maven/repository/

Thread report
╔════════════════════════════════════════╗
║  Time (sec) ║ Thread 28                ║
╠════════════════════════════════════════╣
║  0          ║ kobalt-versioneye        ║
║  21         ║ kobalt-versioneye (21)   ║
╚════════════════════════════════════════╝
          ╔═════════════════════════════════════════════════════════╗
          ║  Project                       ║ Build status║ Time     ║
          ╠═════════════════════════════════════════════════════════╣
          ║  kobalt-versioneye             ║ SUCCESS     ║ 21.54    ║
          ╚═════════════════════════════════════════════════════════╝
PARALLEL BUILD SUCCESSFUL (21 SECONDS), sequential build would have taken 21 seconds
16:17:08: External task execution finished 'publishToMavenLocal'.

erik@Havok 16:19 /k/maven/repository/net/thauvin/erik/kobalt-versioneye/0.4.5
$ ll
total 41K
-rw-r--r-- 1 erik 197609  23K Apr 19 15:48 kobalt-versioneye-0.4.5.jar
cbeust commented 7 years ago

Kobalt doesn't copy over files that are identical. Launch with --log 3 and you'll see:

Deploying 4 files to local maven /Users/cedricbeust/t/kobalt-maven-local/example/m2/repository/
    ./kobaltBuild/libs/exampl-0.1.pom
  Not copying, indentical files: /Users/cedricbeust/t/kobalt-maven-local/example/./kobaltBuild/libs/exampl-0.1.pom /Users/cedricbeust/t/kobalt-maven-local/example/m2/repository/net/ethauvin/exampl/0.1/exampl-0.1.pom
    ./kobaltBuild/libs/exampl-0.1.pom.md5
  Not copying, indentical files: /Users/cedricbeust/t/kobalt-maven-local/example/./kobaltBuild/libs/exampl-0.1.pom.md5 /Users/cedricbeust/t/kobalt-maven-local/example/m2/repository/net/ethauvin/exampl/0.1/exampl-0.1.pom.md5
    ./kobaltBuild/libs/example-0.1.jar
  Not copying, indentical files: /Users/cedricbeust/t/kobalt-maven-local/example/./kobaltBuild/libs/example-0.1.jar /Users/cedricbeust/t/kobalt-maven-local/example/m2/repository/net/ethauvin/exampl/0.1/example-0.1.jar
    ./kobaltBuild/libs/example-0.1.jar.md5
  Not copying, indentical files: /Users/cedricbeust/t/kobalt-maven-local/example/./kobaltBuild/libs/example-0.1.jar.md5 /Users/cedricbeust/t/kobalt-maven-local/example/m2/repository/net/ethauvin/exampl/0.1/example-0.1.jar.md5
ethauvin commented 7 years ago

But they are not identical, by timestamp or size.

ethauvin commented 7 years ago

Doesn't copy on Windows at all:

From KFiles.copy:

if (isWindows() && to!!.toFile().exists()) {
                kobaltLog(2, "Windows detected, not overwriting $to")
}