9

Does Android Studio support Ant builds?

I want to run a before-compilation Ant target.

Android Studio is new, so it seems possible it's not supported in favor of Gradle.

Rose Perrone
  • 61,572
  • 58
  • 208
  • 243

2 Answers2

8

[EDIT]

So it seems that Studio isn't meant to fully support Ant builds (see comments)

It worked fine for me until now, but I suppose there are specific configuration were it won't work as well.

InteliJ IDEA 13 EAP has all Studio features and supports Ant.

I would also like to point out that Gradle also support pre-build tasks, so you might want to consider switching to Gradle.

For those who will go will make that choice, you can generate a Gradle buil from your Eclipse project (Note : I haven't tested it, but it should take you less than minutes to try it out and see if it works for your project).

[ORIGINAL REPLY]

Android Studio definitively supports Ant builds. I have been using it on my company's project and it works fine.

But you are right that it strongly recommend Gradle, making it the default compiler for all new project created with Android Studio (but you could actually switch back to Ant).

Finally, as JoeHz pointed out, Android Studio is based on the open source version of IntelliJ, so you can also go download this version (which is currently much more stable than Android Studio).

Xval
  • 938
  • 5
  • 17
  • 2
    We recommend Gradle because we can make sense of what the project does by loading the project model. It's not possible with Ant. This means Studio may not know where your sources/resources are and some of the Android features in the editors will not work. Gradle is really the way to go. – Xavier Ducrohet May 22 '13 at 02:00
  • Thank you for your comment, I didn't realize Studio wasn't supposed to support Ant. I have nothing against Gradle, we were already thinking of switching to Gradle, especially for our CI server. – Xval May 22 '13 at 09:26
2

Android Studio is based on Intellij IDEA which certainly supports Ant. It can also read the Android Studio project file.

If you can deal with the two Android Studio features that currently aren't in the IDEA 13 EAP yet, you can download that and create an Ant Build.

http://blogs.jetbrains.com/idea/2013/05/intellij-idea-13-early-preview-is-out/

JoeHz
  • 2,136
  • 1
  • 18
  • 29