Exemplo n.º 1
0
	def new_task_gen(self,*k,**kw):
		kw['bld']=self
		if len(k)==0:return TaskGen.task_gen(*k,**kw)
		cls_name=k[0]
		try:cls=TaskGen.task_gen.classes[cls_name]
		except KeyError:raise Utils.WscriptError('%s is not a valid task generator -> %s'%(cls_name,[x for x in TaskGen.task_gen.classes]))
		else:return cls(*k,**kw)
Exemplo n.º 2
0
	def test_missing_mapping(self):
		# no mapping for extension
		bld = self.make_bld()
		obj = TaskGen.task_gen(bld=bld)
		obj.source = self._source_file_path
		self._write_source("int main() {return 0;}")
		self.failUnlessRaises(Utils.WafError, obj.apply_core)
Exemplo n.º 3
0
	def new_task_gen(self, *k, **kw):
		if self.task_gen_cache_names:
			self.task_gen_cache_names = {}

		kw['bld'] = self
		if len(k) == 0:
			ret = TaskGen.task_gen(*k, **kw)
		else:
			cls_name = k[0]

			try: cls = TaskGen.task_gen.classes[cls_name]
			except KeyError: raise Utils.WscriptError('{0!s} is not a valid task generator -> {1!s}'.format(cls_name, [x for x in TaskGen.task_gen.classes]))
			ret = cls(*k, **kw)
		return ret
Exemplo n.º 4
0
	def test_white_no_sources_specified(self):
		# white-box test: no sources were specified

		# add apply_verif to taskgen
		import Tools.ccroot

		Options.commands['configure'] = False
		env = Environment.Environment()
		bld = Build.bld = Build.BuildContext()
		bld.set_env('default', env)
		blddir = os.path.join(self._test_dir_root, 'b')
		bld.load_dirs(self._test_dir_root, blddir)

		obj = TaskGen.task_gen(bld=bld)
		# TODO: make sure it works with apply_core too
		self.failUnlessRaises(Utils.WafError, obj.apply_verif)
Exemplo n.º 5
0
def edje(self):
	self.default_chmod=0664
	bld_rule = '${EDJE} '+'-id '+self.cwd+' -fd '+self.cwd+' ${SRC} ${TGT}'
	TaskGen.declare_chain(name='edje_cc', rule=bld_rule, ext_in='.edc', ext_out='.edj', reentrant=0, install=None)
Exemplo n.º 6
0
def cscan(self):

	txt = self.inputs[0].read(self.env)
	mods = []
	for m in re_cyt.finditer(txt):
		mods.append(m.group(1))

	incs = getattr(self.generator, 'cython_includes', [])
	incs = [self.generator.path.find_dir(x) for x in incs]
	incs.append(self.inputs[0].parent)

	found = []
	missing = []
	for x in mods:
		for y in incs:
			k = y.find_resource(x + '.pxd')
			if k:
				found.append(k)
				break
		else:
			missing.append(x)

	return (found, missing)

TaskGen.declare_chain(name='cython', rule='${CYTHON} ${CYTHONFLAGS} ${SRC} -o ${TGT}', ext_in=['.pyx'], ext_out=['.c'], scan=cscan)

def detect(conf):
	conf.find_program('cython', var='CYTHON', mandatory=True)

Exemplo n.º 7
0
		if copy:
			copy.close()
	try:
		os.remove(src_file)
	except OSError:
		pass
	except IOError:
		pass
	else:
		os.rename(copy_file, src_file)
	return 0

f = TaskGen.declare_chain(
		name = 'cythonc',
		action = cython_run,
		ext_in = '.pyx',
		ext_out = '.c',
		reentrant = True,
		after='apply_cython_extra',
		scan=scan_deps)

@TaskGen.feature('cython')
@TaskGen.before('apply_core')
def default_cython(self):
	Utils.def_attrs(self,
			cython_includes = '',
			no_timestamp = False)

@TaskGen.feature('cython')
@TaskGen.after('apply_core')
def apply_cython_incpaths(self):
	"""Used to build _CYTHONINCFLAGS, and the dependencies scanner (when ready).
Exemplo n.º 8
0
Arquivo: d.py Projeto: patrou/node
def init_d(self):
    for x in d_params:
        setattr(self, x, getattr(self, x, d_params[x]))


class d_taskgen(TaskGen.task_gen):
    def __init__(self, *k, **kw):
        TaskGen.task_gen.__init__(self, *k, **kw)

        # COMPAT
        if len(k) > 1:
            self.features.append('d' + k[1])


# okay, we borrow a few methods from ccroot
TaskGen.bind_feature('d', D_METHS)


@feature('d')
@before('apply_d_libs')
def init_d(self):
    Utils.def_attrs(
        self,
        dflags='',
        importpaths='',
        libs='',
        libpaths='',
        uselib='',
        uselib_local='',
        generate_headers=
        False,  # set to true if you want .di files as well as .o
Exemplo n.º 9
0
import Task
import TaskGen
from TaskGen import extension
import sys

TaskGen.declare_chain(
		name='genpy',
		rule='${PYTHON} ${SRC} > ${TGT}',
		reentrant=True,
		color='BLUE',
		ext_in='.genpy',
		ext_out='.c',
		before='c')

def configure(conf):
    conf.env['PYTHON'] = sys.executable
    conf.env['GENPY_EXT'] = ['.genpy']
    return True
Exemplo n.º 10
0
 def __call__(self, *k, **kw):
     kw['bld'] = self
     return TaskGen.task_gen(*k, **kw)
Exemplo n.º 11
0
 def test_validate_find_srcs_absolute(self):
     # find sources in dirs cannot get absoulte paths
     bld = self.make_bld()
     obj = TaskGen.task_gen(bld=bld)
     self.failUnlessRaises(Utils.WafError, obj.find_sources_in_dirs,
                           self._test_dir_root)
			fail=True
			ret=""
		else:
			pass
		stats=getattr(self.generator.bld,'utest_results',[])
		stats.append((filename,fail,ret))
		self.generator.bld.utest_results=stats
		testlock.release()
	except Exception,e:
		print e
cls=Task.task_type_from_func('utest',func=exec_test,color='RED',ext_in='.bin')
old=cls.runnable_status
def test_status(self):
	if getattr(Options.options,'all_tests',False):
		return RUN_ME
	return old(self)
cls.runnable_status=test_status
cls.quiet=1
def summary(bld):
	lst=getattr(bld,'utest_results',[])
	if lst:
		Utils.pprint('CYAN','execution summary')
		for(f,fail,ret)in lst:
			col=fail and'RED'or'GREEN'
			Utils.pprint(col,(fail and'FAIL'or'ok')+" "+f)
def set_options(opt):
	opt.add_option('--alltests',action='store_true',default=False,help='Exec all unit tests',dest='all_tests')

TaskGen.feature('test')(make_test)
TaskGen.after('apply_link')(make_test)
Exemplo n.º 13
0
#!/usr/bin/env python
# encoding: utf-8
# Sebastian Schlingmann, 2008
# Thomas Nagy, 2008 (ita)

import TaskGen
from TaskGen import taskgen, feature
from Constants import *

TaskGen.declare_chain(
    name="luac",
    rule="${LUAC} -s -o ${TGT} ${SRC}",
    ext_in=".lua",
    ext_out=".luac",
    reentrant=0,
    install="LUADIR",  # env variable
)


@taskgen
@feature("lua")
def init_lua(self):
    self.default_chmod = O755


def detect(conf):
    conf.find_program("luac", var="LUAC", mandatory=True)
Exemplo n.º 14
0
			if not nd: nd = x.find_resource(name+'.ml')
			if nd:
				found_lst.append(nd)
				break
		else:
			raw_lst.append(name)

	return (found_lst, raw_lst)

native_lst=['native', 'all', 'c_object']
bytecode_lst=['bytecode', 'all']
class ocaml_taskgen(TaskGen.task_gen):
	def __init__(self, *k, **kw):
		TaskGen.task_gen.__init__(self, *k, **kw)

TaskGen.bind_feature('ocaml', 'apply_core')

@taskgen
@feature('ocaml')
def init_ml(self):
	Utils.def_attrs(self,
		type = 'all',
		incpaths_lst = [],
		bld_incpaths_lst = [],
		mlltasks = [],
		mlytasks = [],
		mlitasks = [],
		native_tasks = [],
		bytecode_tasks = [],
		linktasks = [],
		bytecode_env = None,
Exemplo n.º 15
0
# encoding: utf-8

import TaskGen


def decide_ext(self, node):
    c_ext = ".tab.c"
    if node.name.endswith(".yc"):
        c_ext = ".tab.cc"
    if "-d" in self.env["BISONFLAGS"]:
        return [c_ext, c_ext.replace("c", "h")]
    else:
        return c_ext


TaskGen.declare_chain(
    name="bison",
    action="cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}",
    ext_in=".y .yc .yy",
    decider=decide_ext,
    before="cc cxx",
)


def detect(conf):
    bison = conf.find_program("bison", var="BISON")
    if not bison:
        conf.fatal("bison was not found")
    v = conf.env
    v["BISONFLAGS"] = "-d"
Exemplo n.º 16
0
#!/usr/bin/env python
# encoding: utf-8
# Sebastian Schlingmann, 2008
# Thomas Nagy, 2008 (ita)

import TaskGen
from TaskGen import taskgen, feature
from Constants import *

TaskGen.declare_chain(
    name='luac',
    rule='${LUAC} -s -o ${TGT} ${SRC}',
    ext_in='.lua',
    ext_out='.luac',
    reentrant=0,
    install='LUADIR',  # env variable
)


@feature('lua')
def init_lua(self):
    self.default_chmod = O755


def detect(conf):
    conf.find_program('luac', var='LUAC', mandatory=True)
Exemplo n.º 17
0
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
def decide_ext(self,node):
	c_ext='.tab.c'
	if node.name.endswith('.yc'):c_ext='.tab.cc'
	if'-d'in self.env['BISONFLAGS']:
		return[c_ext,c_ext.replace('c','h')]
	else:
		return c_ext
TaskGen.declare_chain(name='bison',rule='cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}',ext_in='.y .yc .yy',decider=decide_ext,before='cc cxx',)
def detect(conf):
	bison=conf.find_program('bison',var='BISON',mandatory=True)
	v=conf.env
	v['BISONFLAGS']='-d'

Exemplo n.º 18
0
 def __call__(self, *k, **kw):
     if self.task_gen_cache_names:
         self.task_gen_cache_names = {}
     kw["bld"] = self
     return TaskGen.task_gen(*k, **kw)
Exemplo n.º 19
0
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy, 2006-2008

"Flex processing"

import TaskGen

def decide_ext(self, node):
	if 'cxx' in self.features: return '.lex.cc'
	else: return '.lex.c'

TaskGen.declare_chain(
	name = 'flex',
	rule = '${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',
	ext_in = '.l',
	ext_out = '.c .cxx',
	decider = decide_ext,
)

def detect(conf):
	conf.find_program('flex', var='FLEX', mandatory=True)
	conf.env['FLEXFLAGS'] = ''

Exemplo n.º 20
0
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006

"Bison processing"

import TaskGen

def decide_ext(self, node):
	c_ext = '.tab.c'
	if node.name.endswith('.yc'): c_ext = '.tab.cc'
	if '-d' in self.env['BISONFLAGS']:
		return [c_ext, c_ext.replace('c', 'h')]
	else:
		return c_ext

TaskGen.declare_chain(
	name = 'bison',
	rule = 'cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}',
	ext_in = '.y .yc .yy',
	decider = decide_ext,
	before = 'cc cxx',
)

def detect(conf):
	bison = conf.find_program('bison', var='BISON', mandatory=True)
	v = conf.env
	v['BISONFLAGS'] = '-d'

Exemplo n.º 21
0
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
def decide_ext(self,node):
	if'cxx'in self.features:return'.lex.cc'
	else:return'.lex.c'
TaskGen.declare_chain(name='flex',action='${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',ext_in='.l',decider=decide_ext,before='cc cxx',)
def detect(conf):
	flex=conf.find_program('flex',var='FLEX')
	if not flex:conf.fatal("flex was not found")
	v=conf.env
	v['FLEXFLAGS']=''

Exemplo n.º 22
0
	def test_validate_find_srcs_exts(self):
		# find sources in dirs 'exts' must be a list
		bld = self.make_bld()
		obj = TaskGen.task_gen(bld=bld)
		self.failUnlessRaises(Utils.WafError, obj.find_sources_in_dirs, 'a', 'exts=b')
Exemplo n.º 23
0
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy, 2006-2008

"Flex processing"

import TaskGen


def decide_ext(self, node):
    if 'cxx' in self.features: return '.lex.cc'
    else: return '.lex.c'


TaskGen.declare_chain(
    name='flex',
    rule='${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',
    ext_in='.l',
    ext_out='.c .cxx',
    decider=decide_ext,
)


def detect(conf):
    conf.find_program('flex', var='FLEX', mandatory=True)
    conf.env['FLEXFLAGS'] = ''
Exemplo n.º 24
0
    for m in re_cyt.finditer(txt):
        mods.append(m.group(1))

    incs = getattr(self.generator, 'cython_includes', [])
    incs = [self.generator.path.find_dir(x) for x in incs]
    incs.append(self.inputs[0].parent)

    found = []
    missing = []
    for x in mods:
        for y in incs:
            k = y.find_resource(x + '.pxd')
            if k:
                found.append(k)
                break
        else:
            missing.append(x)

    return (found, missing)


TaskGen.declare_chain(name='cython',
                      rule='${CYTHON} ${CYTHONFLAGS} ${SRC} -o ${TGT}',
                      ext_in=['.pyx'],
                      ext_out=['.c'],
                      scan=cscan)


def detect(conf):
    conf.find_program('cython', var='CYTHON', mandatory=True)
Exemplo n.º 25
0
	def test_validate_find_srcs_absolute(self):
		# find sources in dirs cannot get absoulte paths
		bld = self.make_bld()
		obj = TaskGen.task_gen(bld=bld)
		self.failUnlessRaises(Utils.WafError, obj.find_sources_in_dirs, self._test_dir_root)
Exemplo n.º 26
0
# encoding: utf-8

# inkscape-convert - Convert svg files to pdf
# Copyright (C) 2009 Michael Budde

import TaskGen

TaskGen.declare_chain(
    name='inkscape-svg-convert',
    action='${INKSCAPE} ${INKSCAPEFLAGS} --export-pdf=${TGT} ${SRC}',
    ext_in='.svg',
    ext_out='.pdf',
    reentrant=False)

def detect(conf):
    conf.find_program('inkscape', var='INKSCAPE', mandatory=True)
    conf.env['INKSCAPEFLAGS'] = ''
Exemplo n.º 27
0
 def __call__(self, *k, **kw):
     if self.task_gen_cache_names:
         self.task_gen_cache_names = {}
     kw['bld'] = self
     return TaskGen.task_gen(*k, **kw)
Exemplo n.º 28
0
	task = self.create_task('fortranpp')
	task.inputs = [node]
	task.outputs = [node.change_ext(obj_ext)]
	self.compiled_tasks.append(task)
	return task

#################################################### Task generators

# we reuse a lot of code from ccroot.py

FORTRAN = 'init_f default_cc apply_incpaths apply_defines_cc apply_type_vars apply_lib_vars add_extra_flags apply_obj_vars_cc'.split()
FPROGRAM = 'apply_verif vars_target_cprogram install_target_cstaticlib apply_objdeps apply_obj_vars '.split()
FSHLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib install_target_cshlib apply_objdeps apply_obj_vars apply_vnum'.split()
FSTATICLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib apply_objdeps apply_obj_vars '.split()

TaskGen.bind_feature('fortran', FORTRAN)
TaskGen.bind_feature('fprogram', FPROGRAM)
TaskGen.bind_feature('fshlib', FSHLIB)
TaskGen.bind_feature('fstaticlib', FSTATICLIB)

TaskGen.declare_order('init_f', 'apply_lib_vars')
TaskGen.declare_order('default_cc', 'apply_core')

@feature('fortran')
@before('apply_type_vars')
@after('default_cc')
def init_f(self):
	# PATH flags:
	#	- CPPPATH: same as C, for pre-processed fortran files
	#	- FORTRANMODPATH: where to look for modules (.mod)
	#	- FORTRANMODOUTPATH: where to *put* modules (.mod)
Exemplo n.º 29
0
def init_d(self):
    for x in d_params:
        setattr(self, x, getattr(self, x, d_params[x]))


class d_taskgen(TaskGen.task_gen):
    def __init__(self, *k, **kw):
        TaskGen.task_gen.__init__(self, *k, **kw)

        # COMPAT
        if len(k) > 1:
            self.features.append("d" + k[1])


# okay, we borrow a few methods from ccroot
TaskGen.bind_feature("d", D_METHS)


@feature("d")
@before("apply_d_libs")
def init_d(self):
    Utils.def_attrs(
        self,
        dflags="",
        importpaths="",
        libs="",
        libpaths="",
        uselib="",
        uselib_local="",
        generate_headers=False,  # set to true if you want .di files as well as .o
        compiled_tasks=[],
Exemplo n.º 30
0
#!/usr/bin/env python
# encoding: utf-8
# Ali Sabil, 2007

import TaskGen

TaskGen.declare_chain(
    name='gob2',
    rule='${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',
    ext_in='.gob',
    ext_out='.c')


def detect(conf):
    gob2 = conf.find_program('gob2', var='GOB2', mandatory=True)
    conf.env['GOB2'] = gob2
    conf.env['GOB2FLAGS'] = ''
Exemplo n.º 31
0
    "FRAMEWORK",
    "FRAMEWORKPATH",
    "STATICLIB",
    "LIB",
    "LIBPATH",
    "LINKFLAGS",
    "RPATH",
    "CCFLAGS",
    "CPPPATH",
    "CPPFLAGS",
    "CCDEFINES",
]

EXT_CC = [".c"]

TaskGen.bind_feature("cc", ["apply_core"])

g_cc_type_vars = ["CCFLAGS", "LINKFLAGS"]


class cc_taskgen(ccroot.ccroot_abstract):
    pass


@feature("cc")
@before("apply_type_vars")
@after("default_cc")
def init_cc(self):
    self.p_flag_vars = set(self.p_flag_vars).union(g_cc_flag_vars)
    self.p_type_vars = set(self.p_type_vars).union(g_cc_type_vars)
Exemplo n.º 32
0
	def __call__(self, *k, **kw):
		kw['bld'] = self
		return TaskGen.task_gen(*k, **kw)
Exemplo n.º 33
0
Arquivo: cc.py Projeto: johnsen/jack2
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import TaskGen,Build,Utils,Task
from Logs import debug
import ccroot
from TaskGen import feature,before,extension,after
g_cc_flag_vars=['CCDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS','RPATH','CCFLAGS','CPPPATH','CPPFLAGS','CCDEFINES']
EXT_CC=['.c']
TaskGen.bind_feature('cc',['apply_core'])
g_cc_type_vars=['CCFLAGS','LINKFLAGS']
class cc_taskgen(ccroot.ccroot_abstract):
	pass
def init_cc(self):
	self.p_flag_vars=set(self.p_flag_vars).union(g_cc_flag_vars)
	self.p_type_vars=set(self.p_type_vars).union(g_cc_type_vars)
	if not self.env['CC_NAME']:
		raise Utils.WafError("At least one compiler (gcc, ..) must be selected")
def apply_obj_vars_cc(self):
	env=self.env
	app=env.append_unique
	cpppath_st=env['CPPPATH_ST']
	for i in env['INC_PATHS']:
		app('_CCINCFLAGS',cpppath_st%i.bldpath(env))
		app('_CCINCFLAGS',cpppath_st%i.srcpath(env))
	for i in env['CPPPATH']:
		app('_CCINCFLAGS',cpppath_st%i)
	app('_CCINCFLAGS',cpppath_st%'.')
	app('_CCINCFLAGS',cpppath_st%env.variant())
	tmpnode=self.path
Exemplo n.º 34
0
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)

"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"

import TaskGen

TaskGen.declare_chain(
	name = 'dang',
	action = '${DANG} ${SRC} > ${TGT}',
	ext_in = '.coin',
	ext_out = '.cpp',
	before = 'cxx cc',
)

def detect(conf):
	dang = conf.find_program('cat', var='DANG', mandatory=True)

Exemplo n.º 35
0
Arquivo: d.py Projeto: CodeMonk/fish
@feature('d')
@before('apply_type_vars')
def init_d(self):
	for x in d_params:
		setattr(self, x, getattr(self, x, d_params[x]))

class d_taskgen(TaskGen.task_gen):
	def __init__(self, *k, **kw):
		TaskGen.task_gen.__init__(self, *k, **kw)

		# COMPAT
		if len(k) > 1:
			self.features.append('d' + k[1])

# okay, we borrow a few methods from ccroot
TaskGen.bind_feature('d', D_METHS)

@feature('d')
@before('apply_d_libs')
def init_d(self):
	Utils.def_attrs(self,
		dflags='',
		importpaths='',
		libs='',
		libpaths='',
		uselib='',
		uselib_local='',
		generate_headers=False, # set to true if you want .di files as well as .o
		compiled_tasks=[],
		add_objects=[],
		link_task=None)
Exemplo n.º 36
0
@after('apply_bundle')
@feature('pyext')
def pyext_shlib_ext(self):
	# override shlib_PATTERN set by the osx module
	self.env['shlib_PATTERN'] = self.env['pyext_PATTERN']


@taskgen
@before('apply_incpaths')
@feature('pyembed')
def init_pyembed(self):
	self.uselib = self.to_list(getattr(self, 'uselib', ''))
	if not 'PYEMBED' in self.uselib:
		self.uselib.append('PYEMBED')

TaskGen.bind_feature('py', ['apply_core'])

@extension(EXT_PY)
def process_py(self, node):
	if Options.is_install and self.install_path:
		if not hasattr(self, '_py_installed_files'):
			self._py_installed_files = []
		installed_files = Build.bld.install_files(
					self.install_path,
					node.abspath(self.env),
					self.env,
					self.chmod)
		self._py_installed_files.extend(installed_files)

@feature('py')
@after('install')
Exemplo n.º 37
0
#!/usr/bin/env python
# encoding: utf-8
# Ali Sabil, 2007

import TaskGen

TaskGen.declare_chain(
	name = 'gob2',
	rule = '${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',
	ext_in = '.gob',
	ext_out = '.c'
)

def detect(conf):
	gob2 = conf.find_program('gob2', var='GOB2', mandatory=True)
	conf.env['GOB2'] = gob2
	conf.env['GOB2FLAGS'] = ''

Exemplo n.º 38
0
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)

"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"

import TaskGen

TaskGen.declare_chain(
	name = 'copy',
	action = '${COPY} ${SRC} ${TGT}',
	ext_in = '.coin',
	ext_out = '.cpp',
	reentrant = False
)

def detect(conf):
	#dang = conf.find_program('cat', var='DANG')
	#if not dang: conf.fatal('cannot find the program "cat"')
	import os
	conf.env['COPY'] = os.getcwd() + os.sep + "cp.py"

Exemplo n.º 39
0
#! /usr/bin/env python
# encoding: utf-8

import TaskGen
from TaskGen import taskgen,feature
from Constants import*
TaskGen.declare_chain(name='luac',rule='${LUAC} -s -o ${TGT} ${SRC}',ext_in='.lua',ext_out='.luac',reentrant=0,install='LUADIR',)
def init_lua(self):
	self.default_chmod=O755
def detect(conf):
	conf.find_program('luac',var='LUAC',mandatory=True)

feature('lua')(init_lua)
Exemplo n.º 40
0
 def test_validate_find_srcs_exts(self):
     # find sources in dirs 'exts' must be a list
     bld = self.make_bld()
     obj = TaskGen.task_gen(bld=bld)
     self.failUnlessRaises(Utils.WafError, obj.find_sources_in_dirs, 'a',
                           'exts=b')