将引用的 jars 添加到 android build.xml [英] Adding referenced jars to android build.xml

查看:27
本文介绍了将引用的 jars 添加到 android build.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 android eclipse 项目,并通过以下方式生成了相应的 build.xml ant 文件:

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

这编译得很好.但是,在 Eclipse 中,我添加了三个引用的外部 jar(easymock、objenesis 和 cglib).在 Eclipse 中,一切正常,但是当我再次运行上述命令时,它不会将这些 jar 文件添加到类路径中.

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.

所以我的问题是如何告诉 build.xml 包含这些 jars?

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

我先做了一些研究,有些人建议更改 sdk 本身中的规则文件,但这是我想避免的,因为那样我团队中的每个人都需要这样做,这不切实际.

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.

谢谢斯蒂芬

推荐答案

对于 build.xml,你可以在你的一个属性文件中设置属性external.libs.dir"(比如 build.properties),默认情况下它指向您项目的 libs/ 文件夹 - 只需将所有 jars 放在那里

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

这篇关于将引用的 jars 添加到 android build.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆