jberkel / android-plugin

An sbt plugin for Android development in Scala
https://groups.google.com/forum/#!forum/scala-on-android
Other
476 stars 113 forks source link

Minimize test work #116

Closed loganj closed 11 years ago

loganj commented 12 years ago

This branch does a couple of things.

  1. It fixes runtime errors caused by duplicated/overlapping inclusion of libraries in the main apk and the test apk. The test apk should only include test-specific content (classes, resources, libraries)
  2. It skips proguard on the test project altogether. Given (1), the need to run proguard on the test project is pretty dramatically reduced.

With this branch, I'm finally able to successfully run some basic ProviderTestCase2 stuff from sbt.

The downside: It's a little bit hacky (note the use of the skipApkLibDependencies key).

loganj commented 12 years ago

Quick note: This doesn't allow for library dependencies added in the test project.

The test project dependsOn the main project. This means that at runtime, when packaging the test project, there's no way to distinguish between dependencies added by the main project and those added by the test project. I have to dex all dependencies, or none, into the test apk. Dexing all dependencies would cause conflicts with the main apk, so for now it's none.

I don't really have a better idea than removing the project dependency relationship, but that would involve touching a lot more than I care to touch at the moment, and would likely leave current builds broken.

fxthomas commented 11 years ago

@loganj : I fixed everything in my WIP branch, including library dependencies and a much better Proguard config. PR can be closed, I guess?

loganj commented 11 years ago

@fxthomas Sure thing.