Assume you have built (coded) your MVC Sencha Touch App with a bunch of Views, Controllers, Models, Stores, Utils etc…
Whats the best way to “build” the application for production use?
Tasks would be:
- Concat and minify all JS Source Files
- Concat and minify Stylesheets (basically running Compass with production environment)
- Remove not needed folders
Has anyone done this yet with either JSBuilder or Apache Ant? I find the JSBuilder solution integrated with the Sencha Touch lib quite buggy and undocumented. Apache Ant would perfectly fit in with “bigger” build- or CI-systems like Jenkins but I miss a good example how to achive this with a Sencha Touch app.
So the question is, how should a build script for Sencha Touch look like?
EDIT: Warning: this is an old answer, today there might be better ways to do this. Modern build tools for javascript have come a long way since 2011.
I actually did just this today.
First I considered using sprockster, since I liked the c/c++ include style of defining script dependencies.
I ended up using Apache ant because some of my team members are somewhat afraid of ruby.
Apache ant also seemed like a more universal and well documented tool.
I haven’t figured out how to build the sass files automatically just yet, but that shouldn’t be too difficult.
The process i use is kind of simple:
This is what i ended up with:
As you can see, I specify every single file in my project. This is just to get the order right. If your code is better written than mine, and don’t have any dependencies, you could just include an entire source folder.