If you follow me on twitter, my current love affair with task management via the node.js module grunt is no secret. Long story short, it is a deliciously simple way to automate development tasks, with a multitude of those tasks (like linting, minification, file watching, etc…) already done for you. I could babble on about it here, but I think a tweet of mine best encapsulates my experience with it.
I love @gruntjs. I now officially spend next to no time on shit that isn’t integral to the user-facing functionality of my projects.— Tony Lukasavage (@tonylukasavage) December 20, 2013
In a natural fusion of my current technological entanglements, I took to creating grunt task plugins for Appcelerator’s core cross-platform mobile development tools. As a result, we now have grunt-titanium for the Titanium CLI and grunt-alloy for the Alloy MVC framework. With these plugins you can now automate all functionality involved by these 2 tools, in turn letting you shift your focus onto your mobile app development, where it should be.
For a crash course in…
- task automation with grunt, check out their docs. Seriously, learn grunt.
- Titanium and Alloy, check out Appcelerator’s guides and get to building top-of-the-line, cross-platform, native mobile apps quickly and easily.
In the meantime, though, check out these few examples of how you can use grunt-titanium and grunt-alloy to super-charge your development workflow. Bear in mind that these are excerpts from a Gruntfile.js implementation, so again, read up on grunt and check out the grunt-titanium and grunt-alloy repos to fully understand how to use these examples.
Create and build a Titanium app
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Create and compile a Alloy app
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
Stay tuned. I’ll soon be posting about how you can expand this workflow with ti-mocha to start automating the runtime testing of your Titanium and Alloy apps!
PS - grunt-clean is a great plugin to use for cleaning up after yourself when creating temporary Titanium/Alloy apps for test automation.