Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing an Ant Build on Android Studio

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.

like image 717
Rose Perrone Avatar asked May 17 '13 21:05

Rose Perrone


People also ask

How do you run an Ant build?

To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.


2 Answers

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

like image 178
Xval Avatar answered Oct 08 '22 23:10

Xval


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/

like image 40
JoeHz Avatar answered Oct 08 '22 23:10

JoeHz