Rewrite SBT plugin, close #1206