4 ms·
Seems less “dark secrets”, more “incremental compilation 101”
by meisel 6y ago
Seems less “dark secrets”, more “incremental compilation 101”
- dilap 6y agoIt's a dark secret if you're used to maven and java...
- ysleepy 6y agoMaven 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.
- dilap 6y agoIs 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.)
- ysleepy 6y agoThey probably invoke maven with "mvn clean package" which does a fresh complete build, but only for deploying it.
- dilap 6y agoI'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...
- ptx 6y agoIt 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 https://stackoverflow.com/a/49700942