Use the correct state in buildPluginDefinition()
Use the correct state in buildPluginDefinition()

Within buildPluginDefinition(), the call to setProject() can
(and usually will) return a modified structure together with
the new state.

The subsequent call to evalPluginDef() should use the updated
structure, rather the old stucture that was present before
the setProject() ("pluginDef"); if that is not the case,
the code called by evalPluginDef() will find an inconsistent
structure/state combination, and behave in bizarre ways as
a result.

More in general, it is a bit dangerous to pass to routines
in parallel the two separate state and structure, as the
two may easily inadvertently fall out of alignment, as in this
case.

This patch should be applied to both the 0.13 branch as well
as to a future 0.12.5 release (the corresponding file there
is ./main/Load.scala).

sbt/sbt,twitter-forks/sbt,xuwei-k/xsbt,jaceklaskowski/sbt,jasonchaffee/sbt,twitter-forks/sbt,xeno-by/old-scalameta-sbt,jaceklaskowski/sbt,jkinkead/sbt,xeno-by/old-scalameta-sbt,adriaanm/sbt,mdedetrich/sbt,mdedetrich/sbt,xuwei-k/xsbt,xeno-by/old-scalameta-sbt,pocketberserker/sbt,jkinkead/sbt,corespring/sbt,mdedetrich/sbt,sbt/sbt,jaceklaskowski/sbt,dyx/sbt,mdedetrich/sbt,twitter-forks/sbt,Duhemm/compiler-bridge,mdedetrich/sbt,twitter-forks/sbt,Duhemm/sbt,xuwei-k/xsbt,mdedetrich/sbt,sbt/sbt,som-snytt/xsbt,jkinkead/sbt,mdedetrich/sbt,pdalpra/sbt,jkinkead/sbt,xeno-by/old-scalameta-sbt,dansanduleac/sbt,xeno-by/old-scalameta-sbt,sbt/sbt,sbt/sbt,Duhemm/sbt,dyx/sbt,dyx/sbt,dyx/sbt,xeno-by/old-scalameta-sbt,dyx/sbt,xuwei-k/xsbt,jaceklaskowski/sbt,twitter-forks/sbt,jkinkead/sbt,xuwei-k/xsbt,sbt/sbt,sbt/sbt,jaceklaskowski/sbt,Sciss/sbt