{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/sbt/issues/1816","labels_url":"https://api.github.com/repos/sbt/sbt/issues/1816/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt/issues/1816/comments","events_url":"https://api.github.com/repos/sbt/sbt/issues/1816/events","html_url":"https://github.com/sbt/sbt/pull/1816","id":54791830,"number":1816,"title":"Add javaScalaCompiler task","user":{"login":"pauldraper","id":1403271,"avatar_url":"https://avatars.githubusercontent.com/u/1403271?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldraper","html_url":"https://github.com/pauldraper","followers_url":"https://api.github.com/users/pauldraper/followers","following_url":"https://api.github.com/users/pauldraper/following{/other_user}","gists_url":"https://api.github.com/users/pauldraper/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldraper/subscriptions","organizations_url":"https://api.github.com/users/pauldraper/orgs","repos_url":"https://api.github.com/users/pauldraper/repos","events_url":"https://api.github.com/users/pauldraper/events{/privacy}","received_events_url":"https://api.github.com/users/pauldraper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sbt/sbt/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-19T17:35:27Z","updated_at":"2015-01-19T17:39:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sbt/sbt/pulls/1816","html_url":"https://github.com/sbt/sbt/pull/1816","diff_url":"https://github.com/sbt/sbt/pull/1816.diff","patch_url":"https://github.com/sbt/sbt/pull/1816.patch"},"body":"I want to add a distributed cache of compiled targets and analyses, via an SBT plugin.\r\n\r\nFor that, I need to be able to change out the compile implementation. That term is *very* overloaded...I mean the step where we compile these X files to targets and report the relationships.\r\n\r\n---\r\n\r\nIt seems like I should hook into the `compileIncremental` task. But I can't seem to do that without trying to (1) duplicate lots of functionality, and (2) access lots of private SBT classes.\r\n\r\nCurrently, compilation looks like this:\r\n\r\n```\r\nKeys.compileIncremental (Keys.scala)\r\nDefaults.compileIncrementalTask (Defaults.scala)\r\nDefaults.compileIncrementalTaskImpl (Defaults.scala)\r\nCompiler.Compile (Compiler.scala)\r\nIC.incrementalCompile (IncrementalCompiler.scala)\r\nIC.compileInternal (IncrementalCompiler.scala)\r\n```\r\n\r\nwhich passes `MixedAnalyzingCompile#compile` to\r\n\r\n```\r\nIncrementalCompile.apply (Compile.scala)\r\nIncremental.compile (Incremental.scala)\r\n```\r\n\r\nwhich then uses one of the `IncrementalCommon` implementations, and does some more stuff.\r\n\r\n---\r\n\r\nI'm a little confused by the architecture (e.g. what's `sbt.compiler.IC.incrementalCompile` vs `sbt.inc.IncrementalCompile` vs `sbt.inc.Incremental.compile`).\r\n\r\nCurrently, I hook into the `IC.compileInternal` -> `IncrementalCompile.apply` step.\r\n\r\nI welcome suggestions how this can be better achieved.\r\n\r\n---\r\n\r\nUsage:\r\n\r\n```\r\njavaScalaCompiler := { compiler: MixedAnalyzingCompiler =>\r\n  val analysis = previousCompile.value.analysis\r\n  val underlying = javaScalaCompiler.value(compiler)\r\n  (file: Set[File], changes: DependencyChanges, callback: AnalysisCallback) => {\r\n    println(analysis)\r\n    underlying(file, changes, callback)\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/sbt/sbt/issues/comments/70532222","html_url":"https://github.com/sbt/sbt/pull/1816#issuecomment-70532222","issue_url":"https://api.github.com/repos/sbt/sbt/issues/1816","id":70532222,"user":{"login":"typesafe-tools","id":4379557,"avatar_url":"https://avatars.githubusercontent.com/u/4379557?v=3","gravatar_id":"","url":"https://api.github.com/users/typesafe-tools","html_url":"https://github.com/typesafe-tools","followers_url":"https://api.github.com/users/typesafe-tools/followers","following_url":"https://api.github.com/users/typesafe-tools/following{/other_user}","gists_url":"https://api.github.com/users/typesafe-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/typesafe-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typesafe-tools/subscriptions","organizations_url":"https://api.github.com/users/typesafe-tools/orgs","repos_url":"https://api.github.com/users/typesafe-tools/repos","events_url":"https://api.github.com/users/typesafe-tools/events{/privacy}","received_events_url":"https://api.github.com/users/typesafe-tools/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T17:39:04Z","updated_at":"2015-01-19T17:39:04Z","body":"Can one of the admins verify this patch?"}}