By Tim Ambler, Nicholas Cloud
Similar compilers books
Initially released in 1981, this used to be the 1st textbook on programming within the Prolog language and remains to be the definitive introductory textual content on Prolog. even though many Prolog textbooks were released when you consider that, this one has withstood the try out of time due to its comprehensiveness, instructional strategy, and emphasis on basic programming purposes.
- Loop Parallelization
- Automatic Quantum Computer Programming
- Software Engineering for Collective Autonomic Systems: The ASCENS Approach
- Declarative Agent Languages and Technologies: First International Workshop, DALT 2003, Melbourne, Australia, July 15, 2003, Revised Selected and Invited Papers
- Math into LateX
- Embedded Software Development with C
RegisterTask('default', ['file-report']); }; The source code for our plugin is shown in Listing 2-33. Within our plugin, a Grunt multi-task named file-report is registered. When called, the task will iterate through the various target files that were specified in Listing 2-32. As it does so, the plugin will compile a report that details the type, number, and size of the files it finds. Listing 2-33. forEach(addFile); }); displayReport(); }); }; The output generated by our plugin’s file-report task is shown in Figure 2-1.
Tasks will continue to run if the --force option is passed. fatal() Displays a warning and aborts Grunt immediately. Interacting with the File System As a build tool, it comes as no surprise that the majority of Grunt’s plugins interact with the file system in one way or another. Given its importance, Grunt provides helpful abstractions that allow developers to interact with the file system with a minimal amount of boilerplate code. While we won’t list all of them here, Table 2-3 shows several of the most frequently used methods within Grunt’s file API.
Info Chapter 2 ■ Grunt Listing 2-25. png' ] Done, without errors. files multi-task property provides developers with a concise syntax for iterating over multiple files. The contrived example that we’ve just looked at is fairly simple, but Grunt also provides additional options for tackling more complex scenarios. Let’s take a look. As opposed to the src key that was used to configure our task in Listing 2-24, the example in Listing 2-26 demonstrates the use of the files array—a slightly more verbose, but more powerful format for selecting files.