Android: Speed up compile

My kotlin android project (~9k lines/51 .kt files, and much more classes in it) build about 1.3 min on mac pro (3.5Ghz 6-core xeon e5/16gb 1866mhz ddr3 ecc/their pci-e flash storage) Gradle 2.2.1 /Android Studio 1.1/ kotlin plugin 0.10.1382.M.AndroidStudio 6 Because no incremental compile supported yet i ask you to help me improve build time if its possible.

My first thought was about multiple classes declaration in single kt file. Can it affect build time?

Any additional info is welcome. Speically about incremental compile eta’s

Hi, Dmitriy. You are not alone :) https://youtrack.jetbrains.com/issue/KT-6246 For now, they can't even estimate, when incremental compilation will be available

I’ve increaased build time for my project to 45-47 secs by elimination all unnecessary dependencies and removed multidex support. Fabric plugin also took about 7 secods. The best option for now is to optimize everything that doesn’t depend on kotlin.

I was wondering about that too because my android projects have also always taken quite a long time to build despite my respectable 8GB of Ram, 4 physical cores and 8 virtual cores @ 2Ghz with 256 fast GB ssd.

My projects use quite a lot of dependencies the main ones being :
Lucene.jar needed by a pure kotlin "core " lib that is needed by an “androidCore” android lib that is shared by 3 apps modules (with each just 1 or 2 classes)
(with either a proGuard pass or a multidex pass in the process becauseI bumped into the 65536 method limits)

And ever since I switched to kotlin, it has taken quite a long time to build (from 1 to 5 minutes… somehow, it lessens the benefits of writing kotlin code instead of java and makes the developmet process harder)

To be fair, it has improved a bit with gradle (no need to recompile sometimes) and with the progress of kotlin

Yet, every little bit of speed improvement is really welcome here.

(I guess that I could turn the 3 app modules into flavours too…)

M11 just pushed in repos, and build time now is about 30 sec, even full rebuild. Brilliant! Waiting for incremental compilation

The transition to M11 went smoothly but I still get 3min to build my projects :/