forked from Meiguro/simplyjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
40 lines (30 loc) · 1.01 KB
/
wscript
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
#
# This file is the default set of rules to compile a Pebble project.
#
# Feel free to customize this to your needs.
#
top = '.'
out = 'build'
def options(ctx):
ctx.load('pebble_sdk')
def configure(ctx):
ctx.load('pebble_sdk')
def build(ctx):
ctx.load('pebble_sdk')
ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
cflags=['-Wno-type-limits',
'-Wno-address'],
target='pebble-app.elf')
def package_javascript(task):
cmd = ['cat']
cmd.extend([x.abspath() for x in task.inputs])
cmd.extend(['>', task.outputs[0].abspath()])
task.exec_command(' '.join(cmd))
js_files = ctx.path.ant_glob('src/js/**/*.js')
if js_files:
ctx(rule=package_javascript,
source=js_files,
target=ctx.path.make_node('build/src/js/pebble-js-app.js'))
ctx.pbl_bundle(elf='pebble-app.elf',
js=ctx.path.ant_glob('build/src/js/**/*.js'))
# vim:filetype=python