{"action":"created","comment":{"url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments/36155315","id":36155315,"diff_hunk":"@@ -0,0 +1,60 @@\n+import sbt._\n+import sbt.Keys._\n+import java.nio.file.Files\n+import java.util.regex.Pattern\n+import scala.collection.JavaConverters._\n+\n+object Util {\n+  lazy val copySharedResources = Def.task {\n+//    Called when we have files under core, streaming that need to be copyied into services/js.\n+//    ConsoleLogger().info(\"copying shared resources\")\n+//    val sharedMessages = \"src/main/scala/org/apache/gearpump/shared/Messages.scala\"\n+//    IO.copyFile(core.base / sharedMessages, file(Build.servicesjs.baseDirectory) / sharedMessages)\n+  }\n+\n+  def findDirs(currentDir: String): Array[File] = {\n+    val dirs = IO.listFiles(file(currentDir),  DirectoryFilter)\n+    dirs ++ dirs.flatMap(dir => {\n+      val childDir = currentDir + \"/\" + dir.getName\n+      findDirs(file(childDir).getPath)\n+    })\n+  }\n+\n+  def findFiles(dir: File, pattern: PatternFilter): Array[File] = {\n+    val dirs = findDirs(dir.getPath)\n+    IO.listFiles(dir, pattern) ++ dirs.flatMap(dir => {\n+      IO.listFiles(dir, pattern)\n+    })\n+  }\n+\n+  def copyJSArtifactsToOutput: Unit = {\n+    ConsoleLogger().info(s\"copying JS artifacts ${Build.servicesjs.base.getPath}\")\n+    val in = file(s\"${Build.servicesjs.base.getPath}/target/${Build.scalaVersionMajor}/gearpump-services-js-fastopt.js.map\")\n+    val out = file(s\"${Build.distDashboardDirectory}/gearpump-services-js-fastopt.js.map\")\n+    val input = IO.read(in)\n+    val data = input.replaceAll(\"../../src\",\"src\")","path":"project/Util.scala","position":35,"original_position":35,"commit_id":"2d6609a19f3777bfdd6e88fd7703b927297d7a73","original_commit_id":"2d6609a19f3777bfdd6e88fd7703b927297d7a73","user":{"login":"kkasravi","id":146453,"avatar_url":"https://avatars.githubusercontent.com/u/146453?v=3","gravatar_id":"","url":"https://api.github.com/users/kkasravi","html_url":"https://github.com/kkasravi","followers_url":"https://api.github.com/users/kkasravi/followers","following_url":"https://api.github.com/users/kkasravi/following{/other_user}","gists_url":"https://api.github.com/users/kkasravi/gists{/gist_id}","starred_url":"https://api.github.com/users/kkasravi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkasravi/subscriptions","organizations_url":"https://api.github.com/users/kkasravi/orgs","repos_url":"https://api.github.com/users/kkasravi/repos","events_url":"https://api.github.com/users/kkasravi/events{/privacy}","received_events_url":"https://api.github.com/users/kkasravi/received_events","type":"User","site_admin":false},"body":"Ok, this will likely break ~fastOptJS, so files after editing must be manually copied to output. \n\n\n\n> On Aug 3, 2015, at 8:24 PM, Sean Zhong <notifications@github.com> wrote:\n> \n> In project/Util.scala:\n> \n> > +    })\n> > +  }\n> > +\n> > +  def findFiles(dir: File, pattern: PatternFilter): Array[File] = {\n> > +    val dirs = findDirs(dir.getPath)\n> > +    IO.listFiles(dir, pattern) ++ dirs.flatMap(dir => {\n> > +      IO.listFiles(dir, pattern)\n> > +    })\n> > +  }\n> > +\n> > +  def copyJSArtifactsToOutput: Unit = {\n> > +    ConsoleLogger().info(s\"copying JS artifacts ${Build.servicesjs.base.getPath}\")\n> > +    val in = file(s\"${Build.servicesjs.base.getPath}/target/${Build.scalaVersionMajor}/gearpump-services-js-fastopt.js.map\")\n> > +    val out = file(s\"${Build.distDashboardDirectory}/gearpump-services-js-fastopt.js.map\")\n> > +    val input = IO.read(in)\n> > +    val data = input.replaceAll(\"../../src\",\"src\")\n> Here is my proposal:\n> 1. remove this function copyJSArtifactsToOutput.\n> 2. In sbt/pack target, copy gearpump-services-js-fastopt.js and gearpump-services-js-fastopt.js.map to target\\pack\\dashboard\\views\\scalajs\\\n> 3. If developer want to debug, they can copy services/js/src/ to target/pack/dasboard/\n> \n> Here is my reasoning:\n> 1. no scala source file sould exist in final package\n> 2. Maintianing stuff like findDirs, findFile, or copyJSArtifactsToOutput will complicate the build script.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n","created_at":"2015-08-04T03:44:44Z","updated_at":"2015-08-04T03:44:44Z","html_url":"https://github.com/intel-hadoop/gearpump/pull/1280#discussion_r36155315","pull_request_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280","_links":{"self":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments/36155315"},"html":{"href":"https://github.com/intel-hadoop/gearpump/pull/1280#discussion_r36155315"},"pull_request":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280"}}},"pull_request":{"url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280","id":41296951,"html_url":"https://github.com/intel-hadoop/gearpump/pull/1280","diff_url":"https://github.com/intel-hadoop/gearpump/pull/1280.diff","patch_url":"https://github.com/intel-hadoop/gearpump/pull/1280.patch","issue_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/1280","number":1280,"state":"open","locked":false,"title":"Fixes #1278 split services into 2 projects for scala.js","user":{"login":"kkasravi","id":146453,"avatar_url":"https://avatars.githubusercontent.com/u/146453?v=3","gravatar_id":"","url":"https://api.github.com/users/kkasravi","html_url":"https://github.com/kkasravi","followers_url":"https://api.github.com/users/kkasravi/followers","following_url":"https://api.github.com/users/kkasravi/following{/other_user}","gists_url":"https://api.github.com/users/kkasravi/gists{/gist_id}","starred_url":"https://api.github.com/users/kkasravi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkasravi/subscriptions","organizations_url":"https://api.github.com/users/kkasravi/orgs","repos_url":"https://api.github.com/users/kkasravi/repos","events_url":"https://api.github.com/users/kkasravi/events{/privacy}","received_events_url":"https://api.github.com/users/kkasravi/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/intel-hadoop/gearpump/1280)\n<!-- Reviewable:end -->\n","created_at":"2015-07-31T00:30:30Z","updated_at":"2015-08-04T03:44:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47765f17e69fa9ea04e27eba3bb9147ea171b213","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280/commits","review_comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280/comments","review_comment_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/1280/comments","statuses_url":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/2d6609a19f3777bfdd6e88fd7703b927297d7a73","head":{"label":"kkasravi:issue_#1278","ref":"issue_#1278","sha":"2d6609a19f3777bfdd6e88fd7703b927297d7a73","user":{"login":"kkasravi","id":146453,"avatar_url":"https://avatars.githubusercontent.com/u/146453?v=3","gravatar_id":"","url":"https://api.github.com/users/kkasravi","html_url":"https://github.com/kkasravi","followers_url":"https://api.github.com/users/kkasravi/followers","following_url":"https://api.github.com/users/kkasravi/following{/other_user}","gists_url":"https://api.github.com/users/kkasravi/gists{/gist_id}","starred_url":"https://api.github.com/users/kkasravi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkasravi/subscriptions","organizations_url":"https://api.github.com/users/kkasravi/orgs","repos_url":"https://api.github.com/users/kkasravi/repos","events_url":"https://api.github.com/users/kkasravi/events{/privacy}","received_events_url":"https://api.github.com/users/kkasravi/received_events","type":"User","site_admin":false},"repo":{"id":26240076,"name":"gearpump","full_name":"kkasravi/gearpump","owner":{"login":"kkasravi","id":146453,"avatar_url":"https://avatars.githubusercontent.com/u/146453?v=3","gravatar_id":"","url":"https://api.github.com/users/kkasravi","html_url":"https://github.com/kkasravi","followers_url":"https://api.github.com/users/kkasravi/followers","following_url":"https://api.github.com/users/kkasravi/following{/other_user}","gists_url":"https://api.github.com/users/kkasravi/gists{/gist_id}","starred_url":"https://api.github.com/users/kkasravi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkasravi/subscriptions","organizations_url":"https://api.github.com/users/kkasravi/orgs","repos_url":"https://api.github.com/users/kkasravi/repos","events_url":"https://api.github.com/users/kkasravi/events{/privacy}","received_events_url":"https://api.github.com/users/kkasravi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkasravi/gearpump","description":"gearpump","fork":true,"url":"https://api.github.com/repos/kkasravi/gearpump","forks_url":"https://api.github.com/repos/kkasravi/gearpump/forks","keys_url":"https://api.github.com/repos/kkasravi/gearpump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkasravi/gearpump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkasravi/gearpump/teams","hooks_url":"https://api.github.com/repos/kkasravi/gearpump/hooks","issue_events_url":"https://api.github.com/repos/kkasravi/gearpump/issues/events{/number}","events_url":"https://api.github.com/repos/kkasravi/gearpump/events","assignees_url":"https://api.github.com/repos/kkasravi/gearpump/assignees{/user}","branches_url":"https://api.github.com/repos/kkasravi/gearpump/branches{/branch}","tags_url":"https://api.github.com/repos/kkasravi/gearpump/tags","blobs_url":"https://api.github.com/repos/kkasravi/gearpump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkasravi/gearpump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkasravi/gearpump/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkasravi/gearpump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkasravi/gearpump/statuses/{sha}","languages_url":"https://api.github.com/repos/kkasravi/gearpump/languages","stargazers_url":"https://api.github.com/repos/kkasravi/gearpump/stargazers","contributors_url":"https://api.github.com/repos/kkasravi/gearpump/contributors","subscribers_url":"https://api.github.com/repos/kkasravi/gearpump/subscribers","subscription_url":"https://api.github.com/repos/kkasravi/gearpump/subscription","commits_url":"https://api.github.com/repos/kkasravi/gearpump/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkasravi/gearpump/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkasravi/gearpump/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkasravi/gearpump/issues/comments{/number}","contents_url":"https://api.github.com/repos/kkasravi/gearpump/contents/{+path}","compare_url":"https://api.github.com/repos/kkasravi/gearpump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkasravi/gearpump/merges","archive_url":"https://api.github.com/repos/kkasravi/gearpump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkasravi/gearpump/downloads","issues_url":"https://api.github.com/repos/kkasravi/gearpump/issues{/number}","pulls_url":"https://api.github.com/repos/kkasravi/gearpump/pulls{/number}","milestones_url":"https://api.github.com/repos/kkasravi/gearpump/milestones{/number}","notifications_url":"https://api.github.com/repos/kkasravi/gearpump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkasravi/gearpump/labels{/name}","releases_url":"https://api.github.com/repos/kkasravi/gearpump/releases{/id}","created_at":"2014-11-05T21:14:27Z","updated_at":"2015-01-04T18:34:43Z","pushed_at":"2015-08-04T02:07:37Z","git_url":"git://github.com/kkasravi/gearpump.git","ssh_url":"git@github.com:kkasravi/gearpump.git","clone_url":"https://github.com/kkasravi/gearpump.git","svn_url":"https://github.com/kkasravi/gearpump","homepage":"","size":10597,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"intel-hadoop:master","ref":"master","sha":"3390a5af7db1b48a07d532ba60eeedf57f376a7b","user":{"login":"intel-hadoop","id":1839373,"avatar_url":"https://avatars.githubusercontent.com/u/1839373?v=3","gravatar_id":"","url":"https://api.github.com/users/intel-hadoop","html_url":"https://github.com/intel-hadoop","followers_url":"https://api.github.com/users/intel-hadoop/followers","following_url":"https://api.github.com/users/intel-hadoop/following{/other_user}","gists_url":"https://api.github.com/users/intel-hadoop/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-hadoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-hadoop/subscriptions","organizations_url":"https://api.github.com/users/intel-hadoop/orgs","repos_url":"https://api.github.com/users/intel-hadoop/repos","events_url":"https://api.github.com/users/intel-hadoop/events{/privacy}","received_events_url":"https://api.github.com/users/intel-hadoop/received_events","type":"Organization","site_admin":false},"repo":{"id":22139167,"name":"gearpump","full_name":"intel-hadoop/gearpump","owner":{"login":"intel-hadoop","id":1839373,"avatar_url":"https://avatars.githubusercontent.com/u/1839373?v=3","gravatar_id":"","url":"https://api.github.com/users/intel-hadoop","html_url":"https://github.com/intel-hadoop","followers_url":"https://api.github.com/users/intel-hadoop/followers","following_url":"https://api.github.com/users/intel-hadoop/following{/other_user}","gists_url":"https://api.github.com/users/intel-hadoop/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-hadoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-hadoop/subscriptions","organizations_url":"https://api.github.com/users/intel-hadoop/orgs","repos_url":"https://api.github.com/users/intel-hadoop/repos","events_url":"https://api.github.com/users/intel-hadoop/events{/privacy}","received_events_url":"https://api.github.com/users/intel-hadoop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intel-hadoop/gearpump","description":"Lightweight real-time big data streaming engine","fork":false,"url":"https://api.github.com/repos/intel-hadoop/gearpump","forks_url":"https://api.github.com/repos/intel-hadoop/gearpump/forks","keys_url":"https://api.github.com/repos/intel-hadoop/gearpump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intel-hadoop/gearpump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intel-hadoop/gearpump/teams","hooks_url":"https://api.github.com/repos/intel-hadoop/gearpump/hooks","issue_events_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/events{/number}","events_url":"https://api.github.com/repos/intel-hadoop/gearpump/events","assignees_url":"https://api.github.com/repos/intel-hadoop/gearpump/assignees{/user}","branches_url":"https://api.github.com/repos/intel-hadoop/gearpump/branches{/branch}","tags_url":"https://api.github.com/repos/intel-hadoop/gearpump/tags","blobs_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/refs{/sha}","trees_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/{sha}","languages_url":"https://api.github.com/repos/intel-hadoop/gearpump/languages","stargazers_url":"https://api.github.com/repos/intel-hadoop/gearpump/stargazers","contributors_url":"https://api.github.com/repos/intel-hadoop/gearpump/contributors","subscribers_url":"https://api.github.com/repos/intel-hadoop/gearpump/subscribers","subscription_url":"https://api.github.com/repos/intel-hadoop/gearpump/subscription","commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/commits{/sha}","git_commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/commits{/sha}","comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/comments{/number}","issue_comment_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/comments{/number}","contents_url":"https://api.github.com/repos/intel-hadoop/gearpump/contents/{+path}","compare_url":"https://api.github.com/repos/intel-hadoop/gearpump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intel-hadoop/gearpump/merges","archive_url":"https://api.github.com/repos/intel-hadoop/gearpump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intel-hadoop/gearpump/downloads","issues_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues{/number}","pulls_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls{/number}","milestones_url":"https://api.github.com/repos/intel-hadoop/gearpump/milestones{/number}","notifications_url":"https://api.github.com/repos/intel-hadoop/gearpump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intel-hadoop/gearpump/labels{/name}","releases_url":"https://api.github.com/repos/intel-hadoop/gearpump/releases{/id}","created_at":"2014-07-23T08:55:26Z","updated_at":"2015-08-03T18:09:20Z","pushed_at":"2015-08-04T03:30:09Z","git_url":"git://github.com/intel-hadoop/gearpump.git","ssh_url":"git@github.com:intel-hadoop/gearpump.git","clone_url":"https://github.com/intel-hadoop/gearpump.git","svn_url":"https://github.com/intel-hadoop/gearpump","homepage":"http://gearpump.io","size":15681,"stargazers_count":316,"watchers_count":316,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":76,"forks":65,"open_issues":76,"watchers":316,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280"},"html":{"href":"https://github.com/intel-hadoop/gearpump/pull/1280"},"issue":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/issues/1280"},"comments":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/issues/1280/comments"},"review_comments":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280/comments"},"review_comment":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/1280/commits"},"statuses":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/2d6609a19f3777bfdd6e88fd7703b927297d7a73"}}}}