{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/flutter/pulls/comments/187787782","pull_request_review_id":119641509,"id":187787782,"diff_hunk":"@@ -540,6 +552,71 @@ Map<_Asset, List<_Asset>> _parseAssets(\n   return result;\n }\n \n+void _parseAssetsFromFolder(PackageMap packageMap,\n+    FlutterManifest flutterManifest,\n+    String assetBase,\n+    _AssetDirectoryCache cache,\n+    Map<_Asset, List<_Asset>> result,\n+    Uri assetUri,\n+    { List<String> excludeDirs: const <String>[],\n+      String packageName}) {\n+  final String directoryPath = fs.path.join(\n+      assetBase, assetUri.toFilePath(windows: platform.isWindows));\n+\n+  if (!fs.directory(directoryPath).existsSync()) {\n+    printError('Error: unable to find directory entry in pubspec.yaml: $directoryPath');\n+  }\n+\n+  final List<FileSystemEntity> lister = fs.directory(directoryPath)\n+      .listSync(recursive: false);\n+\n+  for (FileSystemEntity entity in lister) {\n+    if (entity is File) {\n+      final String relPath = fs.path.relative(entity.path, from: assetBase);\n+\n+      final Uri uri = new Uri.file(relPath, windows: platform.isWindows);\n+\n+      _parseAssetFromFile(packageMap, flutterManifest, assetBase, cache, result,\n+          uri, packageName: packageName);\n+    }\n+  }\n+}\n+\n+void _parseAssetFromFile(PackageMap packageMap,\n+    FlutterManifest flutterManifest,\n+    String assetBase,\n+    _AssetDirectoryCache cache,\n+    Map<_Asset, List<_Asset>> result,\n+    Uri assetUri,\n+    { List<String> excludeDirs: const <String>[],\n+      String packageName}) {\n+  final _Asset asset = _resolveAsset(\n+    packageMap,\n+    assetBase,\n+    assetUri,\n+    packageName,\n+  );\n+  final List<_Asset> variants = <_Asset>[];\n+  for (String path in cache.variantsFor(asset.assetFile.path)) {\n+    final String relativePath = fs.path.relative(path, from: asset.baseDir);\n+    final Uri relativeUri = fs.path.toUri(relativePath);\n+    final Uri entryUri = asset.symbolicPrefixUri == null\n+        ? relativeUri\n+        : asset.symbolicPrefixUri.resolveUri(relativeUri);\n+\n+    variants.add(\n+        new _Asset(\n+          baseDir: asset.baseDir,\n+          entryUri: entryUri,\n+          relativeUri: relativeUri,\n+        )\n+    );\n+  }\n+\n+  result[asset] = variants;\n+","path":"packages/flutter_tools/lib/src/asset.dart","position":158,"original_position":158,"commit_id":"357afd55681e725e2603c6d889e8249084e196c9","original_commit_id":"357afd55681e725e2603c6d889e8249084e196c9","user":{"login":"fmatosqg","id":5360753,"avatar_url":"https://avatars1.githubusercontent.com/u/5360753?v=4","gravatar_id":"","url":"https://api.github.com/users/fmatosqg","html_url":"https://github.com/fmatosqg","followers_url":"https://api.github.com/users/fmatosqg/followers","following_url":"https://api.github.com/users/fmatosqg/following{/other_user}","gists_url":"https://api.github.com/users/fmatosqg/gists{/gist_id}","starred_url":"https://api.github.com/users/fmatosqg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmatosqg/subscriptions","organizations_url":"https://api.github.com/users/fmatosqg/orgs","repos_url":"https://api.github.com/users/fmatosqg/repos","events_url":"https://api.github.com/users/fmatosqg/events{/privacy}","received_events_url":"https://api.github.com/users/fmatosqg/received_events","type":"User","site_admin":false},"body":"not sure if extra was line before or after, I applied dart default formatter.","created_at":"2018-05-13T02:55:53Z","updated_at":"2018-05-13T02:55:53Z","html_url":"https://github.com/flutter/flutter/pull/16413#discussion_r187787782","pull_request_url":"https://api.github.com/repos/flutter/flutter/pulls/16413","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments/187787782"},"html":{"href":"https://github.com/flutter/flutter/pull/16413#discussion_r187787782"},"pull_request":{"href":"https://api.github.com/repos/flutter/flutter/pulls/16413"}},"in_reply_to_id":187238361},"pull_request":{"url":"https://api.github.com/repos/flutter/flutter/pulls/16413","id":180559153,"html_url":"https://github.com/flutter/flutter/pull/16413","diff_url":"https://github.com/flutter/flutter/pull/16413.diff","patch_url":"https://github.com/flutter/flutter/pull/16413.patch","issue_url":"https://api.github.com/repos/flutter/flutter/issues/16413","number":16413,"state":"open","locked":false,"title":"Scan assets from disk","user":{"login":"fmatosqg","id":5360753,"avatar_url":"https://avatars1.githubusercontent.com/u/5360753?v=4","gravatar_id":"","url":"https://api.github.com/users/fmatosqg","html_url":"https://github.com/fmatosqg","followers_url":"https://api.github.com/users/fmatosqg/followers","following_url":"https://api.github.com/users/fmatosqg/following{/other_user}","gists_url":"https://api.github.com/users/fmatosqg/gists{/gist_id}","starred_url":"https://api.github.com/users/fmatosqg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmatosqg/subscriptions","organizations_url":"https://api.github.com/users/fmatosqg/orgs","repos_url":"https://api.github.com/users/fmatosqg/repos","events_url":"https://api.github.com/users/fmatosqg/events{/privacy}","received_events_url":"https://api.github.com/users/fmatosqg/received_events","type":"User","site_admin":false},"body":"Opt in parameter will scan for all assets under given folder.\r\n\r\nTo do: Scenario when app is built, then user adds one more asset without touching pubspec.yaml. It's currently not refreshing bundle, but comparing timestamp for both pubspec and list of files under scanned path will be enough.\r\n\r\nCovers part of #4890 ","created_at":"2018-04-10T10:37:56Z","updated_at":"2018-05-13T02:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2c818380543cf5e5f1ed15321d9e8e95a6cdd6f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":487496476,"url":"https://api.github.com/repos/flutter/flutter/labels/cla:%20yes","name":"cla: yes","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/flutter/flutter/pulls/16413/commits","review_comments_url":"https://api.github.com/repos/flutter/flutter/pulls/16413/comments","review_comment_url":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/16413/comments","statuses_url":"https://api.github.com/repos/flutter/flutter/statuses/357afd55681e725e2603c6d889e8249084e196c9","head":{"label":"fmatosqg:scan_assets_from_disk","ref":"scan_assets_from_disk","sha":"357afd55681e725e2603c6d889e8249084e196c9","user":{"login":"fmatosqg","id":5360753,"avatar_url":"https://avatars1.githubusercontent.com/u/5360753?v=4","gravatar_id":"","url":"https://api.github.com/users/fmatosqg","html_url":"https://github.com/fmatosqg","followers_url":"https://api.github.com/users/fmatosqg/followers","following_url":"https://api.github.com/users/fmatosqg/following{/other_user}","gists_url":"https://api.github.com/users/fmatosqg/gists{/gist_id}","starred_url":"https://api.github.com/users/fmatosqg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmatosqg/subscriptions","organizations_url":"https://api.github.com/users/fmatosqg/orgs","repos_url":"https://api.github.com/users/fmatosqg/repos","events_url":"https://api.github.com/users/fmatosqg/events{/privacy}","received_events_url":"https://api.github.com/users/fmatosqg/received_events","type":"User","site_admin":false},"repo":{"id":127758987,"name":"flutter","full_name":"fmatosqg/flutter","owner":{"login":"fmatosqg","id":5360753,"avatar_url":"https://avatars1.githubusercontent.com/u/5360753?v=4","gravatar_id":"","url":"https://api.github.com/users/fmatosqg","html_url":"https://github.com/fmatosqg","followers_url":"https://api.github.com/users/fmatosqg/followers","following_url":"https://api.github.com/users/fmatosqg/following{/other_user}","gists_url":"https://api.github.com/users/fmatosqg/gists{/gist_id}","starred_url":"https://api.github.com/users/fmatosqg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmatosqg/subscriptions","organizations_url":"https://api.github.com/users/fmatosqg/orgs","repos_url":"https://api.github.com/users/fmatosqg/repos","events_url":"https://api.github.com/users/fmatosqg/events{/privacy}","received_events_url":"https://api.github.com/users/fmatosqg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmatosqg/flutter","description":"Flutter makes it easy and fast to build beautiful mobile apps.","fork":true,"url":"https://api.github.com/repos/fmatosqg/flutter","forks_url":"https://api.github.com/repos/fmatosqg/flutter/forks","keys_url":"https://api.github.com/repos/fmatosqg/flutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmatosqg/flutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmatosqg/flutter/teams","hooks_url":"https://api.github.com/repos/fmatosqg/flutter/hooks","issue_events_url":"https://api.github.com/repos/fmatosqg/flutter/issues/events{/number}","events_url":"https://api.github.com/repos/fmatosqg/flutter/events","assignees_url":"https://api.github.com/repos/fmatosqg/flutter/assignees{/user}","branches_url":"https://api.github.com/repos/fmatosqg/flutter/branches{/branch}","tags_url":"https://api.github.com/repos/fmatosqg/flutter/tags","blobs_url":"https://api.github.com/repos/fmatosqg/flutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmatosqg/flutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmatosqg/flutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmatosqg/flutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmatosqg/flutter/statuses/{sha}","languages_url":"https://api.github.com/repos/fmatosqg/flutter/languages","stargazers_url":"https://api.github.com/repos/fmatosqg/flutter/stargazers","contributors_url":"https://api.github.com/repos/fmatosqg/flutter/contributors","subscribers_url":"https://api.github.com/repos/fmatosqg/flutter/subscribers","subscription_url":"https://api.github.com/repos/fmatosqg/flutter/subscription","commits_url":"https://api.github.com/repos/fmatosqg/flutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmatosqg/flutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmatosqg/flutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmatosqg/flutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmatosqg/flutter/contents/{+path}","compare_url":"https://api.github.com/repos/fmatosqg/flutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmatosqg/flutter/merges","archive_url":"https://api.github.com/repos/fmatosqg/flutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmatosqg/flutter/downloads","issues_url":"https://api.github.com/repos/fmatosqg/flutter/issues{/number}","pulls_url":"https://api.github.com/repos/fmatosqg/flutter/pulls{/number}","milestones_url":"https://api.github.com/repos/fmatosqg/flutter/milestones{/number}","notifications_url":"https://api.github.com/repos/fmatosqg/flutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmatosqg/flutter/labels{/name}","releases_url":"https://api.github.com/repos/fmatosqg/flutter/releases{/id}","deployments_url":"https://api.github.com/repos/fmatosqg/flutter/deployments","created_at":"2018-04-02T13:20:02Z","updated_at":"2018-04-02T13:20:10Z","pushed_at":"2018-05-11T12:21:27Z","git_url":"git://github.com/fmatosqg/flutter.git","ssh_url":"git@github.com:fmatosqg/flutter.git","clone_url":"https://github.com/fmatosqg/flutter.git","svn_url":"https://github.com/fmatosqg/flutter","homepage":"https://flutter.io","size":38440,"stargazers_count":0,"watchers_count":0,"language":"Dart","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"5972fdb7aa251eeed8cb5dcb74856f47f9570225","user":{"login":"flutter","id":14101776,"avatar_url":"https://avatars3.githubusercontent.com/u/14101776?v=4","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://avatars3.githubusercontent.com/u/14101776?v=4","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":"Flutter makes it easy and fast to build beautiful mobile 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":"2018-05-13T02:46:38Z","pushed_at":"2018-05-13T01:36:32Z","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":"https://flutter.io","size":38661,"stargazers_count":23602,"watchers_count":23602,"language":"Dart","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2082,"mirror_url":null,"archived":false,"open_issues_count":3208,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2082,"open_issues":3208,"watchers":23602,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/flutter/pulls/16413"},"html":{"href":"https://github.com/flutter/flutter/pull/16413"},"issue":{"href":"https://api.github.com/repos/flutter/flutter/issues/16413"},"comments":{"href":"https://api.github.com/repos/flutter/flutter/issues/16413/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/flutter/pulls/16413/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/flutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/flutter/pulls/16413/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/flutter/statuses/357afd55681e725e2603c6d889e8249084e196c9"}},"author_association":"NONE"}}
{"actor":{"display_login":"fmatosqg"}}