简体   繁体   English

当它依赖于具有 Android 库项目依赖项的非库项目时,如何使用 ANT 构建我的项目?

[英]How do I build my project with ANT when it depends on a non-library project with an Android library project dependency?

I'm trying to build my project using ANT. My project uses ActionbarSherlock, and Roboguice-Sherlock.我正在尝试使用 ANT 构建我的项目。我的项目使用 ActionbarSherlock 和 Roboguice-Sherlock。 ActionbarSherlock is an Android library project, but Roboguice-Sherlock is not. ActionbarSherlock 是一个 Android 库项目,但 Roboguice-Sherlock 不是。 It's not even an Android project at all.它甚至根本不是 Android 项目。 See here:看这里:

https://github.com/rtyley/roboguice-sherlock https://github.com/rtyley/roboguice-sherlock

I can get ActionbarSherlock to build using ANT no problem, the problem lies with Roboguice-Sherlock.我可以使用 ANT 构建 ActionbarSherlock 没问题,问题在于 Roboguice-Sherlock。 It's not an Android project, yet it has dependencies on Android and ActionbarSherlock, as well as Roboguice.它不是 Android 项目,但它依赖于 Android 和 ActionbarSherlock,以及 Roboguice。 When I try to build I get a ton of errors saying it can't find the Roboguice-Sherlock stuff.当我尝试构建时,我遇到了很多错误,说它找不到 Roboguice-Sherlock 的东西。

If your project has the Roboguice .jar and the library project reference to ActionBarSherlock already configured you should be able to just drop it into your libs/ folder to have it automatically picked up.如果你的项目有 Roboguice .jar并且已经配置了对 ActionBarSherlock 的库项目引用,你应该能够将它放入你的libs/文件夹中以自动获取它。

I am working with Roberto to ensure that the .jar of his project gets uploaded to GitHub for non-Maven users to use.我正在与 Roberto 合作,以确保他的项目的.jar被上传到 GitHub 以供非 Maven 用户使用。

For now, you can clone the project simply run mvn clean package to get a standalone .jar in the target/ folder which will enable you to do as I described above.现在,您可以克隆该项目,只需运行mvn clean package即可在target/文件夹中获得一个独立的.jar ,这将使您能够按照我上面的描述进行操作。

You need to add robiguice-sherlock as a.jar to your Android project.您需要将 robiguice-sherlock 作为 a.jar 添加到您的 Android 项目中。 You can download it here (click Download (JAR) ).您可以在此处下载它(单击下载 (JAR) )。 Trying to build the source in Android will fail because it is not an Android project.尝试在 Android 中构建源将失败,因为它不是 Android 项目。 Once it is in your directory, you need to open project properties and add the.jar to your build path.一旦它位于您的目录中,您需要打开项目属性并将 .jar 添加到您的构建路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM