+++ /dev/null
-#!/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
--- /dev/null
+#!/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
-//#exports PathingType StatInvariant
+//#exports PathingType.{PASSABLE,ZONE,BLOCKING,IRREGULAR}
+//#exports StatInvariant.{NONE,RATIO,FULL}
require('Y').Y.extend(exports, {
/// Pathing Constants ///