Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 84 lines (62 sloc) 2.994 kb
2f389f1 Jeremy Ashkenas beginnings of a build script
authored
1 fs: require 'fs'
1cf0326 Jeremy Ashkenas unifying the CoffeeScript.compile and CoffeeScript.run apis to be the sa...
authored
2 CoffeeScript: require 'coffee-script'
2f389f1 Jeremy Ashkenas beginnings of a build script
authored
3
448ed36 Jeremy Ashkenas got a build script for rebuilding the compiler, too
authored
4 # Run a CoffeeScript through our node/coffee interpreter.
5 run: (args) ->
6446e00 Jeremy Ashkenas The Great Purge. Removing the Ruby compiler, and all of its accoutrement...
authored
6 proc: process.createChildProcess 'bin/coffee', args
448ed36 Jeremy Ashkenas got a build script for rebuilding the compiler, too
authored
7 proc.addListener 'error', (err) -> if err then puts err
8
2f389f1 Jeremy Ashkenas beginnings of a build script
authored
9
5c7526a Jeremy Ashkenas moving some of the fs methods over to sync methods, where it's alright a...
authored
10 option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
17ea48c Jeremy Ashkenas first draft of options for Cakefiles, using optparse.coffee, as well as ...
authored
11
12 task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) ->
13 base: options.prefix or '/usr/local'
14 lib: base + '/lib/coffee-script'
0490cb2 Jeremy Ashkenas added experimental (but working) method to install CoffeeScript: 'sudo b...
authored
15 exec([
17ea48c Jeremy Ashkenas first draft of options for Cakefiles, using optparse.coffee, as well as ...
authored
16 'mkdir -p ' + lib
17 'cp -rf bin lib LICENSE README package.json src vendor ' + lib
93f644f Jeremy Ashkenas finishing the second half of prefix installs. Using readLink to refer to...
authored
18 'ln -sf ' + lib + '/bin/coffee ' + base + '/bin/coffee'
19 'ln -sf ' + lib + '/bin/cake ' + base + '/bin/cake'
20 ].join(' && '), (err, stdout, stderr) ->
21 if err then print stderr
22 )
0490cb2 Jeremy Ashkenas added experimental (but working) method to install CoffeeScript: 'sudo b...
authored
23
24
5a81fcd Jeremy Ashkenas we don't need relative require's because the paths are set up correctly ...
authored
25 task 'build', 'build the CoffeeScript language from source', ->
5c7526a Jeremy Ashkenas moving some of the fs methods over to sync methods, where it's alright a...
authored
26 files: fs.readdirSync 'src'
27 files: 'src/' + file for file in files when file.match(/\.coffee$/)
f4cd0bd Jeremy Ashkenas making --run the default option for consistency. If you want to save the...
authored
28 run ['-c', '-o', 'lib'].concat(files)
448ed36 Jeremy Ashkenas got a build script for rebuilding the compiler, too
authored
29
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
30
3396dce Jeremy Ashkenas waypoint -- going to try to clean up regex_token
authored
31 task 'build:full', 'rebuild the source twice, and run the tests', ->
32 exec 'bin/cake build && bin/cake build && bin/cake test', (err, stdout, stderr) ->
bcf7b3f Jeremy Ashkenas CoffeeScript 0.5.5, with string interpolation and internal documentation
authored
33 print stdout if stdout
34 print stderr if stderr
35 throw err if err
36
37
ff25361 Jeremy Ashkenas removing the build:parser -> build dependency in the Cakefile -- the asy...
authored
38 task 'build:parser', 'rebuild the Jison parser (run build first)', ->
2969e15 Jeremy Ashkenas fixing require paths in the Cakefile so that build:jison will work, even...
authored
39 require.paths.unshift 'vendor/jison/lib'
2f389f1 Jeremy Ashkenas beginnings of a build script
authored
40 parser: require('grammar').parser
41 js: parser.generate()
2d0ad73 Jeremy Ashkenas reorganizing lib/coffee_script to plain ol' lib
authored
42 parser_path: 'lib/parser.js'
c39415d Jeremy Ashkenas using the new fs.writeFile API instead of fs.open -- much, much nicer
authored
43 fs.writeFile parser_path, js
2f389f1 Jeremy Ashkenas beginnings of a build script
authored
44
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
45
b674163 Jeremy Ashkenas adding build:ultraviolet and build:underscore tasks to the Cakefile
authored
46 task 'build:ultraviolet', 'build and install the Ultraviolet syntax highlighter', ->
4817b96 Jeremy Ashkenas fixing the build:ultraviolet task in the Cakefile
authored
47 exec 'plist2syntax extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage', (err) ->
b674163 Jeremy Ashkenas adding build:ultraviolet and build:underscore tasks to the Cakefile
authored
48 exec 'sudo mv coffeescript.yaml /usr/local/lib/ruby/gems/1.8/gems/ultraviolet-0.10.2/syntax/coffeescript.syntax'
49
50
c1427d6 Jeremy Ashkenas adding a minified combined coffee-script.js. Include it on the page, aft...
authored
51 task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
70cb195 Jeremy Ashkenas rebuilding extras/coffee-script.js
authored
52 exec 'rake browser', (err) ->
53 throw err if err
c1427d6 Jeremy Ashkenas adding a minified combined coffee-script.js. Include it on the page, aft...
authored
54
55
5b3ef78 Jeremy Ashkenas adding a doc:source Cake task to document CoffeeScript's internals
authored
56 task 'doc:site', 'watch and continually rebuild the documentation for the website', ->
c1427d6 Jeremy Ashkenas adding a minified combined coffee-script.js. Include it on the page, aft...
authored
57 exec 'rake doc'
58
59
5b3ef78 Jeremy Ashkenas adding a doc:source Cake task to document CoffeeScript's internals
authored
60 task 'doc:source', 'rebuild the internal documentation', ->
202ebf0 Jeremy Ashkenas documentation for command.coffee
authored
61 exec 'docco src/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
e267226 Jeremy Ashkenas commenting coffee-script.coffee for documentation
authored
62 throw err if err
5b3ef78 Jeremy Ashkenas adding a doc:source Cake task to document CoffeeScript's internals
authored
63
64
a3e1693 Jeremy Ashkenas waypoint -- docc'd down to the SplatNode
authored
65 task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
66 exec 'uv -s coffeescript -t idle -h examples/underscore.coffee > documentation/underscore.html'
67
68
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
69 task 'test', 'run the CoffeeScript language test suite', ->
b41afe7 Jeremy Ashkenas removed ruby tests, and started the process of converting the CoffeeScri...
authored
70 process.mixin require 'assert'
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
71 test_count: 0
72 start_time: new Date()
6a45d25 Jeremy Ashkenas adding a test for parenthesized throws
authored
73 [original_ok, original_throws]: [ok, throws]
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
74 process.mixin {
6a45d25 Jeremy Ashkenas adding a test for parenthesized throws
authored
75 ok: (args...) -> test_count += 1; original_ok(args...)
76 throws: (args...) -> test_count += 1; original_throws(args...)
bedc005 Jeremy Ashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally), an...
authored
77 }
78 process.addListener 'exit', ->
79 time: ((new Date() - start_time) / 1000).toFixed(2)
80 puts '\033[0;32mpassed ' + test_count + ' tests in ' + time + ' seconds\033[0m'
1f2c8df Jeremy Ashkenas updating to latest Node (0.1.3) API -- callbacks, not promises
authored
81 fs.readdir 'test', (err, files) ->
b41afe7 Jeremy Ashkenas removed ruby tests, and started the process of converting the CoffeeScri...
authored
82 for file in files
06b50ec Jeremy Ashkenas unifying all of the server-side evaluation under CoffeeScript.run -- thi...
authored
83 fs.readFile 'test/' + file, (err, code) ->
1cf0326 Jeremy Ashkenas unifying the CoffeeScript.compile and CoffeeScript.run apis to be the sa...
authored
84 CoffeeScript.run code, {source: file}
Something went wrong with that request. Please try again.