{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/59961785","id":59961785,"diff_hunk":"@@ -66,3 +71,99 @@ class Toolchain {\n     return null;\n   }\n }\n+\n+/// A ToolConfiguration can return the tools directory for the current host platform\n+/// and the engine artifact directory for a given target platform. It is configurable\n+/// via command-line arguments in order to support local engine builds.\n+class ToolConfiguration {\n+  /// [overrideCache] is configurable for testing.\n+  ToolConfiguration({ Cache overrideCache }) {\n+    _cache = overrideCache ?? cache;\n+  }\n+\n+  Cache _cache;\n+\n+  static ToolConfiguration get instance {\n+    if (context[ToolConfiguration] == null)\n+      context[ToolConfiguration] = new ToolConfiguration();\n+    return context[ToolConfiguration];\n+  }\n+\n+  /// Override using the artifacts from the cache directory (--engine-src-path).\n+  String engineSrcPath;\n+\n+  /// The engine mode to use (only relevent when [engineSrcPath] is set).\n+  bool release;\n+\n+  /// Used to override the directory calculated from engineSrcPath (--engine-out-dir).\n+  String engineOutDir;\n+\n+  /// The directory that contains development tools for the given platform. This\n+  /// includes things like `sky_shell` and `sky_snapshot`.\n+  ///\n+  /// If [platform] is not specified it defaults to [getCurrentHostPlatform].\n+  Directory getToolsDirectory({ HostPlatform platform }) {\n+    Directory dir = _getToolsDirectory(platform: platform);\n+    if (dir != null)\n+      printTrace('Using engine tools dir: ${dir.path}');\n+    return dir;\n+  }\n+\n+  Directory _getToolsDirectory({ HostPlatform platform }) {\n+    platform ??= getCurrentHostPlatform();\n+\n+    if (engineSrcPath != null) {\n+      String toolsDir = release ? 'out/Release' : 'out/Debug';","path":"packages/flutter_tools/lib/src/toolchain.dart","position":67,"original_position":67,"commit_id":"904f07a6ac49e02f83f91b6b3e10180735ebab55","original_commit_id":"904f07a6ac49e02f83f91b6b3e10180735ebab55","user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"body":"consolidated","created_at":"2016-04-16T03:41:23Z","updated_at":"2016-04-16T03:41:23Z","html_url":"https://github.com/flutter/flutter/pull/3361#discussion_r59961785","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/3361","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/59961785"},"html":{"href":"https://github.com/flutter/flutter/pull/3361#discussion_r59961785"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3361"}}},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/3361","id":66700128,"html_url":"https://github.com/flutter/flutter/pull/3361","diff_url":"https://github.com/flutter/flutter/pull/3361.diff","patch_url":"https://github.com/flutter/flutter/pull/3361.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/3361","number":3361,"state":"open","locked":false,"title":"use the new cache code to locate more artifacts","user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"body":"- add a new `ToolConfiguration` class to find a tools directory given a host platform and an artifacts directory given a target platform\r\n- use the cli flags to configure those locations (--engine-src-path, --release, --debug, --engine-out-dir)\r\n- simplify the code for finding the correct `ApplicationPackage`; it now just depends on the `TargetPlatform` and not the `BuildConfiguration`\r\n\r\nThis will make it easier to locate the deploy artifacts and will allow us to remove several different classes and cli flags in future PRs.\r\n\r\n","created_at":"2016-04-15T20:28:35Z","updated_at":"2016-04-16T03:41:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31d2354bef1ab281b6c3cc18e95d7b87955fb7d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/3361/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/3361/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/3361/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/904f07a6ac49e02f83f91b6b3e10180735ebab55","head":{"label":"devoncarew:use_tool_configuration","ref":"use_tool_configuration","sha":"904f07a6ac49e02f83f91b6b3e10180735ebab55","user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"repo":{"id":45596312,"name":"flutter","full_name":"devoncarew/flutter","owner":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devoncarew/flutter","description":"The Flutter framework","fork":true,"url":"https://api.github.com/repos/devoncarew/flutter","forks_url":"https://api.github.com/repos/devoncarew/flutter/forks","keys_url":"https://api.github.com/repos/devoncarew/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devoncarew/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devoncarew/flutter/teams","hooks_url":"https://api.github.com/repos/devoncarew/flutter/hooks","issue_events_url":"https://api.github.com/repos/devoncarew/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/devoncarew/flutter/events","assignees_url":"https://api.github.com/repos/devoncarew/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/devoncarew/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/devoncarew/flutter/tags","blobs_url":"https://api.github.com/repos/devoncarew/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devoncarew/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devoncarew/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/devoncarew/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devoncarew/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/devoncarew/flutter/languages","stargazers_url":"https://api.github.com/repos/devoncarew/flutter/stargazers","contributors_url":"https://api.github.com/repos/devoncarew/flutter/contributors","subscribers_url":"https://api.github.com/repos/devoncarew/flutter/subscribers","subscription_url":"https://api.github.com/repos/devoncarew/flutter/subscription","commits_url":"https://api.github.com/repos/devoncarew/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/devoncarew/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/devoncarew/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/devoncarew/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/devoncarew/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/devoncarew/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devoncarew/flutter/merges","archive_url":"https://api.github.com/repos/devoncarew/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devoncarew/flutter/downloads","issues_url":"https://api.github.com/repos/devoncarew/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/devoncarew/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/devoncarew/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/devoncarew/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devoncarew/flutter/labels{/name}","releases_url":"https://api.github.com/repos/devoncarew/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/devoncarew/flutter/deployments","created_at":"2015-11-05T07:56:06Z","updated_at":"2016-04-09T14:03:56Z","pushed_at":"2016-04-16T02:12:32Z","git_url":"git://github.com/devoncarew/flutter.git","ssh_url":"git@github.com:devoncarew/flutter.git","clone_url":"https://github.com/devoncarew/flutter.git","svn_url":"https://github.com/devoncarew/flutter","homepage":"http://flutter.io","size":15947,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"347831bf7f1d6969082d5029f1a89843ea4da0e1","user":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"repo":{"id":31792824,"name":"flutter","full_name":"flutter/flutter","owner":{"login":"flutter","id":14101776,"avatar_url":"https://avatars.githubusercontent.com/u/14101776?v=3","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flutter/flutter","description":"Framework for building high-performance, high-fidelity iOS and Android apps","fork":false,"url":"https://api.github.com/repos/flutter/flutter","forks_url":"https://api.github.com/repos/flutter/flutter/forks","keys_url":"https://api.github.com/repos/flutter/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/flutter/teams","hooks_url":"https://api.github.com/repos/flutter/flutter/hooks","issue_events_url":"https://api.github.com/repos/flutter/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/flutter/events","assignees_url":"https://api.github.com/repos/flutter/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/flutter/tags","blobs_url":"https://api.github.com/repos/flutter/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/flutter/languages","stargazers_url":"https://api.github.com/repos/flutter/flutter/stargazers","contributors_url":"https://api.github.com/repos/flutter/flutter/contributors","subscribers_url":"https://api.github.com/repos/flutter/flutter/subscribers","subscription_url":"https://api.github.com/repos/flutter/flutter/subscription","commits_url":"https://api.github.com/repos/flutter/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/flutter/merges","archive_url":"https://api.github.com/repos/flutter/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/flutter/downloads","issues_url":"https://api.github.com/repos/flutter/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/flutter/labels{/name}","releases_url":"https://api.github.com/repos/flutter/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/flutter/deployments","created_at":"2015-03-06T22:54:58Z","updated_at":"2016-04-15T22:44:17Z","pushed_at":"2016-04-16T03:25:57Z","git_url":"git://github.com/flutter/flutter.git","ssh_url":"git@github.com:flutter/flutter.git","clone_url":"https://github.com/flutter/flutter.git","svn_url":"https://github.com/flutter/flutter","homepage":"http://flutter.io","size":109608,"stargazers_count":2748,"watchers_count":2748,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":280,"mirror_url":null,"open_issues_count":827,"forks":280,"open_issues":827,"watchers":2748,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3361"},"html":{"href":"https://github.com/flutter/flutter/pull/3361"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/3361"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/3361/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3361/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/3361/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/904f07a6ac49e02f83f91b6b3e10180735ebab55"}}}}