robolectric - Is it necessary to use gradle with roboelectric for android unit testing? -


i , team have built android library project. built on eclipse using ant build it. presently aren't using gradle. have roboelectric dependencies jar file instead. when use this, while running unit tests, following error comes up

warning: multiple versions of ant detected in path junit  [junit]          jar:file:/users/prateekarora/desktop/eclipse/plugins/org.apache.ant_1.9.2.v201404171502/lib/ant.jar!/org/apache/tools/ant/project.class [junit]      , jar:file:/users/prateekarora/trunk/client/android/mccmobileclient/test2/libs/robolectric-2.3-with-dependencies.jar!/org/apache/tools/ant/project.class 

when remove apache ant eclipse's plugin folder, stops working. can explain why happening? also, necessary use roboelectric gradle? if no, can find roboelectric's jar files with/without dependencies?

it not necessary use gradle robolectric. running specified java class (from junit) proper classpath (including source, test code , dependencies). fixing case not easy make on stackoverflow (it challenge if sit behind same computer).

here possible solutions:

  1. migrate project build gradle
  2. keep using ant move dependency management manuals jars ivy
  3. keep using ant , manual jars dependency, try robolectric.jar dependencies except ant one

the first 1 option easiest option me. require change mindset bit officially 1 supported build tool google there lot of examples , people help.

the second 1 require learn how use new tool. there less examples ivy usage in android projects.

the third 1 require write custom script removes ant jar file or rebuild robolectric-all.jar without 1 (ant) dependency. require dive maven build tool learning


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -