Maven的Andr​​oid项目与测试套件 [英] Maven Android Project with Test Suite

查看:93
本文介绍了Maven的Andr​​oid项目与测试套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立在ActionBarSherlock(4.0 RC1),并用ViewPagerIndicator依赖一个项目,我目前使用的Eclipse IDE,我想能够建立并运行该项目的一个Android测试项目。我必须告诉Eclipse忽略的ProGuard和产生来源目标,以得到它停止给我的错误,似乎是它的解决方案,但我有一个很难确认是否仍然是正确的解决方案。我已经与ABS相当成功迄今,我能够部署一个包到有一个操作栏模拟器,和Eclipse似乎知道关于ABS的类和​​资源。然而,它并不知道有关的主题(如Theme.Sherlock.Light)并显示错误。我没事这一说法,但它意味着我不能使用Eclipse运行。但它似乎并不为ViewPagerIndicator工作。而且我一直运行到随机错误,这感觉就像我刚转了一圈跑来跑去。

I'm trying to set up a project with dependencies on ActionBarSherlock (4.0 RC1) and ViewPagerIndicator, I'm currently using Eclipse IDE, and I would like to be able to build and run an Android test project for this project. I had tell Eclipse to ignore the proguard and generate-sources goals to get it to stop giving me errors, it seems that was the solution for it, but I'm having a hard time confirming if that is still the correct solution. I've had moderate success with ABS thus far, I was able to deploy a package to the emulator that had an action bar, and Eclipse seems to know about the classes and resources in ABS. However, it doesn't know about the themes (like Theme.Sherlock.Light) and displays an error. I'm okay with that, except it means I can't run using Eclipse. But it doesn't seem to work for ViewPagerIndicator. And I keep running into random errors and it feels like I'm just running around in a circle.

所以我尝试添加一个测试项目(再次..),这样我就可以测试的项目,因为我构建它,以确保它符合我的所有规格在每一步。但我似乎无法得到那个工作。如果我能得到这些三件事情,以及如何运行测试,我应该能够调试所产生的其他问题,但因为它是现在我甚至不能确定问题所在。我的大部分研发已经取得了部分答案,并出的最新解决方案。

So I tried adding a test project (again..), so that I can test the project as I build it, to make sure it meets all my specifications at each step. But I can't seem to get that to work. If I could just get these 3 things and how to run the tests I should be able to debug other problems that are arising, but as it is now I can't even confirm where the problems lie. Most of my researching has yielded partial answers and out-of-date solutions.

使用:
ActionBarSherlock 4.0 RC1
ViewPagerIndicator 2.2.3
Android的Maven的插件3.1.1.99.0.6
阿帕奇Maven的3.0.3
Eclipse的靛蓝
M2E 1.0.100.20110804-1717

Using: ActionBarSherlock 4.0 RC1 ViewPagerIndicator 2.2.3 android-maven-plugin 3.1.1.99.0.6 Apache Maven 3.0.3 Eclipse Indigo m2e 1.0.100.20110804-1717

推荐答案

我也张贴在Maven的Andr​​oid系统的谷歌插件组这个问题,曼弗雷德·莫泽向我指出的 Gaug.es应用为Android 。它有一个设置了用Maven构建应用程序,并且有依赖关系ABS,ViewPagerIndicator,RoboGuice,Robotium,和其他几个人。它被设置做单元测试与仪器仪表神火测试和集成测试。

I also posted this question on the maven-android-plugin Google group, and Manfred Moser pointed me to Gaug.es app for Android. It has a set up for building the app with Maven, and has dependencies for ABS, ViewPagerIndicator, RoboGuice, Robotium, and a few others. It is set up to do unit tests with surefire and integration tests with instrumentation.

他还提到,他使用的IntelliJ IDEA,我想我会尽量为自己(由于Eclipse是给我的问题,TextMate的甚至不是IDE)。该社区版已服务很好,到目前为止,它提供了更好(或更容易理解)集成Ant和Maven,所以我可以指定我的清洁套装机器人:部署运行配置,例如:

He also mentioned that he uses IntelliJ IDEA, which I thought I would try for myself (since Eclipse was giving me issues and TextMate is not even an IDE). The Community Edition has been serving well so far,it provides nicer (or easier to understand) integration with ant and maven, so I can specify my "clean package android:deploy" run configuration, for example.

如果您遇到类似的问题,我会建议采取一看Gaug.es,它可以是一个有点霸道和做的比你想要或应该开始了。我可以张贴的是我从Gaug.es聚集在自己的应用程序,如果其他人是好奇的细节,但我想我要指出我的问题是目前解决,以及它是如何解决的。

If you're having similar issues, I would recommend taking a look at Gaug.es, it can be a little overbearing and do more than you want or should start off with. I can post the details of what I gathered from Gaug.es for my own app if anyone else is curious, but I thought I would note that my question is currently resolved, and how it was resolved.

这篇关于Maven的Andr​​oid项目与测试套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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