Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid SBT macro recompilation issue #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mlvn23
Copy link

@mlvn23 mlvn23 commented Oct 8, 2015

If you add a method in the API, you'll get an error like this:

Request path: spatutorial/shared/Api/getTodos
Request path: spatutorial/shared/Api/getMessage
Request path: spatutorial/shared/Api/motd
Sending 4 Todo items
[error] p.c.s.n.PlayDefaultUpstreamHandler - Cannot invoke the action
scala.MatchError: Request(WrappedArray(spatutorial, shared, Api, getMessage),Map
(what -> java.nio.HeapByteBuffer[pos=0 lim=3 cap=3])) (of class autowire.Core$Re
quest)

SBT appears to have an issue in not incrementally compiling macros when its
dependents change. So in this case, the Router is dependent on Api trait,
and if that trait changes, all invocation to the Router needs to be recompiled.
The original Router invocation was in Application, but Application will probably
not change when you change the Api service. As a work-around, move it here because
if you change the Api trait, you will need to change the ApiService implementation,
so this entire file (including the router invocation) would have to be recompiled.

@mlvn23
Copy link
Author

mlvn23 commented Oct 8, 2015

This would fix #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants