• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

robolectric/deckard-maven: A simple template project for test-driven Android dev ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

robolectric/deckard-maven

开源软件地址(OpenSource Url):

https://github.com/robolectric/deckard-maven

开源编程语言(OpenSource Language):

Java 83.8%

开源软件介绍(OpenSource Introduction):

Deckard (for Maven)

Build Status

Deckard is the simplest possible Android project that uses Robolectric for testing and Maven to build. It has one Activity (with an empty layout), and a Robolectric test that creates that Activity.

Deckard also imports seamlessly into IntelliJ, due to IntelliJ's support for Maven. Just import the pom.xml.

Eclipse is also supported. Install the m2e-android plugin for Eclipse, and import the project as a Maven project. After importing into Eclipse, you have to mark the consume-aar goal as ignored, since aar consumption is not yet supported by m2e-android. To do this, simply apply the Quick fix on the "Plugin execution not covered by lifecycle configuration" error.

Setup

Note: These instructions assume you have a Java 1.6 JDK installed.

To start a new Android project:

  1. Install the Android SDK. On Mac OS X with Homebrew just run:

    brew install android-sdk
  2. Set your ANDROID_HOME environment variable to /usr/local/opt/android-sdk.

  3. Install Maven if you haven't already (run mvn to check). On OS X (as before) this is easiest with Homebrew:

    brew install maven
  4. Download Deckard from GitHub:

    wget https://github.com/robolectric/deckard-maven/archive/master.zip
    unzip master.zip
    mv deckard-maven-master my-new-project
  5. Run the setup script to install dependencies into Maven:

    my-new-project/setup.sh
  6. In the project directory you should be able to run the tests:

    cd my-new-project
    mvn clean test
  7. Optionally, import the project into IntelliJ (or Eclipse) by selecting 'Import Project' in IntelliJ and selecting the project's pom.xml. When prompted to pick an SDK you just need to select the Android SDK home and your JDK.

  8. Change the names of things from 'Deckard' to whatever is appropriate for your project. Package name, classes, and the AndroidManifest are good places to start.

  9. Build an app. Win.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap