[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] Makefile like tagets ant rules
From: |
Mantas |
Subject: |
[Fab-user] Makefile like tagets ant rules |
Date: |
Mon, 28 Feb 2011 18:08:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15pre) Gecko/20110207 Lightning/1.0b2 Shredder/3.1.9pre |
Hi,
tried to search in docs and find out if it is possible with fabfile.py
to do some thing similar to Makefile targets/rules.
In Makefile I can do:
bin/buildout: buildout.cfg
python bootstrap.py
These lines checks if ``bin/buildout`` is older than ``buildout.cfg`` or
``bin/buildout`` doesn't exists at all, and then runs ``python
bootstrap.py`` which generates ``bin/buildout``.
Next time, if ``bin/buildout`` exists and is newer than ``buildout.cfg``
nothing will be done.
In fabfile.py I imagine this could be implemented like this:
from fabric.api import local, make
def buildout(target, sources):
local('python %s' % sources[0])
def main():
make('all', {
'all': (None, ['bin/buildout']),
'bin/buildout': (buildout, ['buildout.cfg'])
})
--
Mantas aka sirex
__o /\
_ \<,_ -- launchpad.net/~sirex -- /\/ \
___(_)/_(_)_____________________________/_/ \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- [Fab-user] Makefile like tagets ant rules,
Mantas <=