views:

78

answers:

1

We currently build our Android (Java) projects using the built-in Eclipse build tools. Then we have a separate ANT build script for automated building, unit testing, etc.

I would like to switch to using the ANT script inside Eclipse as well. What I can't figure out is how Eclipse content assist and refactoring tools will interact with such an arrangement.

Can I continue to use the Eclipse refactoring / content assist tools, while never using the Eclipse build button? We don't currently use the "Automatic Building" mode for Eclipse, so I don't care about that.

On a related note, will a tool like ANT be able to build just as little as Eclipse does? Or does Eclipse do something a lot more intelligent that modification-date checking to limit how much it builds?

A: 

You can absolutely do it. With Ant it's easy - just do Window->Show View->Ant and then drag your build.xml to it. After that you can just double-click on the target which will kick the Ant build. Of course you can still use Eclipse for anything else

DroidIn.net
I realize I can run the ANT from Eclipse, but my question is if Eclipse will be able to use the class information. It usually has to build to be fully aware of the code -- meaning that before I build, it usually doesn't auto-complete everything and/or can't do every refactoring.
Artem
If you put class(es) in location that is mapped as classpath in Eclipse then yes
DroidIn.net
DroidIn, could you clarify how I can do that? Where does one specify such a classpath? I am not super-strong in Java / Eclipse integration, so I only know classpath as a way to specify external dependencies.
Artem
That really simple. When you run ant your classes getting generated in some directory, say C:\my projects\classes. Simply do right-click on your top project folder in Eclipse, select Properties. In the pop-up select "Java Build Path" and then in the right pane at the bottom you will see "Default output folder". Click "Browse" button next to it and navigate to the directory where your ant build puts the class files. Of course if your class has a package, say com.foo.MyClass.class the directory I'm talking about would have a nested "com" folder
DroidIn.net