Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Infer android api version #34

merged 8 commits into from Mar 10, 2014
Commits on Mar 10, 2014
  1. Only use androidAPILevel, not androidAPIVersion

    Elliot Smith committed Mar 7, 2014
    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).
  2. When looking for files by API level, sort by version

    Elliot Smith committed Mar 7, 2014
    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.
  3. Env should sort results returned by Finder

    Elliot Smith committed Mar 10, 2014
    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
    desired "piece".
    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.
  4. Search platforms/ directory to set default Android API level

    Elliot Smith committed Mar 10, 2014
    If androidAPILevel is not explicitly set in config, look
    at the platforms/android-* directories and choose the
    last one found after alpha sorting.
  5. [Finder] findDirectories() should reject with tried paths

    Elliot Smith committed Mar 10, 2014
    On failure, findDirectories() should reject the promise with
    an array of paths tried, for consistency with findFiles().
  6. Sort Android directories by basename only

    Elliot Smith committed Mar 10, 2014
    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.
  7. Safely fall back if no platforms/ directories

    Elliot Smith committed Mar 10, 2014
  8. Ensure that file separators are correctly fixed

    Elliot Smith committed Mar 10, 2014