swarmsim / swarm

Swarm Simulator, an idle game with lots of bugs.
https://www.swarmsim.com
GNU General Public License v3.0
492 stars 140 forks source link

grunt shouldn't needlessly rebuild dist/ #462

Open erosson opened 9 years ago

erosson commented 9 years ago

this makes releasing a lot slower. and really, plain makefiles have known how to avoid doing this since years ago.

Shoelace commented 9 years ago

the 'clean' tasks seems to get run on most tasks... test, serve, etc maybe thats redundant..

erosson commented 9 years ago

looks like generator-angular added the clean tasks there, not me - makes me scared to remove them

grunt-newer does this - call a task like "newer:uglifyjs" instead of "uglifyjs" and it'll only recompile if something's changed. doesn't work for lists of tasks; "newer:build" doesn't work, but adding "newer" to many of the tasks under build would.

safest/easiest approach is probably to detect when dist/ is up to date - if anything in src/ changed since the last dist/ build, rebuild everything. easy to implement with a simple makefile, could probably wrangle something together with grunt-newer too. this would be enough to speed up the common release sequence of serve:dist, deploy-staging, deploy-prod.

erosson commented 9 years ago

nice, google open-sourced blaze: http://bazel.io/ https://news.ycombinator.com/item?id=9256844

using it here would be a pretty big implementation effort, plus a new dependency we have to deal with, and I'm not sure how much js/angular integration is needed, so it might not be the best choice. it does solve needless-rebuilds nicely though, plus it extends that to test runs, and I've just plain missed blaze build