mttkay / replicant

A REPL for the Android Debug Bridge (ADB)
MIT License
123 stars 9 forks source link

Amend manifest search to work well with multi-projects builds #36

Closed futtetennista closed 9 years ago

futtetennista commented 9 years ago

In my multi-project build, replicant would incorrectly set the package name of one of the sub-projects (which is a library project). I amended the implementation so that it looks for the manifest in the current directory and all sub-directories and checks if the sub-project is an app project.

I couldn't really figure out how to do a couple of things properly, so suggestions are welcome:

  1. if the current project is a library project, the package will be set to the one of the sample app, which is probably not what you want. But how can replicant know that's the case? A possibility would be to look for know app directory names like "sample", skip those and fall back to the library project.
  2. how to write tests for this, on the other hand there weren't any for the previous implementation.
mttkay commented 9 years ago

Thanks! :+1:

mttkay commented 9 years ago

how to write tests for this, on the other hand there weren't any for the previous implementation.

yeah I know, it's difficult to test. I used to have specs that actually test the repl output but this was very brittle. I reverted to only testing command logic, not configuration (this is mostly configuration and setup logic, which is difficult to test)

I wouldn't lose sleep over it

futtetennista commented 9 years ago

Thanks for the feedback!

mttkay commented 9 years ago

:+1: