For the moment, default to using API level 19, and glob to
find the tools matching that API level (e.g. build-tools/19*/aapt);
if multiple matching files are found, use the last one in the list
(which is sorted alphabetically).
When we're looking for (for example) aapt, which may occur
in two or more directories, sort the results by the
version number which is implicit in the parent directories of
the found aapt binaries.
For example, if we have 19.0.0 and 19.0.1 versions of aapt,
we want the 19.0.1 version, so we need to sort all the matching
19* versions and return the latest one.
The results of a file search (e.g. for aapt) should be returned
as plain arrays (Android SDK agnostic) to Env; then Env should
take responsibility for choosing the "latest" matching file.
This is done by passing a filter function to findFiles(), which
optionally selects a single item from the array of files
returned (either by glob or by guessing directories). The
single returned path can then be returned as the location of the
findDirectories() also now returns multiple matching directories,
and the last of them is selected as the desired "piece".
This allows all code which is Android-specific to stay in Env and
not have to go into Finder.
On Windows, some paths were being returned with forward
slashes for path separators, and others with double back
slash, which caused the sort to be incorrect.
Just sort by the basename of the paths under platforms/
(the android-* part) to work around this.