-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
54 lines (42 loc) · 1.03 KB
/
fabfile.py
File metadata and controls
54 lines (42 loc) · 1.03 KB
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
50
51
52
53
54
from os.path import join
import fabric.api as fab
PLOVR_FILE = 'plovr-eba786b34df9.jar'
PLOVR_PATH = join('dev', PLOVR_FILE)
@fab.task
def develop():
"""
Sets up a development environment.
"""
fab.local('[ -d dev ] || mkdir dev')
fab.local('[ -f {1} ] || wget -O {1} '
'https://plovr.googlecode.com/files/{0}'.format(
PLOVR_FILE, PLOVR_PATH))
fab.local('[ -d env ] || virtualenv env')
fab.local('./env/bin/pip install sphinx')
@fab.task
def js():
"""
Compile the JS source into the target JS file.
"""
fab.local('java -jar {0} build plovr-config.js'.format(PLOVR_PATH))
@fab.task
def html():
"""
Compile the example document.
"""
with fab.lcd('example'):
fab.local('make html')
@fab.task
def all():
"""
Compile both JS and HTML
"""
fab.execute(js)
fab.execute(html)
@fab.task
def clean():
"""
Remove compiled files
"""
fab.local('rm -rf example/_build')
fab.local('rm -rf foldable/static/foldable.js')