{"action":"created","comment":{"url":"https://api.github.com/repos/google/grinder.dart/pulls/comments/28967902","id":28967902,"diff_hunk":"@@ -146,6 +191,103 @@ class Pub {\n   }\n }\n \n+/**\n+ * Utility tasks for invoking dart2js.\n+ */\n+class Dart2js {\n+  /**\n+   * Invoke a dart2js compile with the given [sourceFile] as input.\n+   */\n+  static void compile(File sourceFile,\n+      {Directory outDir, bool minify: false, bool csp: false}) {\n+    if (outDir == null) outDir = sourceFile.parent;\n+    File outFile = joinFile(outDir, [\"${fileName(sourceFile)}.js\"]);\n+\n+    if (!outDir.existsSync()) outDir.createSync(recursive: true);\n+\n+    List args = [];\n+    if (minify) args.add('--minify');\n+    if (csp) args.add('--csp');\n+    args.add('-o${outFile.path}');\n+    args.add(sourceFile.path);\n+\n+    run_lib.run(_sdkBin('dart2js'), arguments: args);\n+  }\n+\n+  /**\n+   * Invoke a dart2js compile with the given [sourceFile] as input.\n+   */\n+  static Future compileAsync(File sourceFile,\n+      {Directory outDir, bool minify: false, bool csp: false}) {\n+    if (outDir == null) outDir = sourceFile.parent;\n+    File outFile = joinFile(outDir, [\"${fileName(sourceFile)}.js\"]);\n+\n+    if (!outDir.existsSync()) outDir.createSync(recursive: true);\n+\n+    List args = [];\n+    if (minify) args.add('--minify');\n+    if (csp) args.add('--csp');\n+    args.add('-o${outFile.path}');\n+    args.add(sourceFile.path);\n+\n+    return run_lib.runAsync(_sdkBin('dart2js'), arguments: args)\n+        .then((_) => null);\n+  }\n+\n+  static String version({bool quiet: false}) =>\n+      _AppVersion.parse(_run('--version', quiet: quiet)).version;\n+\n+  static String _run(String command, {bool quiet: false}) =>\n+      run_lib.run(_sdkBin('dart2js'), quiet: quiet, arguments: [command]);\n+}\n+\n+/**\n+ * Utility tasks for invoking the analyzer.\n+ */\n+class Analyzer {\n+  /// Analyze a single [File] or path ([String]).\n+  static void analyze(fileOrPath,\n+      {Directory packageRoot, bool fatalWarnings: false}) {\n+    analyzeFiles([fileOrPath], packageRoot: packageRoot,\n+        fatalWarnings: fatalWarnings);\n+  }\n+\n+  /// Analyze one or more [File]s or paths ([String]).\n+  static void analyzeFiles(List files,\n+      {Directory packageRoot, bool fatalWarnings: false}) {\n+    List args = [];\n+    if (packageRoot != null) args.add('--package-root=${packageRoot.path}');\n+    if (fatalWarnings) args.add('--fatal-warnings');\n+    args.addAll(files.map((f) => f is File ? f.path : f));\n+\n+    run_lib.run(_sdkBin('dartanalyzer'), arguments: args);\n+  }\n+\n+  static String version({bool quiet: false}) => _AppVersion.parse(run_lib.run(\n+      _sdkBin('dartanalyzer'), quiet: quiet, arguments: ['--version'])).version;\n+}\n+\n+/// Utility class for invoking `dartfmt` from the SDK.\n+class DartFmt {\n+  /// Run the `dartfmt` command with the `--overwrite` option. Format any files\n+  /// in place.\n+  static void format(fileOrPath) {","path":"lib/grinder_sdk.dart","position":136,"original_position":136,"commit_id":"0a7dc8c2f969b5d0150af8f3c11d9bfd256792dd","original_commit_id":"0a7dc8c2f969b5d0150af8f3c11d9bfd256792dd","user":{"login":"seaneagan","id":444270,"avatar_url":"https://avatars.githubusercontent.com/u/444270?v=3","gravatar_id":"","url":"https://api.github.com/users/seaneagan","html_url":"https://github.com/seaneagan","followers_url":"https://api.github.com/users/seaneagan/followers","following_url":"https://api.github.com/users/seaneagan/following{/other_user}","gists_url":"https://api.github.com/users/seaneagan/gists{/gist_id}","starred_url":"https://api.github.com/users/seaneagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seaneagan/subscriptions","organizations_url":"https://api.github.com/users/seaneagan/orgs","repos_url":"https://api.github.com/users/seaneagan/repos","events_url":"https://api.github.com/users/seaneagan/events{/privacy}","received_events_url":"https://api.github.com/users/seaneagan/received_events","type":"User","site_admin":false},"body":"It's kind of weird the `Pub` uses static members, but `PubGlobal` uses instance members.  This would fix that too.","created_at":"2015-04-23T14:37:22Z","updated_at":"2015-04-23T14:37:22Z","html_url":"https://github.com/google/grinder.dart/pull/202#discussion_r28967902","pull_request_url":"https://api.github.com/repos/google/grinder.dart/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/comments/28967902"},"html":{"href":"https://github.com/google/grinder.dart/pull/202#discussion_r28967902"},"pull_request":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/google/grinder.dart/pulls/202","id":33895020,"html_url":"https://github.com/google/grinder.dart/pull/202","diff_url":"https://github.com/google/grinder.dart/pull/202.diff","patch_url":"https://github.com/google/grinder.dart/pull/202.patch","issue_url":"https://api.github.com/repos/google/grinder.dart/issues/202","number":202,"state":"open","locked":false,"title":"add dartfmt support","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":"Fix #168.\r\n\r\n@seaneagan \r\n\r\nWrite a wrapper around the `dartfmt` SDK tool. This is scoped to just exposing what's in the SDK .The user still has the option of using a `PubApp` wrapper around the `dart_style` tool.\r\n\r\n(the `Analyzer` and `Dart2js` classes are unchanged; they just changed locations within the file)","created_at":"2015-04-22T19:59:13Z","updated_at":"2015-04-23T14:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e958e7b8a822f89b01e497b5828b57fc226cbbe8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/grinder.dart/pulls/202/commits","review_comments_url":"https://api.github.com/repos/google/grinder.dart/pulls/202/comments","review_comment_url":"https://api.github.com/repos/google/grinder.dart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/grinder.dart/issues/202/comments","statuses_url":"https://api.github.com/repos/google/grinder.dart/statuses/0a7dc8c2f969b5d0150af8f3c11d9bfd256792dd","head":{"label":"google:devoncarew_dartfmt","ref":"devoncarew_dartfmt","sha":"0a7dc8c2f969b5d0150af8f3c11d9bfd256792dd","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":13248841,"name":"grinder.dart","full_name":"google/grinder.dart","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/grinder.dart","description":"Dart workflows, automated.","fork":false,"url":"https://api.github.com/repos/google/grinder.dart","forks_url":"https://api.github.com/repos/google/grinder.dart/forks","keys_url":"https://api.github.com/repos/google/grinder.dart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/grinder.dart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/grinder.dart/teams","hooks_url":"https://api.github.com/repos/google/grinder.dart/hooks","issue_events_url":"https://api.github.com/repos/google/grinder.dart/issues/events{/number}","events_url":"https://api.github.com/repos/google/grinder.dart/events","assignees_url":"https://api.github.com/repos/google/grinder.dart/assignees{/user}","branches_url":"https://api.github.com/repos/google/grinder.dart/branches{/branch}","tags_url":"https://api.github.com/repos/google/grinder.dart/tags","blobs_url":"https://api.github.com/repos/google/grinder.dart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/grinder.dart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/grinder.dart/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/grinder.dart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/grinder.dart/statuses/{sha}","languages_url":"https://api.github.com/repos/google/grinder.dart/languages","stargazers_url":"https://api.github.com/repos/google/grinder.dart/stargazers","contributors_url":"https://api.github.com/repos/google/grinder.dart/contributors","subscribers_url":"https://api.github.com/repos/google/grinder.dart/subscribers","subscription_url":"https://api.github.com/repos/google/grinder.dart/subscription","commits_url":"https://api.github.com/repos/google/grinder.dart/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/grinder.dart/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/grinder.dart/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/grinder.dart/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/grinder.dart/contents/{+path}","compare_url":"https://api.github.com/repos/google/grinder.dart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/grinder.dart/merges","archive_url":"https://api.github.com/repos/google/grinder.dart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/grinder.dart/downloads","issues_url":"https://api.github.com/repos/google/grinder.dart/issues{/number}","pulls_url":"https://api.github.com/repos/google/grinder.dart/pulls{/number}","milestones_url":"https://api.github.com/repos/google/grinder.dart/milestones{/number}","notifications_url":"https://api.github.com/repos/google/grinder.dart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/grinder.dart/labels{/name}","releases_url":"https://api.github.com/repos/google/grinder.dart/releases{/id}","created_at":"2013-10-01T16:14:32Z","updated_at":"2015-04-23T04:53:08Z","pushed_at":"2015-04-22T19:59:14Z","git_url":"git://github.com/google/grinder.dart.git","ssh_url":"git@github.com:google/grinder.dart.git","clone_url":"https://github.com/google/grinder.dart.git","svn_url":"https://github.com/google/grinder.dart","homepage":"","size":2488,"stargazers_count":50,"watchers_count":50,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":32,"forks":16,"open_issues":32,"watchers":50,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"982c59aedd754870878845f2ed99224f1d402383","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":13248841,"name":"grinder.dart","full_name":"google/grinder.dart","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/grinder.dart","description":"Dart workflows, automated.","fork":false,"url":"https://api.github.com/repos/google/grinder.dart","forks_url":"https://api.github.com/repos/google/grinder.dart/forks","keys_url":"https://api.github.com/repos/google/grinder.dart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/grinder.dart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/grinder.dart/teams","hooks_url":"https://api.github.com/repos/google/grinder.dart/hooks","issue_events_url":"https://api.github.com/repos/google/grinder.dart/issues/events{/number}","events_url":"https://api.github.com/repos/google/grinder.dart/events","assignees_url":"https://api.github.com/repos/google/grinder.dart/assignees{/user}","branches_url":"https://api.github.com/repos/google/grinder.dart/branches{/branch}","tags_url":"https://api.github.com/repos/google/grinder.dart/tags","blobs_url":"https://api.github.com/repos/google/grinder.dart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/grinder.dart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/grinder.dart/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/grinder.dart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/grinder.dart/statuses/{sha}","languages_url":"https://api.github.com/repos/google/grinder.dart/languages","stargazers_url":"https://api.github.com/repos/google/grinder.dart/stargazers","contributors_url":"https://api.github.com/repos/google/grinder.dart/contributors","subscribers_url":"https://api.github.com/repos/google/grinder.dart/subscribers","subscription_url":"https://api.github.com/repos/google/grinder.dart/subscription","commits_url":"https://api.github.com/repos/google/grinder.dart/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/grinder.dart/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/grinder.dart/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/grinder.dart/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/grinder.dart/contents/{+path}","compare_url":"https://api.github.com/repos/google/grinder.dart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/grinder.dart/merges","archive_url":"https://api.github.com/repos/google/grinder.dart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/grinder.dart/downloads","issues_url":"https://api.github.com/repos/google/grinder.dart/issues{/number}","pulls_url":"https://api.github.com/repos/google/grinder.dart/pulls{/number}","milestones_url":"https://api.github.com/repos/google/grinder.dart/milestones{/number}","notifications_url":"https://api.github.com/repos/google/grinder.dart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/grinder.dart/labels{/name}","releases_url":"https://api.github.com/repos/google/grinder.dart/releases{/id}","created_at":"2013-10-01T16:14:32Z","updated_at":"2015-04-23T04:53:08Z","pushed_at":"2015-04-22T19:59:14Z","git_url":"git://github.com/google/grinder.dart.git","ssh_url":"git@github.com:google/grinder.dart.git","clone_url":"https://github.com/google/grinder.dart.git","svn_url":"https://github.com/google/grinder.dart","homepage":"","size":2488,"stargazers_count":50,"watchers_count":50,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":32,"forks":16,"open_issues":32,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/202"},"html":{"href":"https://github.com/google/grinder.dart/pull/202"},"issue":{"href":"https://api.github.com/repos/google/grinder.dart/issues/202"},"comments":{"href":"https://api.github.com/repos/google/grinder.dart/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/grinder.dart/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/google/grinder.dart/statuses/0a7dc8c2f969b5d0150af8f3c11d9bfd256792dd"}}}}