{"action":"created","comment":{"url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/comments/69271223","id":69271223,"diff_hunk":"@@ -0,0 +1,135 @@\n+/*\n+ * Copyright 2016-present Facebook, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n+ * not use this file except in compliance with the License. You may obtain\n+ * a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package com.facebook.buck.jvm.java;\n+\n+import static com.facebook.buck.zip.ZipCompressionLevel.DEFAULT_COMPRESSION_LEVEL;\n+\n+import com.facebook.buck.model.BuildTarget;\n+import com.facebook.buck.model.BuildTargets;\n+import com.facebook.buck.rules.AbstractBuildRule;\n+import com.facebook.buck.rules.AddToRuleKey;\n+import com.facebook.buck.rules.BuildContext;\n+import com.facebook.buck.rules.BuildRule;\n+import com.facebook.buck.rules.BuildRuleParams;\n+import com.facebook.buck.rules.BuildTargetSourcePath;\n+import com.facebook.buck.rules.BuildableContext;\n+import com.facebook.buck.rules.SourcePath;\n+import com.facebook.buck.rules.SourcePathResolver;\n+import com.facebook.buck.step.Step;\n+import com.facebook.buck.step.fs.MakeCleanDirectoryStep;\n+import com.facebook.buck.step.fs.MkdirStep;\n+import com.facebook.buck.step.fs.RmStep;\n+import com.facebook.buck.zip.ZipStep;\n+import com.google.common.base.Optional;\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.ImmutableSet;\n+import com.google.common.collect.ImmutableSortedSet;\n+\n+import java.io.File;\n+import java.nio.file.Path;\n+import java.util.Arrays;\n+import java.util.LinkedList;\n+import java.util.List;\n+\n+\n+public class JavaDocJar extends AbstractBuildRule implements HasMavenCoordinates {\n+\n+  @AddToRuleKey\n+  private final ImmutableSortedSet<SourcePath> sources;\n+  private final Path output;\n+  private final Path temp;\n+  private final Optional<String> mavenCoords;\n+\n+  public JavaDocJar(\n+      BuildRuleParams params,\n+      SourcePathResolver resolver,\n+      ImmutableSortedSet<SourcePath> sources,\n+      Optional<String> mavenCoords) {\n+    super(params, resolver);\n+    this.sources = sources;\n+    BuildTarget target = params.getBuildTarget();\n+    this.output =\n+        BuildTargets.getGenPath(\n+            getProjectFilesystem(),\n+            target,\n+            String.format(\"%%s%s\", Javac.JAVADOC_JAR));\n+    this.temp = BuildTargets.getScratchPath(getProjectFilesystem(), target, \"%s-javadoc\");\n+    this.mavenCoords = mavenCoords;\n+  }\n+\n+  @Override\n+  public ImmutableList<Step> getBuildSteps(\n+      BuildContext context, BuildableContext buildableContext) {\n+    ImmutableList.Builder<Step> steps = ImmutableList.builder();\n+\n+    Path javadocOutput = new File(output.getParent().toFile(), \"javadoc\").toPath();\n+    steps.add(new RmStep(getProjectFilesystem(), javadocOutput, /* force deletion */ true, true));\n+    steps.add(new RmStep(getProjectFilesystem(), output, true));\n+    steps.add(new MkdirStep(getProjectFilesystem(), javadocOutput));\n+    steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), temp));\n+\n+\n+    List<String> javaDocArgs = new LinkedList<>();\n+    javaDocArgs.addAll(Arrays.asList(\"-notimestamp\", \"-private\", \"-subpackages\", \".\",\n+        \"-d\", javadocOutput.toString()));\n+\n+    StringBuilder classpath = new StringBuilder(\".\");\n+    String classpathSeparator = \":\";\n+    if (System.getProperty(\"os.name\").startsWith(\"Windows\")) {","path":"src/com/facebook/buck/jvm/java/JavaDocJar.java","position":92,"original_position":92,"commit_id":"fca69745e5d3eb518ce39370e1d42b12e28b71b2","original_commit_id":"fca69745e5d3eb518ce39370e1d42b12e28b71b2","user":{"login":"shs96c","id":28229,"avatar_url":"https://avatars.githubusercontent.com/u/28229?v=3","gravatar_id":"","url":"https://api.github.com/users/shs96c","html_url":"https://github.com/shs96c","followers_url":"https://api.github.com/users/shs96c/followers","following_url":"https://api.github.com/users/shs96c/following{/other_user}","gists_url":"https://api.github.com/users/shs96c/gists{/gist_id}","starred_url":"https://api.github.com/users/shs96c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shs96c/subscriptions","organizations_url":"https://api.github.com/users/shs96c/orgs","repos_url":"https://api.github.com/users/shs96c/repos","events_url":"https://api.github.com/users/shs96c/events{/privacy}","received_events_url":"https://api.github.com/users/shs96c/received_events","type":"User","site_admin":false},"body":"Buck has `Platform.detect()` but you don't need it, because the path separator char is a constant. On `File`. For some reason.","created_at":"2016-07-01T09:12:36Z","updated_at":"2016-07-01T09:12:36Z","html_url":"https://github.com/SeleniumHQ/buck/pull/1#discussion_r69271223","pull_request_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/comments/69271223"},"html":{"href":"https://github.com/SeleniumHQ/buck/pull/1#discussion_r69271223"},"pull_request":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1","id":75846713,"html_url":"https://github.com/SeleniumHQ/buck/pull/1","diff_url":"https://github.com/SeleniumHQ/buck/pull/1.diff","patch_url":"https://github.com/SeleniumHQ/buck/pull/1.patch","issue_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/1","number":1,"state":"open","locked":false,"title":"Javadoc","user":{"login":"lukeis","id":926454,"avatar_url":"https://avatars.githubusercontent.com/u/926454?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeis","html_url":"https://github.com/lukeis","followers_url":"https://api.github.com/users/lukeis/followers","following_url":"https://api.github.com/users/lukeis/following{/other_user}","gists_url":"https://api.github.com/users/lukeis/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeis/subscriptions","organizations_url":"https://api.github.com/users/lukeis/orgs","repos_url":"https://api.github.com/users/lukeis/repos","events_url":"https://api.github.com/users/lukeis/events{/privacy}","received_events_url":"https://api.github.com/users/lukeis/received_events","type":"User","site_admin":false},"body":"@shs96c please review","created_at":"2016-06-30T16:04:57Z","updated_at":"2016-07-01T09:12:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3124ea3ea8b448c19c42141f3f7fd8689dece9b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1/commits","review_comments_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1/comments","review_comment_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/1/comments","statuses_url":"https://api.github.com/repos/SeleniumHQ/buck/statuses/fca69745e5d3eb518ce39370e1d42b12e28b71b2","head":{"label":"SeleniumHQ:javadoc","ref":"javadoc","sha":"fca69745e5d3eb518ce39370e1d42b12e28b71b2","user":{"login":"SeleniumHQ","id":983927,"avatar_url":"https://avatars.githubusercontent.com/u/983927?v=3","gravatar_id":"","url":"https://api.github.com/users/SeleniumHQ","html_url":"https://github.com/SeleniumHQ","followers_url":"https://api.github.com/users/SeleniumHQ/followers","following_url":"https://api.github.com/users/SeleniumHQ/following{/other_user}","gists_url":"https://api.github.com/users/SeleniumHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/SeleniumHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeleniumHQ/subscriptions","organizations_url":"https://api.github.com/users/SeleniumHQ/orgs","repos_url":"https://api.github.com/users/SeleniumHQ/repos","events_url":"https://api.github.com/users/SeleniumHQ/events{/privacy}","received_events_url":"https://api.github.com/users/SeleniumHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":54105775,"name":"buck","full_name":"SeleniumHQ/buck","owner":{"login":"SeleniumHQ","id":983927,"avatar_url":"https://avatars.githubusercontent.com/u/983927?v=3","gravatar_id":"","url":"https://api.github.com/users/SeleniumHQ","html_url":"https://github.com/SeleniumHQ","followers_url":"https://api.github.com/users/SeleniumHQ/followers","following_url":"https://api.github.com/users/SeleniumHQ/following{/other_user}","gists_url":"https://api.github.com/users/SeleniumHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/SeleniumHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeleniumHQ/subscriptions","organizations_url":"https://api.github.com/users/SeleniumHQ/orgs","repos_url":"https://api.github.com/users/SeleniumHQ/repos","events_url":"https://api.github.com/users/SeleniumHQ/events{/privacy}","received_events_url":"https://api.github.com/users/SeleniumHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SeleniumHQ/buck","description":"Buck: An Android (and Java!) build tool","fork":true,"url":"https://api.github.com/repos/SeleniumHQ/buck","forks_url":"https://api.github.com/repos/SeleniumHQ/buck/forks","keys_url":"https://api.github.com/repos/SeleniumHQ/buck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SeleniumHQ/buck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SeleniumHQ/buck/teams","hooks_url":"https://api.github.com/repos/SeleniumHQ/buck/hooks","issue_events_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/events{/number}","events_url":"https://api.github.com/repos/SeleniumHQ/buck/events","assignees_url":"https://api.github.com/repos/SeleniumHQ/buck/assignees{/user}","branches_url":"https://api.github.com/repos/SeleniumHQ/buck/branches{/branch}","tags_url":"https://api.github.com/repos/SeleniumHQ/buck/tags","blobs_url":"https://api.github.com/repos/SeleniumHQ/buck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SeleniumHQ/buck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SeleniumHQ/buck/git/refs{/sha}","trees_url":"https://api.github.com/repos/SeleniumHQ/buck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SeleniumHQ/buck/statuses/{sha}","languages_url":"https://api.github.com/repos/SeleniumHQ/buck/languages","stargazers_url":"https://api.github.com/repos/SeleniumHQ/buck/stargazers","contributors_url":"https://api.github.com/repos/SeleniumHQ/buck/contributors","subscribers_url":"https://api.github.com/repos/SeleniumHQ/buck/subscribers","subscription_url":"https://api.github.com/repos/SeleniumHQ/buck/subscription","commits_url":"https://api.github.com/repos/SeleniumHQ/buck/commits{/sha}","git_commits_url":"https://api.github.com/repos/SeleniumHQ/buck/git/commits{/sha}","comments_url":"https://api.github.com/repos/SeleniumHQ/buck/comments{/number}","issue_comment_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/comments{/number}","contents_url":"https://api.github.com/repos/SeleniumHQ/buck/contents/{+path}","compare_url":"https://api.github.com/repos/SeleniumHQ/buck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SeleniumHQ/buck/merges","archive_url":"https://api.github.com/repos/SeleniumHQ/buck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SeleniumHQ/buck/downloads","issues_url":"https://api.github.com/repos/SeleniumHQ/buck/issues{/number}","pulls_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls{/number}","milestones_url":"https://api.github.com/repos/SeleniumHQ/buck/milestones{/number}","notifications_url":"https://api.github.com/repos/SeleniumHQ/buck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SeleniumHQ/buck/labels{/name}","releases_url":"https://api.github.com/repos/SeleniumHQ/buck/releases{/id}","deployments_url":"https://api.github.com/repos/SeleniumHQ/buck/deployments","created_at":"2016-03-17T09:34:12Z","updated_at":"2016-06-27T06:05:30Z","pushed_at":"2016-06-30T22:32:49Z","git_url":"git://github.com/SeleniumHQ/buck.git","ssh_url":"git@github.com:SeleniumHQ/buck.git","clone_url":"https://github.com/SeleniumHQ/buck.git","svn_url":"https://github.com/SeleniumHQ/buck","homepage":"http://facebook.github.io/buck/","size":391145,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"SeleniumHQ:master","ref":"master","sha":"34e9bb61228ae00f5f077aa4b94e265fdd3e8f37","user":{"login":"SeleniumHQ","id":983927,"avatar_url":"https://avatars.githubusercontent.com/u/983927?v=3","gravatar_id":"","url":"https://api.github.com/users/SeleniumHQ","html_url":"https://github.com/SeleniumHQ","followers_url":"https://api.github.com/users/SeleniumHQ/followers","following_url":"https://api.github.com/users/SeleniumHQ/following{/other_user}","gists_url":"https://api.github.com/users/SeleniumHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/SeleniumHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeleniumHQ/subscriptions","organizations_url":"https://api.github.com/users/SeleniumHQ/orgs","repos_url":"https://api.github.com/users/SeleniumHQ/repos","events_url":"https://api.github.com/users/SeleniumHQ/events{/privacy}","received_events_url":"https://api.github.com/users/SeleniumHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":54105775,"name":"buck","full_name":"SeleniumHQ/buck","owner":{"login":"SeleniumHQ","id":983927,"avatar_url":"https://avatars.githubusercontent.com/u/983927?v=3","gravatar_id":"","url":"https://api.github.com/users/SeleniumHQ","html_url":"https://github.com/SeleniumHQ","followers_url":"https://api.github.com/users/SeleniumHQ/followers","following_url":"https://api.github.com/users/SeleniumHQ/following{/other_user}","gists_url":"https://api.github.com/users/SeleniumHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/SeleniumHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeleniumHQ/subscriptions","organizations_url":"https://api.github.com/users/SeleniumHQ/orgs","repos_url":"https://api.github.com/users/SeleniumHQ/repos","events_url":"https://api.github.com/users/SeleniumHQ/events{/privacy}","received_events_url":"https://api.github.com/users/SeleniumHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SeleniumHQ/buck","description":"Buck: An Android (and Java!) build tool","fork":true,"url":"https://api.github.com/repos/SeleniumHQ/buck","forks_url":"https://api.github.com/repos/SeleniumHQ/buck/forks","keys_url":"https://api.github.com/repos/SeleniumHQ/buck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SeleniumHQ/buck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SeleniumHQ/buck/teams","hooks_url":"https://api.github.com/repos/SeleniumHQ/buck/hooks","issue_events_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/events{/number}","events_url":"https://api.github.com/repos/SeleniumHQ/buck/events","assignees_url":"https://api.github.com/repos/SeleniumHQ/buck/assignees{/user}","branches_url":"https://api.github.com/repos/SeleniumHQ/buck/branches{/branch}","tags_url":"https://api.github.com/repos/SeleniumHQ/buck/tags","blobs_url":"https://api.github.com/repos/SeleniumHQ/buck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SeleniumHQ/buck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SeleniumHQ/buck/git/refs{/sha}","trees_url":"https://api.github.com/repos/SeleniumHQ/buck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SeleniumHQ/buck/statuses/{sha}","languages_url":"https://api.github.com/repos/SeleniumHQ/buck/languages","stargazers_url":"https://api.github.com/repos/SeleniumHQ/buck/stargazers","contributors_url":"https://api.github.com/repos/SeleniumHQ/buck/contributors","subscribers_url":"https://api.github.com/repos/SeleniumHQ/buck/subscribers","subscription_url":"https://api.github.com/repos/SeleniumHQ/buck/subscription","commits_url":"https://api.github.com/repos/SeleniumHQ/buck/commits{/sha}","git_commits_url":"https://api.github.com/repos/SeleniumHQ/buck/git/commits{/sha}","comments_url":"https://api.github.com/repos/SeleniumHQ/buck/comments{/number}","issue_comment_url":"https://api.github.com/repos/SeleniumHQ/buck/issues/comments{/number}","contents_url":"https://api.github.com/repos/SeleniumHQ/buck/contents/{+path}","compare_url":"https://api.github.com/repos/SeleniumHQ/buck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SeleniumHQ/buck/merges","archive_url":"https://api.github.com/repos/SeleniumHQ/buck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SeleniumHQ/buck/downloads","issues_url":"https://api.github.com/repos/SeleniumHQ/buck/issues{/number}","pulls_url":"https://api.github.com/repos/SeleniumHQ/buck/pulls{/number}","milestones_url":"https://api.github.com/repos/SeleniumHQ/buck/milestones{/number}","notifications_url":"https://api.github.com/repos/SeleniumHQ/buck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SeleniumHQ/buck/labels{/name}","releases_url":"https://api.github.com/repos/SeleniumHQ/buck/releases{/id}","deployments_url":"https://api.github.com/repos/SeleniumHQ/buck/deployments","created_at":"2016-03-17T09:34:12Z","updated_at":"2016-06-27T06:05:30Z","pushed_at":"2016-06-30T22:32:49Z","git_url":"git://github.com/SeleniumHQ/buck.git","ssh_url":"git@github.com:SeleniumHQ/buck.git","clone_url":"https://github.com/SeleniumHQ/buck.git","svn_url":"https://github.com/SeleniumHQ/buck","homepage":"http://facebook.github.io/buck/","size":391145,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1"},"html":{"href":"https://github.com/SeleniumHQ/buck/pull/1"},"issue":{"href":"https://api.github.com/repos/SeleniumHQ/buck/issues/1"},"comments":{"href":"https://api.github.com/repos/SeleniumHQ/buck/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SeleniumHQ/buck/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/SeleniumHQ/buck/statuses/fca69745e5d3eb518ce39370e1d42b12e28b71b2"}}}}
{"actor":{"display_login":"shs96c"}}