Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 531 lines (377 sloc) 16.777 kB
8b8b3f2 @mde Simplify project name to just Jake.
mde authored
1 ### Jake -- JavaScript build tool for Node.js
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
2
3 ### Installing
4
8b8b3f2 @mde Simplify project name to just Jake.
mde authored
5 Prerequisites: Jake requires Node.js. (<http://nodejs.org/>)
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
6
8b8b3f2 @mde Simplify project name to just Jake.
mde authored
7 Get Jake:
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
8
e3b394b Jake is just jake.
mde authored
9 git clone git://github.com/mde/jake.git
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
10
8b8b3f2 @mde Simplify project name to just Jake.
mde authored
11 Build Jake:
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
12
e3b394b Jake is just jake.
mde authored
13 cd jake && make && sudo make install
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
14
fc6cefd @mde Wrap text.
mde authored
15 By default Jake is installed in "/usr/local." To install it into a different
16 directory (e.g., one that doesn't require super-user privilege), pass the PREFIX
17 variable to the `make install` command. For example, to install it into a
18 "jake" directory in your home directory, you could use this:
418b95f @mde Updated README with custom-install-location info.
mde authored
19
20 make && make install PREFIX=~/jake
21
fc6cefd @mde Wrap text.
mde authored
22 If do you install Jake somewhere special, you'll need to add the "bin" directory
23 in the install target to your PATH to get access to the `jake` executable.
418b95f @mde Updated README with custom-install-location info.
mde authored
24
6086176 @mde Bump version number.
mde authored
25 ### Installing with [NPM](http://npmjs.org/)
686d6c6 @isaacs Add npm installation instructions.
isaacs authored
26
6086176 @mde Bump version number.
mde authored
27 npm install -g jake
cc60a89 @mde Fixing README, bumping version one more time.
mde authored
28
6086176 @mde Bump version number.
mde authored
29 Note that Jake is a system-level tool, and wants to be installed globally.
686d6c6 @isaacs Add npm installation instructions.
isaacs authored
30
e41dff7 @prabirshrestha Instructions for installing in windows in README.md
prabirshrestha authored
31 ### Installing on Windows
32
33 *Assumed: current directory is the same directory where node.exe is present.*
34
35 Get Jake:
36
37 git clone git://github.com/mde/jake.git node_modules/jake
38
39 Copy jake.bat to the same directory as node.exe
40
41 copy node_modules/jake/jake.bat jake.bat
42
43 Add the directory of node.exe to the environment PATH variable.
44
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
45 ### Basic usage
46
79b2ef2 Fixing args-parsing.
mde authored
47 jake [options ...] [env variables ...] target
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
48
49 ### Description
50
fc6cefd @mde Wrap text.
mde authored
51 Jake is a simple JavaScript build program with capabilities similar to the
52 regular make or rake command.
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
53
54 Jake has the following features:
55 * Jakefiles are in standard JavaScript syntax
56 * Tasks with prerequisites
57 * Namespaces for tasks
d0f3ee2 @andrzejsliwa added Jakefile.coffee example
andrzejsliwa authored
58 * Async task execution
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
59
60 ### Options
61
b1a7ff9 @mde Added better error-handling, usage instructions.
mde authored
62 -V
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
63 --version Display the program version.
64
b1a7ff9 @mde Added better error-handling, usage instructions.
mde authored
65 -h
66 --help Display help information.
67
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
68 -f *FILE*
69 --jakefile *FILE* Use FILE as the Jakefile.
70
71 -C *DIRECTORY*
72 --directory *DIRECTORY* Change to DIRECTORY before running tasks.
73
74 -T
75 --tasks Display the tasks, with descriptions, then exit.
76
77 ### Jakefile syntax
78
fc6cefd @mde Wrap text.
mde authored
79 A Jakefile is just executable JavaScript. You can include whatever JavaScript
80 you want in it.
932b7f0 Issue #29 Added example of file task to README.
mde authored
81
9bfe167 Derp.
mde authored
82 ## Tasks
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
83
fc6cefd @mde Wrap text.
mde authored
84 Use `task` to define tasks. Call it with two arguments (and one optional
85 argument):
cc60a89 @mde Fixing README, bumping version one more time.
mde authored
86
98258bc @mde Async bool flag is now an options object.
mde authored
87 task(name, [prerequisites], action, [opts]);
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
88
fc6cefd @mde Wrap text.
mde authored
89 The `name` argument is a String with the name of the task, and `prerequisites`
90 is an optional Array arg of the list of prerequisite tasks to perform first. The
91 `action` is a Function defininng the action to take for the task. (Note that
92 Object-literal syntax for name/prerequisites in a single argument a la Rake is
93 also supported, but JavaScript's lack of support for dynamic keys in Object
94 literals makes it not very useful.)
cc60a89 @mde Fixing README, bumping version one more time.
mde authored
95
fc6cefd @mde Wrap text.
mde authored
96 The `opts` argument is optional, and when it includes an `async` property set to
97 `true`, indicates the task executes asynchronously. Asynchronous tasks need to
98 call `complete()` to signal they have completed. (Passing a final `async`
99 Boolean flag is deprecated, but still supported.)
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
100
fc6cefd @mde Wrap text.
mde authored
101 Tasks created with `task` are always executed when asked for (or are a
102 prerequisite). Tasks created with `file` are only executed if no file with the
103 given name exists or if any of its file-prerequisites are more recent than the
104 file named by the task. Also, if any prerequisite is a regular task, the file
105 task will always be executed.
0c8ca80 Added support for file-tasks, just like in make, rake and all of thei…
Jakob Mattsson authored
106
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
107 Use `desc` to add a string description of the task.
108
109 Here's an example:
110
111 desc('This is the default task.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
112 task('default', function (params) {
671925f @mde Updated README to explain params-passing and env vars.
mde authored
113 console.log('This is the default task.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
114 });
115
116 desc('This task has prerequisites.');
fe00f21 Deprecate name/dependencies in Object-literal style.
mde authored
117 task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) {
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
118 console.log('Ran some prereqs first.');
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
119 });
120
b50167d @novemberborn Updated README with information about the fork, async support.
novemberborn authored
121 And here's an example of an asynchronous task:
122
123 desc('This is an asynchronous task.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
124 task('asyncTask', function () {
b50167d @novemberborn Updated README with information about the fork, async support.
novemberborn authored
125 setTimeout(complete, 1000);
98258bc @mde Async bool flag is now an options object.
mde authored
126 }, {async: true});
b50167d @novemberborn Updated README with information about the fork, async support.
novemberborn authored
127
39a858f @mde Document Tasks as EventEmitters.
mde authored
128 A Task is also an EventEmitter which emits the 'complete' event when it is
129 finished. This allows asynchronous tasks to be run from within other asked via
130 either `invoke` or `execute`, and ensure they will complete before the rest of
131 the containing task executes. See the section "Running tasks from within other
132 tasks," below.
133
932b7f0 Issue #29 Added example of file task to README.
mde authored
134 ### File-tasks
135
4336691 Stupid C/P error.
mde authored
136 Create a file-task by calling `file`.
932b7f0 Issue #29 Added example of file task to README.
mde authored
137
fc6cefd @mde Wrap text.
mde authored
138 File-tasks create a file from one or more other files. With a file-task, Jake
139 checks both that the file exists, and also that it is not older than the files
140 specified by any prerequisite tasks. File-tasks are particularly useful for
141 compiling something from a tree of source files.
e993d74 Added doc for directory-tasks.
mde authored
142
932b7f0 Issue #29 Added example of file task to README.
mde authored
143 desc('This builds a minified JS file for production.');
fe00f21 Deprecate name/dependencies in Object-literal style.
mde authored
144 file('foo-minified.js', ['bar', 'foo-bar.js', 'foo-baz.js'], function () {
932b7f0 Issue #29 Added example of file task to README.
mde authored
145 // Code to concat and minify goes here
146 });
147
e993d74 Added doc for directory-tasks.
mde authored
148 ### Directory-tasks
149
4336691 Stupid C/P error.
mde authored
150 Create a directory-task by calling `directory`.
e993d74 Added doc for directory-tasks.
mde authored
151
fc6cefd @mde Wrap text.
mde authored
152 Directory-tasks create a directory for use with for file-tasks. Jake checks for
153 the existence of the directory, and only creates it if needed.
e993d74 Added doc for directory-tasks.
mde authored
154
155 desc('This creates the bar directory for use with the foo-minified.js file-task.');
156 directory('bar');
157
fc6cefd @mde Wrap text.
mde authored
158 This task will create the directory when used as a prerequisite for a file-task,
159 or when run from the command-line.
430937e @mde Clarify usage of DirectoryTasks.
mde authored
160
932b7f0 Issue #29 Added example of file task to README.
mde authored
161 ### Namespaces
162
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
163 Use `namespace` to create a namespace of tasks to perform. Call it with two arguments:
164
497d66d @mde Fixed indenting.
mde authored
165 namespace(name, namespaceTasks);
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
166
fc6cefd @mde Wrap text.
mde authored
167 Where is `name` is the name of the namespace, and `namespaceTasks` is a function
168 with calls inside it to `task` or `desc` definining all the tasks for that
169 namespace.
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
170
171 Here's an example:
172
173 desc('This is the default task.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
174 task('default', function () {
671925f @mde Updated README to explain params-passing and env vars.
mde authored
175 console.log('This is the default task.');
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
176 });
177
178 namespace('foo', function () {
179 desc('This the foo:bar task');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
180 task('bar', function () {
671925f @mde Updated README to explain params-passing and env vars.
mde authored
181 console.log('doing foo:bar task');
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
182 });
183
184 desc('This the foo:baz task');
fe00f21 Deprecate name/dependencies in Object-literal style.
mde authored
185 task('baz', ['default', 'foo:bar'], function () {
671925f @mde Updated README to explain params-passing and env vars.
mde authored
186 console.log('doing foo:baz task');
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
187 });
188
189 });
190
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
191 In this example, the foo:baz task depends on the the default and foo:bar tasks.
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
192
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
193 ### Passing parameters to jake
194
fc6cefd @mde Wrap text.
mde authored
195 Parameters can be passed to Jake two ways: plain arguments, and environment
196 variables.
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
197
fc6cefd @mde Wrap text.
mde authored
198 To pass positional arguments to the Jake tasks, enclose them in square braces,
199 separated by commas, after the name of the task on the command-line. For
200 example, with the following Jakefile:
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
201
202 desc('This is an awesome task.');
f1ddbe3 @mde Better example of passing params using named args to the action-funct…
mde authored
203 task('awesome', function (a, b, c) {
204 console.log(a, b, c);
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
205 });
206
207 You could run `jake` like this:
208
671925f @mde Updated README to explain params-passing and env vars.
mde authored
209 jake awesome[foo,bar,baz]
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
210
211 And you'd get the following output:
212
f1ddbe3 @mde Better example of passing params using named args to the action-funct…
mde authored
213 foo bar baz
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
214
671925f @mde Updated README to explain params-passing and env vars.
mde authored
215 Note that you *cannot* uses spaces between the commas separating the parameters.
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
216
fc6cefd @mde Wrap text.
mde authored
217 Any parameters passed after the Jake task that contain an equals sign (=) will
218 be added to process.env.
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
219
671925f @mde Updated README to explain params-passing and env vars.
mde authored
220 With the following Jakefile:
221
222 desc('This is an awesome task.');
f1ddbe3 @mde Better example of passing params using named args to the action-funct…
mde authored
223 task('awesome', function (a, b, c) {
224 console.log(a, b, c);
225 console.log(process.env.qux, process.env.frang);
671925f @mde Updated README to explain params-passing and env vars.
mde authored
226 });
227
228 You could run `jake` like this:
229
f6a07ee @mde No longer support colon delimiter for env vars.var
mde authored
230 jake awesome[foo,bar,baz] qux=zoobie frang=asdf
9d5301f @mde Updated README with info on passing params, fixed bug with nonexisten…
mde authored
231
232 And you'd get the following output:
233
f1ddbe3 @mde Better example of passing params using named args to the action-funct…
mde authored
234 foo bar baz
235 zoobie asdf
13b9829 @mde Added better options parsing and usage instructions in README.
mde authored
236 Running `jake` with no arguments runs the default task.
237
fc6cefd @mde Wrap text.
mde authored
238 __Note for zsh users__ : you will need to escape the brackets or wrap in single
239 quotes like this to pass parameters :
8d936fe @alexstrat Add few lines about passing arguments for zsh users (issue #44)
alexstrat authored
240
241 jake 'awesome[foo,bar,baz]'
fc6cefd @mde Wrap text.
mde authored
242
243 An other solution is to desactivate permannently file-globbing for the `jake`
244 command. You can do this by adding this line to your `.zshrc` file :
8d936fe @alexstrat Add few lines about passing arguments for zsh users (issue #44)
alexstrat authored
245
246 alias jake="noglob jake"
247
38c8f44 Added docs for invoke/execute to README.
mde authored
248 ### Running tasks from within other tasks
249
fc6cefd @mde Wrap text.
mde authored
250 Jake supports the ability to run a task from within another task via the
251 `invoke` and `execute` methods.
38c8f44 Added docs for invoke/execute to README.
mde authored
252
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
253 The `invoke` method will run the desired task, along with its prerequisites:
38c8f44 Added docs for invoke/execute to README.
mde authored
254
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
255 desc('Calls the foo:bar task and its prerequisites.');
256 task('invokeFooBar', function () {
257 // Calls foo:bar and its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
258 jake.Task['foo:bar'].invoke();
259 });
260
39a858f @mde Document Tasks as EventEmitters.
mde authored
261 Tasks are EventEmitters. If the inner-task invoked is asynchronous, you can set
262 a listener on the 'complete' event to run any code that depends on it.
263
264 desc('Calls the async foo:baz task and its prerequisites.');
265 task('invokeFooBaz', function () {
266 var t = jake.Task['foo:baz'];
267 t.addListener('complete', function () {
268 console.log('Finished executing foo:baz');
269 // Maybe run some other code
270 // ...
271 // Complete the containing task
272 complete();
273 });
274 // Kick off foo:baz
275 t.invoke();
276 }, {async: true});
277
278 The `invoke` method will only run the task once, even if you call it repeatedly.
38c8f44 Added docs for invoke/execute to README.
mde authored
279
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
280 desc('Calls the foo:bar task and its prerequisites.');
281 task('invokeFooBar', function () {
fe00f21 Deprecate name/dependencies in Object-literal style.
mde authored
282 // Calls foo:bar and its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
283 jake.Task['foo:bar'].invoke();
284 // Does nothing
285 jake.Task['foo:bar'].invoke();
286 });
287
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
288 The `execute` method will run the desired task without its prerequisites:
38c8f44 Added docs for invoke/execute to README.
mde authored
289
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
290 desc('Calls the foo:bar task without its prerequisites.');
291 task('executeFooBar', function () {
292 // Calls foo:bar without its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
293 jake.Task['foo:baz'].execute();
294 });
295
296 Calling `execute` repeatedly will run the desired task repeatedly.
297
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
298 desc('Calls the foo:bar task without its prerequisites.');
299 task('executeFooBar', function () {
300 // Calls foo:bar without its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
301 jake.Task['foo:baz'].execute();
302 // Can keep running this over and over
303 jake.Task['foo:baz'].execute();
304 jake.Task['foo:baz'].execute();
305 });
306
fc6cefd @mde Wrap text.
mde authored
307 If you want to run the task and its prerequisites more than once, you can use
308 `invoke` with the `reenable` method.
38c8f44 Added docs for invoke/execute to README.
mde authored
309
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
310 desc('Calls the foo:bar task and its prerequisites.');
311 task('invokeFooBar', function () {
312 // Calls foo:bar and its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
313 jake.Task['foo:bar'].invoke();
314 // Does nothing
315 jake.Task['foo:bar'].invoke();
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
316 // Only re-runs foo:bar, but not its prerequisites
88acb6f @mde Don't hyphenate names of methods in docs.
mde authored
317 jake.Task['foo:bar'].reenable();
38c8f44 Added docs for invoke/execute to README.
mde authored
318 jake.Task['foo:bar'].invoke();
319 });
320
fc6cefd @mde Wrap text.
mde authored
321 The `reenable` method takes a single Boolean arg, a 'deep' flag, which reenables
322 the task's prerequisites if set to true.
38c8f44 Added docs for invoke/execute to README.
mde authored
323
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
324 desc('Calls the foo:bar task and its prerequisites.');
325 task('invokeFooBar', function () {
326 // Calls foo:bar and its prereqs
38c8f44 Added docs for invoke/execute to README.
mde authored
327 jake.Task['foo:bar'].invoke();
328 // Does nothing
329 jake.Task['foo:bar'].invoke();
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
330 // Only re-runs foo:bar, but not its prerequisites
88acb6f @mde Don't hyphenate names of methods in docs.
mde authored
331 jake.Task['foo:bar'].reenable(true);
38c8f44 Added docs for invoke/execute to README.
mde authored
332 jake.Task['foo:bar'].invoke();
333 });
334
e3b65da @mde Added example of passing params via execute or invoke.
mde authored
335 It's easy to pass params on to a sub-task run via `invoke` or `execute`:
336
337 desc('Passes params on to other tasks.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
338 task('passParams', function () {
e3b65da @mde Added example of passing params via execute or invoke.
mde authored
339 var t = jake.Task['foo:bar'];
340 // Calls foo:bar, passing along current args
341 t.invoke.apply(t, arguments);
342 });
343
f8c08a0 @mde Better fail.
mde authored
344 ### Aborting a task
345
fc6cefd @mde Wrap text.
mde authored
346 You can abort a task by calling the `fail` function, and Jake will abort the
347 currently running task. You can pass a customized error message to `fail`:
f8c08a0 @mde Better fail.
mde authored
348
349 desc('This task fails.');
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
350 task('failTask', function () {
f8c08a0 @mde Better fail.
mde authored
351 fail('Yikes. Something back happened.');
352 });
353
991d461 Added docs for custom status-codes for fail.
mde authored
354 You can also pass an optional exit status-code to the fail command, like so:
355
356 desc('This task fails with an exit-status of 42.');
357 task('failTaskQuestionCustomStatus', function () {
358 fail('What is the answer?', 42);
359 });
360
361 The process will exit with a status of 42.
362
f8c08a0 @mde Better fail.
mde authored
363 Uncaught errors will also abort the currently running task.
364
ae52453 @mde Updated README with example usage of -T/--tasks
mde authored
365 ### Showing the list of tasks
366
fc6cefd @mde Wrap text.
mde authored
367 Passing `jake` the -T or --tasks flag will display the full list of tasks
368 available in a Jakefile, along with their descriptions:
ae52453 @mde Updated README with example usage of -T/--tasks
mde authored
369
370 $ jake -T
371 jake default # This is the default task.
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
372 jake asdf # This is the asdf task.
ae52453 @mde Updated README with example usage of -T/--tasks
mde authored
373 jake concat.txt # File task, concating two files together
374 jake failure # Failing task.
375 jake lookup # Jake task lookup by name.
376 jake foo:bar # This the foo:bar task
377 jake foo:fonebone # This the foo:fonebone task
378
379 Setting a value for -T/--tasks will filter the list by that value:
380
381 $ jake -T foo
382 jake foo:bar # This the foo:bar task
383 jake foo:fonebone # This the foo:fonebone task
384
385 The list displayed will be all tasks whose namespace/name contain the filter-string.
386
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
387 ### PackageTask
388
fc6cefd @mde Wrap text.
mde authored
389 Jake's PackageTask programmically creates a set of tasks for packaging up your
390 project for distribution. Here's an example:
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
391
4edf414 Updates to FileList, PackageTask to deal with removal of require.paths
mde authored
392 var t = new jake.PackageTask('fonebone', 'v0.1.2112', function () {
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
393 var fileList = [
394 'Jakefile'
395 , 'README.md'
396 , 'package.json'
397 , 'lib/*'
398 , 'bin/*'
399 , 'tests/*'
400 ];
401 this.packageFiles.include(fileList);
402 this.needTarGz = true;
403 this.needTarBz2 = true;
404 });
405
fc6cefd @mde Wrap text.
mde authored
406 This will automatically create a 'package' task that will assemble the specified
407 files in 'pkg/fonebone-v0.1.2112,' and compress them according to the specified
408 options. After running `jake package`, you'll have the following in pkg/:
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
409
410 fonebone-v0.1.2112
411 fonebone-v0.1.2112.tar.bz2
412 fonebone-v0.1.2112.tar.gz
413
fc6cefd @mde Wrap text.
mde authored
414 PackageTask also creates a 'clobberPackage' task that removes the pkg/
415 directory, and a 'repackage' task that forces the package to be rebuilt.
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
416
fc6cefd @mde Wrap text.
mde authored
417 PackageTask requires NodeJS's minimatchmodule
418 (https://github.com/isaacs/minimatch). It is used in FileList, which is used to
419 specify the list of files to include in your PackageTask (the packageFiles
420 property). (See FileList, below.)
a6a79e2 Docs, bugfixes for PackageTask.
mde authored
421
0b35466 Bugfix and docs for FileList.
mde authored
422 ### FileList
423
fc6cefd @mde Wrap text.
mde authored
424 Jake's FileList takes a list of glob-patterns and file-names, and lazy-creates a
425 list of files to include. Instead of immediately searching the filesystem to
426 find the files, a FileList holds the pattern until it is actually used.
0b35466 Bugfix and docs for FileList.
mde authored
427
fc6cefd @mde Wrap text.
mde authored
428 When any of the normal JavaScript Array methods (or the `toArray` method) are
429 called on the FileList, the pending patterns are resolved into an actual list of
430 file-names. FileList uses NodeJS's minimatchmodule
431 (https://github.com/isaacs/minimatch).
0b35466 Bugfix and docs for FileList.
mde authored
432
433 To build the list of files, use FileList's `include` and `exclude` methods:
434
4edf414 Updates to FileList, PackageTask to deal with removal of require.paths
mde authored
435 var list = new jake.FileList();
0b35466 Bugfix and docs for FileList.
mde authored
436 list.include('foo/*.txt');
437 list.include(['bar/*.txt', 'README.md']);
438 list.include('Makefile', 'package.json');
439 list.exclude('foo/zoobie.txt');
440 list.exclude(/foo\/src.*.txt/);
441 console.log(list.toArray());
442
fc6cefd @mde Wrap text.
mde authored
443 The `include` method can be called either with an array of items, or multiple
444 single parameters. Items can be either glob-patterns, or individual file-names.
0b35466 Bugfix and docs for FileList.
mde authored
445
fc6cefd @mde Wrap text.
mde authored
446 The `exclude` method will prevent files from being included in the list. These
447 files must resolve to actual files on the filesystem. It can be called either
448 with an array of items, or mutliple single parameters. Items can be
449 glob-patterns, individual file-names, string-representations of
450 regular-expressions, or regular-expression literals.
0b35466 Bugfix and docs for FileList.
mde authored
451
cc2d44d @mde Documented NpmPublishTask
mde authored
452 ### NpmPublishTask
453
454 The NpmPublishTask builds on top of PackageTask to allow you to do a version
455 bump of your project, package it, and publish it to NPM. Define the task with
456 your project's name, and the list of files you want packaged and published to
457 NPM.
458
459 Here's an example from Jake's Jakefile:
460
461 var p = new jake.NpmPublishTask('jake', [
462 'Makefile'
463 , 'Jakefile'
464 , 'README.md'
465 , 'package.json'
466 , 'lib/*'
467 , 'bin/*'
468 , 'tests/*'
469 ]);
470
f50a99b @mde getPackageVersionNumber doesn't need to be publicly available.
mde authored
471 The NpmPublishTask will automatically create a `publish` task which performs the
cc2d44d @mde Documented NpmPublishTask
mde authored
472 following steps:
473
474 1. Bump the version number in your package.json
475 2. Commit change in git, push it to GitHub
476 3. Create a git tag for the version
477 4. Push the tag to GitHub
478 5. Package the new version of your project
479 6. Publish it to NPM
39a858f @mde Document Tasks as EventEmitters.
mde authored
480 7. Clean up the package
cc2d44d @mde Documented NpmPublishTask
mde authored
481
3ab7761 @mde Edited wording of CoffeeScript example.
mde authored
482 ### CoffeeScript Jakefiles
d0f3ee2 @andrzejsliwa added Jakefile.coffee example
andrzejsliwa authored
483
fc6cefd @mde Wrap text.
mde authored
484 Jake can also handle Jakefiles in CoffeeScript. Be sure to make it
485 Jakefile.coffee so Jake knows it's in CoffeeScript.
3ab7761 @mde Edited wording of CoffeeScript example.
mde authored
486
487 Here's an example:
d0f3ee2 @andrzejsliwa added Jakefile.coffee example
andrzejsliwa authored
488
489 sys = require('sys')
490
491 desc 'This is the default task.'
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
492 task 'default', (params) ->
d0f3ee2 @andrzejsliwa added Jakefile.coffee example
andrzejsliwa authored
493 console.log 'Ths is the default task.'
494 console.log(sys.inspect(arguments))
ffd420e @andrzejsliwa added function for calling task from body of another task.
andrzejsliwa authored
495 invoke 'new', []
496
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
497 task 'new', ->
ffd420e @andrzejsliwa added function for calling task from body of another task.
andrzejsliwa authored
498 console.log 'ello from new'
499 invoke 'foo:next', ['param']
500
501 namespace 'foo', ->
d6d61c9 Fixes to docs, added test for older string+array syntax.
mde authored
502 task 'next', (param) ->
ffd420e @andrzejsliwa added function for calling task from body of another task.
andrzejsliwa authored
503 console.log 'ello from next with param: ' + param
d0f3ee2 @andrzejsliwa added Jakefile.coffee example
andrzejsliwa authored
504
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
505 ### Related projects
506
b9e614a @mde Added hotlinks for URLs in README.
mde authored
507 James Coglan's "Jake": <http://github.com/jcoglan/jake>
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
508
509 Confusingly, this is a Ruby tool for building JavaScript packages from source code.
510
b9e614a @mde Added hotlinks for URLs in README.
mde authored
511 280 North's Jake: <http://github.com/280north/jake>
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
512
513 This is also a JavaScript port of Rake, which runs on the Narwhal platform.
514
b9e614a @mde Added hotlinks for URLs in README.
mde authored
515 ### Author
394bb0c @mde Added binary and Makefile, updated README with build instructions and…
mde authored
516
3ba1151 @mde Updated README to include Contributors section.
mde authored
517 Matthew Eernisse, mde@fleegix.org
518
519 ### Contributors
520
3a6649f @mde Updated README, bumped version.
mde authored
521 Mark Wubben / EqualMedia <mark.wubben@equalmedia.com>
522 Patrick Walton <pcwalton@mimiga.net>
523 Andrzej Sliwa <andrzej.sliwa@i-tool.eu>
524 Nikolay V. Nemshilov aka St <nemshilov@gmail.com>
721b1cd @mde Updated contributors in README.
mde authored
525 Sascha Teske <sascha.teske@gmail.com>
3ba1151 @mde Updated README to include Contributors section.
mde authored
526
7038fac @prabirshrestha added Apache License, Version 2.0 in README.md
prabirshrestha authored
527 ### License
528
fc6cefd @mde Wrap text.
mde authored
529 Licensed under the Apache License, Version 2.0
530 (<http://www.apache.org/licenses/LICENSE-2.0>)
Something went wrong with that request. Please try again.