Trying out paver.
authordsc <david.schoonover@gmail.com>
Sat, 1 Jan 2011 08:16:22 +0000 (00:16 -0800)
committerdsc <david.schoonover@gmail.com>
Sat, 1 Jan 2011 08:16:22 +0000 (00:16 -0800)
build.sh [deleted file]
pavement.py [new file with mode: 0755]
src/tanks/constants.cjs

diff --git a/build.sh b/build.sh
deleted file mode 100755 (executable)
index dede342..0000000
--- a/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-echo "building tanks..."
-if test -z "$*"; then
-    echo "commonjs src/{Y,ezl,tanks} --script-tags > www/deps.html"
-    time commonjs src/{Y,ezl,tanks} --script-tags > www/deps.html
-else
-    echo "commonjs src/{Y,ezl,tanks} $*"
-    time commonjs src/{Y,ezl,tanks} $*
-fi
diff --git a/pavement.py b/pavement.py
new file mode 100755 (executable)
index 0000000..9f68f83
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env paver
+from paver.easy import *
+
+SRC_DIRS = [ path('src')/d for d in ('Y', 'ezl', 'tanks') ]
+
+
+def commonjs(*args, **kw):
+    "Runs commonjs module builder"
+    capture = False
+    kwargs = []
+    for k,v in kw.iteritems():
+        if k == 'capture':
+            capture = True
+            continue
+        kwargs.append('--%s' % k.replace('_', '-'))
+        if v is not True: kwargs.append(str(v))
+    return sh('commonjs %s' % ' '.join( SRC_DIRS + kwargs + list(args)), capture=capture)
+
+
+
+@task
+def clean():
+    "Cleans dep cache and build files"
+    commonjs(clean=True)
+
+@task
+def build():
+    "Builds the Tanks project"
+    tags = commonjs(script_tags=True, capture=True)
+    with path('www/deps.html').open('w') as f:
+        f.write(tags)
+
+auto = build
index d6eba26..f35f003 100644 (file)
@@ -1,4 +1,5 @@
-//#exports PathingType StatInvariant
+//#exports PathingType.{PASSABLE,ZONE,BLOCKING,IRREGULAR}
+//#exports StatInvariant.{NONE,RATIO,FULL}
 require('Y').Y.extend(exports, {
     
     /// Pathing Constants ///