Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems less “dark secrets”, more “incremental compilation 101”


It's a dark secret if you're used to maven and java...


Maven is incremental per default. Also java compilation is much faster than kotlin, so it is less of a problem.

Furthermore, IntelliJ (as much as I love it) has a terrible live compilation story compared to eclipse. Eclipse recompiles affected project files while you type and propagates errors live. Harp on java where it's at least factual, (crufty stdlib, missing uints, type erasure..). Java is miles ahead what tooling and maturity of the ecosystem is concerned.


Is it? Maybe our company is doing something stupid then.

I'm not mainly a Java person, but I do sometimes pitch in here and there. We're using maven, and it's definitely not doing incremental compilation. I mentioned this was crazy to the Java guys and they said it was normal for maven...

(They're also in an IDE most of the time, so maybe they don't care so much.)


They probably invoke maven with "mvn clean package" which does a fresh complete build, but only for deploying it.


I'm running "mvn install -DskipTests" w/ no files changed. It takes about 22 seconds and I see messages like

> Changes detected - recompiling the module!

> [INFO] Compiling 734 source files...

Perhaps we're doing something strange or dumb or somehow don't have incremental compilation turned on...


It seems[1] there's a flag called useIncrementalCompilation which is indeed enabled by default but doesn't actually cause any incremental compilation to happen.

Setting the flag to false causes it to compile only changed files, but this will give incorrect results, for the reasons described in the Kotlin blog post.

[1] https://stackoverflow.com/a/49700942




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: