Make gn.py support root directories other than 'src'.

In https://codereview.chromium.org/341533006/ a change
was made so that gn.py is not looking for the .gn file
to identify the root of the checkout. This breaks
GN functionality for projects that uses gclient but
have a top directory named something else than 'src'.

This change adds support for arbitrarily named primary (the first)
solutions in the .gclient file.
It also adds a check for the generated GN path so a friendly
error message can be printed if the GN executable cannot be found.


BUG=389883
TESTED=Various cases of Chromium, WebRTC and custom checkouts
with .gclient containing empty solution list, solution missing the
'name' key and so on.

Review URL: https://codereview.chromium.org/538393002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291819 0039d316-1c4b-4281-b951-d872f2087c98
2 files changed
tree: a05379c7b9f0e8312d67d2a18fb47f9b6c524077
  1. bootstrap/
  2. git-templates/
  3. git_utils/
  4. man/
  5. recipes/
  6. support/
  7. testing_support/
  8. tests/
  9. third_party/
  10. win_toolchain/
  11. zsh-goodies/
  12. .gitignore
  13. annotated_gclient.py
  14. apply_issue
  15. apply_issue.bat
  16. apply_issue.py
  17. breakpad.py
  18. checkout.py
  19. chrome-update-create-task.bat
  20. chrome-update.bat
  21. chrome-update.py
  22. clang-format
  23. clang-format.bat
  24. clang_format.py
  25. codereview.settings
  26. commit_queue.py
  27. cpplint.bat
  28. cpplint.py
  29. cpplint_chromium.py
  30. create-chromium-git-src
  31. create-ntfs-junction.c
  32. create-ntfs-junction.exe
  33. download_from_google_storage
  34. download_from_google_storage.bat
  35. download_from_google_storage.py
  36. drover
  37. drover.bat
  38. drover.py
  39. fetch
  40. fetch.bat
  41. fetch.py
  42. fix_encoding.py
  43. gcl
  44. gcl.bat
  45. gcl.py
  46. gclient
  47. gclient-new-workdir.py
  48. gclient.bat
  49. gclient.py
  50. gclient_completion.sh
  51. gclient_scm.py
  52. gclient_utils.py
  53. gerrit_util.py
  54. git-cache
  55. git-cherry-pick-upload
  56. git-cl
  57. git-cl-upload-hook
  58. git-crsync
  59. git-crup
  60. git-footers
  61. git-freeze
  62. git-gs
  63. git-lkgr
  64. git-map
  65. git-map-branches
  66. git-mark-merge-base
  67. git-nav-downstream
  68. git-nav-upstream
  69. git-new-branch
  70. git-number
  71. git-rebase-update
  72. git-rename-branch
  73. git-reparent-branch
  74. git-retry
  75. git-runhooks
  76. git-squash-branch
  77. git-thaw
  78. git-try
  79. git-upstream-diff
  80. git_cache.py
  81. git_cherry_pick_upload.py
  82. git_cl.py
  83. git_common.py
  84. git_footers.py
  85. git_freezer.py
  86. git_map.py
  87. git_map_branches.py
  88. git_mark_merge_base.py
  89. git_nav_downstream.py
  90. git_new_branch.py
  91. git_number.py
  92. git_rebase_update.py
  93. git_rename_branch.py
  94. git_reparent_branch.py
  95. git_retry.py
  96. git_squash_branch.py
  97. git_try.py
  98. git_upstream_diff.py
  99. gn
  100. gn.bat
  101. gn.py
  102. hammer
  103. hammer.bat
  104. LICENSE
  105. my_activity.py
  106. my_reviews.py
  107. ninja
  108. ninja-linux32
  109. ninja-linux64
  110. ninja-mac
  111. ninja.exe
  112. OWNERS
  113. owners.py
  114. owners_finder.py
  115. patch.py
  116. PRESUBMIT.py
  117. presubmit_canned_checks.py
  118. presubmit_support.py
  119. profile.xml
  120. pylint
  121. pylint.py
  122. pylintrc
  123. python_git_runner.sh
  124. README
  125. README.codereview
  126. README.gclient
  127. README.git-cl
  128. README.testing
  129. repo
  130. rietveld.py
  131. roll-dep
  132. roll-dep.bat
  133. roll_dep.py
  134. scm.py
  135. subcommand.py
  136. subprocess2.py
  137. trychange.py
  138. update_depot_tools
  139. update_depot_tools.bat
  140. upload_to_google_storage.py
  141. WATCHLISTS
  142. watchlists.py
  143. weekly
  144. wtf