{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/sbt/issues/2267","labels_url":"https://api.github.com/repos/sbt/sbt/issues/2267/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt/issues/2267/comments","events_url":"https://api.github.com/repos/sbt/sbt/issues/2267/events","html_url":"https://github.com/sbt/sbt/issues/2267","id":116069446,"number":2267,"title":"illegal dynamic reference when passing a `ProjectReference` to an `in`","user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-10T09:32:12Z","updated_at":"2015-11-11T17:43:16Z","closed_at":"2015-11-10T21:20:39Z","body":"This\r\n\r\n```scala\r\n    scalacOptions ++= plugins.map { plugin: ProjectReference =>\r\n      \"-Xplugin:\" + packageBin.in(Compile).in(plugin).value\r\n    }\r\n```\r\n\r\nresults in a compile error\r\n\r\n```\r\n[error] D:\\my\\project\\MyBuild.scala:192: Illegal dynamic reference: plugin\r\n[error]         \"-Xplugin:\" + packageBin.in(Compile).in(plugin).value\r\n```\r\n\r\nnote that this also happens if the `plugin` is defined more strictly as a `LocalProject` (which is the implementation I am using).\r\n\r\nIt would appear that the macro is using too much magic.\r\n\r\nIs there a workaround? (That doesn't involve generating the build definition file).\r\n\r\nMy current workaround is a massive hack that only works for my one project (i.e. effectively hardcoding the path to the plugin file in the build definition, and then remembering to run packageBin on the relevant plugin modules before doing a build)."},"comment":{"url":"https://api.github.com/repos/sbt/sbt/issues/comments/155858273","html_url":"https://github.com/sbt/sbt/issues/2267#issuecomment-155858273","issue_url":"https://api.github.com/repos/sbt/sbt/issues/2267","id":155858273,"user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T17:43:16Z","updated_at":"2015-11-11T17:43:16Z","body":"I don't know the `nameOfProjects` in advance, so I have to do something like this and it's still giving the same warning (note that `plugins` is also not known in advance, it is calculated by parsing an Eclipse project definition):\r\n\r\n```\r\n       scalacOptions ++= plugins.map { plugin =>\r\n        \"-Xplugin:\" + Def.taskDyn {\r\n          packageBin.all(ScopeFilter(inProjects(plugin), inConfigurations(Compile)))\r\n        }.value\r\n      }\r\n```\r\n"}}