Why "compile...WithJavac" takes a long time when I only change one java line?

72 views
Skip to first unread message

thierryd

unread,
Dec 17, 2015, 9:28:27 AM12/17/15
to adt-dev
I'm trying to speed my build in Android Studio 1.5.1 with the latest build tools. I'm using:

buildToolsVersion '23.0.2'
com.android.tools.build:gradle:2.0.0-alpha3
dexOptions.incremental false
dexOptions.preDexLibraries true
dexOptions.javaMaxHeapSize "4g"
dexOptions.dexInProcess true

My app is multidex, uses flavor and flavorDimensions.

Right now when I change a java line, my build time is 27s. When I run the profile option, the following tasks take much of the time:

:app:compileReplicaLaPresseDebugJavaWithJavac 8.998s
:app:transformClassesWithDexForReplicaLaPresseDebug 5.993s
:app:transformClassesWithMultidexlistForReplicaLaPresseDebug 4.385s
:app:transformClassesWithJarMergingForReplicaLaPresseDebug 3.224s
:app:packageReplicaLaPresseDebug 3.116s

Is there anything wrong with my setup? I'm surprised compileReplicaLaPresseDebugJavaWithJavac takes 9 seconds, as I have only changed one line.

I know I could target Lolipop+ to avoid the multidex penalty. But installing on Lolipop takes such a long time that I prefer my old Nexus 10 v4.4. :)

Jerome Dochez

unread,
Dec 17, 2015, 1:07:14 PM12/17/15
to adt-dev
in 1.5.x, the javac task is not incremental so all java sources are recompiled every time.

we actually just enabled incremental javac compilation so it will be available in the next alpha or beta release of 2.0.0 if you are brave enough to try it !

jerome

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

thierryd

unread,
Dec 18, 2015, 8:27:17 AM12/18/15
to adt-dev
Merci Jerome!
Is there any official channel I can follow to know when an alpha or beta release is available? I just found out by accident that there is a "alpha-3" released last week.
Thierry :)

Jerome Dochez

unread,
Dec 19, 2015, 1:37:11 AM12/19/15
to adt-dev

tools.android.com is where we announce releases. you can also follow releases on jcenter automatically.

jerome

Reply all
Reply to author
Forward
0 new messages