Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding referenced jars to android build.xml

I have an android eclipse project and have generated the corresponding build.xml ant file by doing:

android update test-project -p . -m ..\main_project

This compiles fine. However, in eclipse I have then added three referenced external jars (easymock, objenesis and cglib). In eclipse everything builds fine but then when I run the above command again it doesn't add these jars to the classpath.

So my question is how to tell the build.xml to include these jars?

I have done some research first and some people suggested changing the rules files in the sdk itself but this is something I want to avoid as then everyone in my team would need to do this and that's not practical.

Thanks Stephen

like image 694
steprobe Avatar asked Oct 11 '11 08:10

steprobe


3 Answers

add jar.libs.dir=your_path_here/lib in ant.properties for SDK >=8

like image 141
Taranfx Avatar answered Oct 01 '22 14:10

Taranfx


For build.xml you can set property "external.libs.dir" in one of your properties file( like build.properties), by default it points to libs/ folder of your project - simply put there all your jars

external.libs.dir=<your_custom_path>/lib
like image 36
ACM64 Avatar answered Oct 01 '22 15:10

ACM64


You should ideally use libs/ not lib, to remain consistent with Eclipse.

like image 31
Joe Malin Avatar answered Oct 01 '22 13:10

Joe Malin