Subscribed unsubscribe Subscribe Subscribe

Kengo's blog

Technical articles about original projects, JVM, Static Analysis and JavaScript.

Rakefile for enchant.js programming

enchant.js javascript Maven

 I found that starting game programming with enchant.js is slow. It has a lot of steps like creating index.html, downloading enchant.js and plugins, downloading images for plugins... it's boring, isn't it?

 We can avoid this problem using, but enchant.js in is too old to use. So I've coded a Rakefile to solve this problem. This Rakefile provides automated downloads and JavaScript optimizations. Plugin isn't supported yet.

 This is the first time for me to use rake. There are 3 reasons why I chose rake: enchant.js uses to build, JavaScript community has a lot of Ruby user (especially server-side), and Maven/Ant (my favorite build system) isn't good solution for this problem. In fact, rake is cool solution. I'll use rake in my product which doesn't based Java.

How to use


# creating index.html, enchant.js and other resources

# optimizing your project
rake optimize

# creating zip file
cd optimize
rake package