Custom Class Loading in Dalvik

We are planning to migrate the android ANT build to Gradle. i have currently using gradle android build (0.9.0)

The issue i am facing now is that our apps can contain more than 64K method references, which is the maximum number of supported in a dex file

In ANT we are using custom class loading where we override the -dex task and load some file in secondary dex file during the build. All detail for ANT was mentioned in detail in this android developer blog

Please let me know how can i override the custom dexDebug, dexRelease tasks from the build.gradle

I recommend to ask this question on the Android tooling list.