-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
49 lines (49 loc) · 1.83 KB
/
Cakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require('just-the-job') ->
@task 'all',
'Generate (but do not install) Sublime Text files, document, lint, compile and run',
[ 'generate-sublime-files', 'doc', 'lint', 'run' ]
@task 'clean',
'Get rid of things generated by building',
'rm -rf editor/Smith.tmTheme editor/Smith.tmLanguage node_modules compiler-js js doc'
@task 'compile',
'Compile all code in source',
['compile-compiler'],
'bin/smith'
# --no-nazi' --verbose --print-module-defines --just Main.smith --no-checks --no-meta
@task 'compile-compiler',
'Compile the compiler',
'node_modules/coffee-script/bin/coffee ' +
'--compile --bare --map --output compiler-js compiler-source'
@task 'doc',
'Document',
'node_modules/codo/bin/codo compiler-source --name Smith --title Smith'
@task 'info',
'Show info',
['compile-compiler'], ->
console.log require './compiler-js/run/info'
@task 'generate-sublime-files',
'Requires python3-yaml. Generates .tmLanguage and .tmTheme', '''
python3 -c """
import yaml, json, plistlib
for x in [ 'Theme', 'Language' ]:
outName = 'editor/Smith.tm' + x
inName = outName + '.yaml'
content = yaml.load(open(inName))
plistlib.writePlist(content, outName)
"""'''
@task 'install-sublime-files',
'Sublime Text 3 should be installed. Put sublime files in sublime user packages',
['generate-sublime-files']
'cp editor/Smith.tmLanguage editor/Smith.tmTheme ' +
'~/.config/sublime-text-3/Packages/User'
@task 'just-run-smith', 'node js/Standard/run.js'
@task 'lint',
'Check code formatting of coffeescript',
'node_modules/coffeelint/bin/coffeelint ' +
'--file compiler-source/coffeelint-config.json compiler-source'
@task 'run',
'Run the compiled program',
['compile', 'just-run-smith']
@task 'watch',
'Compile all modifications to source',
'bin/smith --in source --out js-smith --watch --copy-sources'