I am creating a library for Android that others can include in their own project. So far, I have been working on it as a regular Java project, with JDK 1.6 configured as a system library. This works very well in Eclipse when I add android.jar.
The problem occurs when I try to create my build script. I run Gradle and do a normal build and test cycle. My thoughts were that it doesn’t matter if I compile it using a regular JDK, since this is not a separate application. The benefits of creating a regular Java project are that Gradle supports this much better. My project also does not contain any interface. However, the problem is, of course, android.jar and the JDK contain many of the same classes, and I think this is what messed up my script compiler. All crashes when running tests (tests are in the same project in src / test / java).
My question is: how do I create this project, which should be included in Android projects as a third-party library? Should I create it as an Android project in Eclipse, although I only create a library that does not use any user interface features? In addition, should tests be in a separate project?
Thanks for all the answers!
source
share