Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (62 sloc) 2.994 kB
2f389f1 @jashkenas beginnings of a build script
authored
1 fs: require 'fs'
1cf0326 @jashkenas unifying the CoffeeScript.compile and CoffeeScript.run apis to be the…
authored
2 CoffeeScript: require 'coffee-script'
2f389f1 @jashkenas beginnings of a build script
authored
3
448ed36 @jashkenas got a build script for rebuilding the compiler, too
authored
4 # Run a CoffeeScript through our node/coffee interpreter.
5 run: (args) ->
6446e00 @jashkenas The Great Purge. Removing the Ruby compiler, and all of its accoutrem…
authored
6 proc: process.createChildProcess 'bin/coffee', args
448ed36 @jashkenas got a build script for rebuilding the compiler, too
authored
7 proc.addListener 'error', (err) -> if err then puts err
8
2f389f1 @jashkenas beginnings of a build script
authored
9
5c7526a @jashkenas moving some of the fs methods over to sync methods, where it's alrigh…
authored
10 option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
17ea48c @jashkenas first draft of options for Cakefiles, using optparse.coffee, as well …
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 @jashkenas added experimental (but working) method to install CoffeeScript: 'sud…
authored
15 exec([
17ea48c @jashkenas first draft of options for Cakefiles, using optparse.coffee, as well …
authored
16 'mkdir -p ' + lib
17 'cp -rf bin lib LICENSE README package.json src vendor ' + lib
93f644f @jashkenas finishing the second half of prefix installs. Using readLink to refer…
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 @jashkenas added experimental (but working) method to install CoffeeScript: 'sud…
authored
23
24
5a81fcd @jashkenas we don't need relative require's because the paths are set up correct…
authored
25 task 'build', 'build the CoffeeScript language from source', ->
5c7526a @jashkenas moving some of the fs methods over to sync methods, where it's alrigh…
authored
26 files: fs.readdirSync 'src'
27 files: 'src/' + file for file in files when file.match(/\.coffee$/)
f4cd0bd @jashkenas making --run the default option for consistency. If you want to save …
authored
28 run ['-c', '-o', 'lib'].concat(files)
448ed36 @jashkenas got a build script for rebuilding the compiler, too
authored
29
bedc005 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
authored
30
3396dce @jashkenas 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 @jashkenas 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 @jashkenas removing the build:parser -> build dependency in the Cakefile -- the …
authored
38 task 'build:parser', 'rebuild the Jison parser (run build first)', ->
2969e15 @jashkenas fixing require paths in the Cakefile so that build:jison will work, e…
authored
39 require.paths.unshift 'vendor/jison/lib'
2f389f1 @jashkenas beginnings of a build script
authored
40 parser: require('grammar').parser
41 js: parser.generate()
2d0ad73 @jashkenas reorganizing lib/coffee_script to plain ol' lib
authored
42 parser_path: 'lib/parser.js'
c39415d @jashkenas using the new fs.writeFile API instead of fs.open -- much, much nicer
authored
43 fs.writeFile parser_path, js
2f389f1 @jashkenas beginnings of a build script
authored
44
bedc005 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
authored
45
b674163 @jashkenas adding build:ultraviolet and build:underscore tasks to the Cakefile
authored
46 task 'build:ultraviolet', 'build and install the Ultraviolet syntax highlighter', ->
4817b96 @jashkenas fixing the build:ultraviolet task in the Cakefile
authored
47 exec 'plist2syntax extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage', (err) ->
b674163 @jashkenas 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 @jashkenas adding a minified combined coffee-script.js. Include it on the page, …
authored
51 task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
70cb195 @jashkenas rebuilding extras/coffee-script.js
authored
52 exec 'rake browser', (err) ->
53 throw err if err
c1427d6 @jashkenas adding a minified combined coffee-script.js. Include it on the page, …
authored
54
55
5b3ef78 @jashkenas 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 @jashkenas adding a minified combined coffee-script.js. Include it on the page, …
authored
57 exec 'rake doc'
58
59
5b3ef78 @jashkenas adding a doc:source Cake task to document CoffeeScript's internals
authored
60 task 'doc:source', 'rebuild the internal documentation', ->
202ebf0 @jashkenas documentation for command.coffee
authored
61 exec 'docco src/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
e267226 @jashkenas commenting coffee-script.coffee for documentation
authored
62 throw err if err
5b3ef78 @jashkenas adding a doc:source Cake task to document CoffeeScript's internals
authored
63
64
a3e1693 @jashkenas 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 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
authored
69 task 'test', 'run the CoffeeScript language test suite', ->
b41afe7 @jashkenas removed ruby tests, and started the process of converting the CoffeeS…
authored
70 process.mixin require 'assert'
bedc005 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
authored
71 test_count: 0
72 start_time: new Date()
6a45d25 @jashkenas adding a test for parenthesized throws
authored
73 [original_ok, original_throws]: [ok, throws]
bedc005 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
authored
74 process.mixin {
6a45d25 @jashkenas 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 @jashkenas Adding a CoffeeScript equivalent to Rake/Make/Jake (Cake, naturally),…
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 @jashkenas updating to latest Node (0.1.3) API -- callbacks, not promises
authored
81 fs.readdir 'test', (err, files) ->
b41afe7 @jashkenas removed ruby tests, and started the process of converting the CoffeeS…
authored
82 for file in files
06b50ec @jashkenas unifying all of the server-side evaluation under CoffeeScript.run -- …
authored
83 fs.readFile 'test/' + file, (err, code) ->
1cf0326 @jashkenas unifying the CoffeeScript.compile and CoffeeScript.run apis to be the…
authored
84 CoffeeScript.run code, {source: file}
Something went wrong with that request. Please try again.