Controlling dx options with android gradle plugin 1.5.0

1,014 views
Skip to first unread message

Ariel Cattan

unread,
Nov 17, 2015, 4:48:50 AM11/17/15
to adt-dev
Hi guys,

Working with plugin 1.5.0 I'm trying to figure out how to set command line parameters for the dx. I am aware of the dexOptions directive, but it doesn't provide the full set of command line parameters available in dx.
In previous versions of the android plugin I was using the dex class and doing something like this:

if (dexTask.additionalParameters == null) dexTask.additionalParameters = []
dexTask.additionalParameters += '--no-locals'

However, in 1.5.0, even if I find the task "transformClassesWithDexForDebug", there is no longer an "additionalParameters" property on that task.
Is there another way to achieve that?

Specifically we need to control the following options:
--no-locals
--minimal-main-dex

Thanks!
Ariel

Xavier Ducrohet

unread,
Nov 19, 2015, 2:52:36 PM11/19/15
to adt...@googlegroups.com
This is not currently possible. We want to fix this. Do you need this per-variant?

--
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.



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Ariel Cattan

unread,
Nov 19, 2015, 4:04:07 PM11/19/15
to adt-dev
Thank you Xavier. At the moment we don't need it per variant. However, we do need to be able to set these options programmatically not necessarily at the very beginning of the build, because the decision is sometimes based on some processing we do in the transform. So the best is to be able to set it at any stage as long as it's done before the dex task actually starts running.
Thanks!
Ariel

Jacson Zhou

unread,
Jan 22, 2016, 11:52:28 AM1/22/16
to adt-dev
Hi guys, 

did you fix it,I  encountered similar problems in build tools 2.0.0-alpha3,can we find the task?

在 2015年11月17日星期二 UTC+8下午5:48:50,Ariel Cattan写道:

潘志舟

unread,
Apr 25, 2016, 4:05:55 PM4/25/16
to adt-dev
i also encountered,anyone has slove it? i want to add dx.additionalParameters to "--set-max-idx-number=***“


在 2015年11月17日星期二 UTC+8下午5:48:50,Ariel Cattan写道:
Hi guys,

Xavier Ducrohet

unread,
Apr 25, 2016, 4:11:25 PM4/25/16
to adt...@googlegroups.com
This is something we are looking at enabling again after 2.1.

--
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.

panzh...@126.com

unread,
Jun 15, 2016, 12:17:00 AM6/15/16
to adt...@googlegroups.com
Thanks for your kind response!
And  has now available? The specific version is ?2.1.1 or 2.1.2? And the use of way would not be changed ?since i want my app to be compatible with android 2.3,so i want to know the specific version of Gradle plugin which has enabled controlling dex function numbers
发自我的 iPhone
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/uGogKKuuHi8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages