{"action":"created","comment":{"url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/comments/37966252","id":37966252,"diff_hunk":"@@ -0,0 +1,120 @@\n+package com.sourcegraph.javagraph;\n+\n+import org.apache.commons.io.Charsets;\n+import org.apache.maven.model.building.ModelBuildingException;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.nio.file.*;\n+import java.nio.file.attribute.BasicFileAttributes;\n+import java.util.*;\n+\n+public class AndroidCoreProject implements Project {\n+\n+    private static final Logger LOGGER = LoggerFactory.getLogger(AndroidCoreProject.class);\n+\n+    public AndroidCoreProject(SourceUnit unit) {\n+    }\n+\n+    @Override\n+    public List<String> getBootClassPath() throws Exception {\n+        return Collections.emptyList();\n+    }\n+\n+    @Override\n+    public List<String> getClassPath() throws Exception {\n+        return null;\n+    }\n+\n+    @Override\n+    public List<String> getSourcePath() throws Exception {\n+        // if there is ICU available, let's use it\n+        File icuDir = new File(\"../external/icu/icu4j/main/classes\");\n+        if (icuDir.isDirectory()) {\n+            List<String> icuSrcDirs = new ArrayList<>();\n+            Files.walkFileTree(icuDir.toPath(), new ICUDirectoriesCollector(icuSrcDirs));\n+            return icuSrcDirs;\n+        }\n+        return null;\n+    }\n+\n+    @Override\n+    public RawDependency getDepForJAR(Path jarFile) throws Exception {\n+        return null;\n+    }\n+\n+    @Override\n+    public String getSourceCodeVersion() throws Exception {\n+        return DEFAULT_SOURCE_CODE_VERSION;\n+    }\n+\n+    @Override\n+    public String getSourceCodeEncoding() throws ModelBuildingException, IOException {\n+        return Charsets.UTF_8.name();\n+    }\n+\n+    public static SourceUnit createSourceUnit(String subdir) throws Exception {\n+        final SourceUnit unit = new SourceUnit();\n+        unit.Type = \"JavaArtifact\";\n+        unit.Name = \"AndroidCore\";\n+        unit.Dir = subdir;\n+        List<String> directories = new ArrayList<>();\n+        getSourceFilesAndDirectories(Paths.get(subdir), unit.Files, directories);\n+        unit.Data.put(\"AndroidCoreSubdir\", subdir);\n+        return unit;\n+    }\n+\n+    static List<String> getSourceFilesAndDirectories(Path root, List<String> files, List<String> directories)\n+            throws IOException {\n+\n+        if (Files.exists(root)) {\n+            Files.walkFileTree(root, new SimpleFileVisitor<Path>() {\n+                @Override\n+                public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n+                    if (dir.endsWith(\"src/test\") ||\n+                            dir.endsWith(\"benchmarks\") ||\n+                            dir.endsWith(\"tzdata\")) {\n+                        return FileVisitResult.SKIP_SUBTREE;\n+                    }\n+                    directories.add(PathUtil.normalize(dir.toString()));\n+                    return FileVisitResult.CONTINUE;\n+                }\n+\n+                @Override\n+                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n+                    String filename = file.toString();\n+                    if (filename.endsWith(\".java\")) {\n+                        filename = PathUtil.normalize(filename);\n+                        if (filename.startsWith(\"./\"))\n+                            filename = filename.substring(2);\n+                        files.add(filename);\n+                    }\n+                    return FileVisitResult.CONTINUE;\n+                }\n+            });\n+        } else {\n+            LOGGER.warn(\"{} does not exist, skipping\", root);\n+        }\n+        return files;\n+    }\n+\n+    private static final class ICUDirectoriesCollector extends SimpleFileVisitor<Path> {","path":"src/main/java/com/sourcegraph/javagraph/AndroidCoreProject.java","position":null,"original_position":103,"commit_id":"80a4d069ad54208fbfcd449a473796924845d4a7","original_commit_id":"028b46680ab8b3d98986dbacf98268986d1dbc5d","user":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"body":"done in alexsaveliev/srclib-java@80a4d069ad54208fbfcd449a473796924845d4a7","created_at":"2015-08-26T10:15:21Z","updated_at":"2015-08-26T10:15:21Z","html_url":"https://github.com/sourcegraph/srclib-java/pull/33#discussion_r37966252","pull_request_url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/comments/37966252"},"html":{"href":"https://github.com/sourcegraph/srclib-java/pull/33#discussion_r37966252"},"pull_request":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33","id":43187724,"html_url":"https://github.com/sourcegraph/srclib-java/pull/33","diff_url":"https://github.com/sourcegraph/srclib-java/pull/33.diff","patch_url":"https://github.com/sourcegraph/srclib-java/pull/33.patch","issue_url":"https://api.github.com/repos/sourcegraph/srclib-java/issues/33","number":33,"state":"open","locked":false,"title":"Improved Gradle and Maven support, added Windows support","user":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"body":"This pull request includes the following:\r\n- Windows support (ability to run srclib-java on Windows, correctly handling system-specific path separators and directory separators)\r\n- Source code version and encoding detection (trying to detect source code version and encoding from Maven/Gradle files and using these settings when graphing java files)\r\n- Mapping known artifacts to the proper SCM URI using properties file\r\n- Enhanced Gradle support (running all not-standard tasks \"compile\" or \"assembleDebug\" depends on to generate source files or repack jar files; handling cases with custom Gradle files or absent (impicit) Gradle files;)\r\n- Enhanced Maven support (extracting settings from known Maven plugins or running Maven plugins that may generate source code; properly resolving dependencies between sub-projects including \r\n\"parent\" and \"modules\" dependency scenarios using Maven's nearest first strategy; retrieving SCM URI from POM files to avoid searching for them later in Maven Central;\r\n- Few fixes in grapher logic (Java 8 lambda support, parametrized classes, optimized package jar resolution)\r\n- Graphing OpenJDK source and Android libraries (libcore, frameworks/base, frameworks/support)","created_at":"2015-08-24T15:30:30Z","updated_at":"2015-08-26T10:15:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00f8c50a5d7ba2043079badd503c5b6db84b94d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33/commits","review_comments_url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33/comments","review_comment_url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sourcegraph/srclib-java/issues/33/comments","statuses_url":"https://api.github.com/repos/sourcegraph/srclib-java/statuses/80a4d069ad54208fbfcd449a473796924845d4a7","head":{"label":"alexsaveliev:master","ref":"master","sha":"80a4d069ad54208fbfcd449a473796924845d4a7","user":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"repo":{"id":39097400,"name":"srclib-java","full_name":"alexsaveliev/srclib-java","owner":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexsaveliev/srclib-java","description":"","fork":true,"url":"https://api.github.com/repos/alexsaveliev/srclib-java","forks_url":"https://api.github.com/repos/alexsaveliev/srclib-java/forks","keys_url":"https://api.github.com/repos/alexsaveliev/srclib-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexsaveliev/srclib-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexsaveliev/srclib-java/teams","hooks_url":"https://api.github.com/repos/alexsaveliev/srclib-java/hooks","issue_events_url":"https://api.github.com/repos/alexsaveliev/srclib-java/issues/events{/number}","events_url":"https://api.github.com/repos/alexsaveliev/srclib-java/events","assignees_url":"https://api.github.com/repos/alexsaveliev/srclib-java/assignees{/user}","branches_url":"https://api.github.com/repos/alexsaveliev/srclib-java/branches{/branch}","tags_url":"https://api.github.com/repos/alexsaveliev/srclib-java/tags","blobs_url":"https://api.github.com/repos/alexsaveliev/srclib-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexsaveliev/srclib-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexsaveliev/srclib-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexsaveliev/srclib-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexsaveliev/srclib-java/statuses/{sha}","languages_url":"https://api.github.com/repos/alexsaveliev/srclib-java/languages","stargazers_url":"https://api.github.com/repos/alexsaveliev/srclib-java/stargazers","contributors_url":"https://api.github.com/repos/alexsaveliev/srclib-java/contributors","subscribers_url":"https://api.github.com/repos/alexsaveliev/srclib-java/subscribers","subscription_url":"https://api.github.com/repos/alexsaveliev/srclib-java/subscription","commits_url":"https://api.github.com/repos/alexsaveliev/srclib-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexsaveliev/srclib-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexsaveliev/srclib-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexsaveliev/srclib-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexsaveliev/srclib-java/contents/{+path}","compare_url":"https://api.github.com/repos/alexsaveliev/srclib-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexsaveliev/srclib-java/merges","archive_url":"https://api.github.com/repos/alexsaveliev/srclib-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexsaveliev/srclib-java/downloads","issues_url":"https://api.github.com/repos/alexsaveliev/srclib-java/issues{/number}","pulls_url":"https://api.github.com/repos/alexsaveliev/srclib-java/pulls{/number}","milestones_url":"https://api.github.com/repos/alexsaveliev/srclib-java/milestones{/number}","notifications_url":"https://api.github.com/repos/alexsaveliev/srclib-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexsaveliev/srclib-java/labels{/name}","releases_url":"https://api.github.com/repos/alexsaveliev/srclib-java/releases{/id}","created_at":"2015-07-14T19:59:18Z","updated_at":"2015-07-14T19:59:19Z","pushed_at":"2015-08-26T10:13:29Z","git_url":"git://github.com/alexsaveliev/srclib-java.git","ssh_url":"git@github.com:alexsaveliev/srclib-java.git","clone_url":"https://github.com/alexsaveliev/srclib-java.git","svn_url":"https://github.com/alexsaveliev/srclib-java","homepage":"https://sourcegraph.com/sourcegraph/srclib-java","size":1026,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"sourcegraph:master","ref":"master","sha":"1ca570a89626712c66af6d68fbf59d5f5cca3cbc","user":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"repo":{"id":22005135,"name":"srclib-java","full_name":"sourcegraph/srclib-java","owner":{"login":"sourcegraph","id":3979584,"avatar_url":"https://avatars.githubusercontent.com/u/3979584?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcegraph","html_url":"https://github.com/sourcegraph","followers_url":"https://api.github.com/users/sourcegraph/followers","following_url":"https://api.github.com/users/sourcegraph/following{/other_user}","gists_url":"https://api.github.com/users/sourcegraph/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcegraph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcegraph/subscriptions","organizations_url":"https://api.github.com/users/sourcegraph/orgs","repos_url":"https://api.github.com/users/sourcegraph/repos","events_url":"https://api.github.com/users/sourcegraph/events{/privacy}","received_events_url":"https://api.github.com/users/sourcegraph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcegraph/srclib-java","description":"","fork":false,"url":"https://api.github.com/repos/sourcegraph/srclib-java","forks_url":"https://api.github.com/repos/sourcegraph/srclib-java/forks","keys_url":"https://api.github.com/repos/sourcegraph/srclib-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcegraph/srclib-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcegraph/srclib-java/teams","hooks_url":"https://api.github.com/repos/sourcegraph/srclib-java/hooks","issue_events_url":"https://api.github.com/repos/sourcegraph/srclib-java/issues/events{/number}","events_url":"https://api.github.com/repos/sourcegraph/srclib-java/events","assignees_url":"https://api.github.com/repos/sourcegraph/srclib-java/assignees{/user}","branches_url":"https://api.github.com/repos/sourcegraph/srclib-java/branches{/branch}","tags_url":"https://api.github.com/repos/sourcegraph/srclib-java/tags","blobs_url":"https://api.github.com/repos/sourcegraph/srclib-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcegraph/srclib-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcegraph/srclib-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcegraph/srclib-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcegraph/srclib-java/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcegraph/srclib-java/languages","stargazers_url":"https://api.github.com/repos/sourcegraph/srclib-java/stargazers","contributors_url":"https://api.github.com/repos/sourcegraph/srclib-java/contributors","subscribers_url":"https://api.github.com/repos/sourcegraph/srclib-java/subscribers","subscription_url":"https://api.github.com/repos/sourcegraph/srclib-java/subscription","commits_url":"https://api.github.com/repos/sourcegraph/srclib-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcegraph/srclib-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcegraph/srclib-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcegraph/srclib-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcegraph/srclib-java/contents/{+path}","compare_url":"https://api.github.com/repos/sourcegraph/srclib-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcegraph/srclib-java/merges","archive_url":"https://api.github.com/repos/sourcegraph/srclib-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcegraph/srclib-java/downloads","issues_url":"https://api.github.com/repos/sourcegraph/srclib-java/issues{/number}","pulls_url":"https://api.github.com/repos/sourcegraph/srclib-java/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcegraph/srclib-java/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcegraph/srclib-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcegraph/srclib-java/labels{/name}","releases_url":"https://api.github.com/repos/sourcegraph/srclib-java/releases{/id}","created_at":"2014-07-19T08:13:02Z","updated_at":"2015-07-29T11:21:06Z","pushed_at":"2015-08-26T10:13:29Z","git_url":"git://github.com/sourcegraph/srclib-java.git","ssh_url":"git@github.com:sourcegraph/srclib-java.git","clone_url":"https://github.com/sourcegraph/srclib-java.git","svn_url":"https://github.com/sourcegraph/srclib-java","homepage":"https://sourcegraph.com/sourcegraph/srclib-java","size":1290,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":10,"forks":3,"open_issues":10,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33"},"html":{"href":"https://github.com/sourcegraph/srclib-java/pull/33"},"issue":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/issues/33"},"comments":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/sourcegraph/srclib-java/statuses/80a4d069ad54208fbfcd449a473796924845d4a7"}}}}