- Mastering PhoneGap Mobile Application Development
- Kerri Shotts
- 433字
- 2021-07-16 13:03:51
Chapter 1. Task Automation
While developing your app, there are often many tasks that need to be executed on a recurring basis. Although these tasks are rarely difficult or terribly time-consuming, over time, the effort adds up and it quickly becomes tiresome and error-prone.
Task automation simplifies these tiresome rituals. Automation lets you define the steps for tasks that you frequently execute (and even those that you execute infrequently, which may be even more useful). In a way, you could consider task automation similar to macros in other productivity applications you might use (such as Microsoft Word).
Inpidual tasks can also depend on other tasks, so you can simplify your manual processes to one or two easy-to-remember and easy-to-type commands. Furthermore, most task automation utilities provide a mechanism to watch for changes made to your project, automatically executing various tasks when any changes have been detected.
Technically, task automation isn't required while developing a PhoneGap / Cordova app; but as your apps grow larger and more complex, it becomes increasingly beneficial. There is some initial overhead, of course, which is often why small projects never implement task automation. But when an app has several views, lots of modules, and a good number of dependencies, the initial overhead quickly pays off.
Note
Although this book is titled Mastering PhoneGap Mobile Application Development, we will be using Cordova to refer to PhoneGap and Cordova. PhoneGap is derived from Cordova and everything we do using Cordova will also work with PhoneGap. Where this doesn't hold true, we'll mention it explicitly.
Also, when we're referring to Cordova and PhoneGap, we are referring to the command-line utilities. There is a PhoneGap Build service available that performs compilation and packaging in the cloud; but if you want to use it, you'll need to adapt the content in this book appropriately. If you want to learn more, see the README.md
file in the code package for this book.
There are several different task automation utilities available. Because one generally writes the majority of their Cordova app in HTML, CSS, and JavaScript, it makes sense to select a task automation system based on JavaScript. At the time of this writing, Gulp (http://gulpjs.com) and Grunt (http://gruntjs.com) are the most popular of the various available utilities.
In this chapter, you will learn about:
- Logology, the demonstration app
- Why use Gulp for Task Automation
- Setting up your app's directory structure
- Installing Gulp
- Creating your first Gulp configuration file
- Creating a modular Gulp configuration
- Copying assets
- Performing substitutions
- Executing various Cordova tasks
- Managing version numbers
- Supporting ES2015
- Linting your code
- Minifying/uglifying your code
- Boost.Asio C++ Network Programming(Second Edition)
- Angular UI Development with PrimeNG
- Vue.js 2 and Bootstrap 4 Web Development
- C++面向對象程序設計(微課版)
- 零基礎學Java(第4版)
- Easy Web Development with WaveMaker
- 微信公眾平臺開發:從零基礎到ThinkPHP5高性能框架實踐
- Symfony2 Essentials
- 青少年信息學競賽
- OpenGL Data Visualization Cookbook
- Visual Foxpro 9.0數據庫程序設計教程
- Django實戰:Python Web典型模塊與項目開發
- Android嵌入式系統程序開發(基于Cortex-A8)
- Java Web應用開發
- Appcelerator Titanium Smartphone App Development Cookbook