From: dsc Date: Sat, 1 Jan 2011 08:16:22 +0000 (-0800) Subject: Trying out paver. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=714b49fc469c74b3406afe697c4e3d39c8f4b11d;p=tanks.git Trying out paver. --- diff --git a/build.sh b/build.sh deleted file mode 100755 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 index 0000000..9f68f83 --- /dev/null +++ b/pavement.py @@ -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 diff --git a/src/tanks/constants.cjs b/src/tanks/constants.cjs index d6eba26..f35f003 100644 --- a/src/tanks/constants.cjs +++ b/src/tanks/constants.cjs @@ -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 ///