Ant 使用依赖库构建 Android 项目 [英] Ant build Android project with dependency lib

查看:29
本文介绍了Ant 使用依赖库构建 Android 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 Android 项目,一个共享库和一个应用程序.现在我想编译依赖于库的应用程序.在 Eclipse 中,它工作得很好.之后,我通过 git 将其上传到我的存储库并触发 Jenkins 构建这两个项目.

I have two Android projects, one shared library and the app. Now I want to compile the app with dependency to the library. In Eclipse, it works very well. After that, I upload it via git to my repository and trigger Jenkins to build both projects.

我的问题是,发生错误:sdk/android-sdk-linux/tools/ant/build.xml:440:../shared-lib 解析为没有项目的 project.properties 文件的路径".这很清楚,因为在 Jenkins 中,作业的存储方式与在 Eclipse 中不同.

My problem is, that the error occurs: "sdk/android-sdk-linux/tools/ant/build.xml:440: ../shared-lib resolve to a path with no project.properties file for project". That's clear, because in Jenkins the jobs are stored different than under Eclipse.

另一个问题是,Eclipse 将共享编译为.jar",Ant 将其编译为classes.jar"(在 sdk/android-sdk-linux/tools/ant/build.xml 中命名).

Another problem is, that Eclipse compiled the shared to ".jar" and Ant compiled it to "classes.jar" (is named in sdk/android-sdk-linux/tools/ant/build.xml).

推荐答案

我用复制文件修复了它.第一个项目构建我的 shared-lib.jar.其他项目(手机和平板电脑)将此文件(shared-lib.jar)复制到 libs-文件夹并正确构建.但是现在我在服务器和我的开发客户端上有不同的 projects.properties.这个没有签入git.

I fixed it with copy files. The first project builds my shared-lib.jar. The other projects (phone and tablet) copy this file (shared-lib.jar) to there libs-folder and build correctly. But now I have different projects.propertieson the server and my dev-client. This one is not checked in into git.

这篇关于Ant 使用依赖库构建 Android 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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