本文整理汇总了Python中waflib.TaskGen.declare_chain方法的典型用法代码示例。如果您正苦于以下问题:Python TaskGen.declare_chain方法的具体用法?Python TaskGen.declare_chain怎么用?Python TaskGen.declare_chain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.TaskGen
的用法示例。
在下文中一共展示了TaskGen.declare_chain方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _build_pdf
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
def _build_pdf(ctx):
from waflib import TaskGen
TaskGen.declare_chain(
name = 'rst2latex',
rule = '${RST2LATEX} ${RST2LATEX_FLAGS} ${SRC} ${TGT}',
ext_in = '.rst',
ext_out = '.tex' )
TaskGen.declare_chain(
name = 'pdflatex',
rule = '${PDFLATEX} ${PDFLATEX_FLAGS} ${SRC}; ' * 2,
ext_in = '.tex',
ext_out = '.pdf',
shell = True )
ctx.env.RST2LATEX_FLAGS = [
'--config=' + ctx.srcnode.abspath() + '/DOCS/man/docutils.conf'
]
ctx.env.PDFLATEX_FLAGS = [
'--interaction=batchmode',
'--output-directory=DOCS/man/en/',
'--jobname=mpv'
]
ctx(source = 'DOCS/man/en/mpv.rst')
_add_rst_manual_dependencies(ctx)
ctx.install_files(ctx.env.DOCDIR, ['DOCS/man/en/mpv.pdf'])
示例2: _build_pdf
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
def _build_pdf(ctx):
from waflib import TaskGen
TaskGen.declare_chain(
name="rst2latex", rule="${RST2LATEX} ${RST2LATEX_FLAGS} ${SRC} ${TGT}", ext_in=".rst", ext_out=".tex"
)
TaskGen.declare_chain(
name="pdflatex", rule="${PDFLATEX} ${PDFLATEX_FLAGS} ${SRC}; " * 2, ext_in=".tex", ext_out=".pdf", shell=True
)
ctx.env.RST2LATEX_FLAGS = ["--config=" + ctx.srcnode.abspath() + "/DOCS/man/docutils.conf"]
ctx.env.PDFLATEX_FLAGS = ["--interaction=batchmode", "--output-directory=DOCS/man/en/", "--jobname=mpv"]
ctx(source="DOCS/man/en/mpv.rst")
_add_rst_manual_dependencies(ctx)
ctx.install_files(ctx.env.DOCDIR, ["DOCS/man/en/mpv.pdf"])
示例3:
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
bld = gen.bld
inc_nodes = gen.to_incnodes(Utils.to_list(getattr(gen, 'includes', [])) + env['INCLUDES'])
# FIXME the if-else construct will not work in python 2
cmd = (
[env.PROC] +
['SQLCHECK=SEMANTICS'] +
(['SYS_INCLUDE=(' + ','.join(env.PROC_INCLUDES) + ')']
if env.PROC_INCLUDES else []) +
['INCLUDE=(' + ','.join(
[i.bldpath() for i in inc_nodes]
) + ')'] +
['userid=' + env.PROC_CONNECTION] +
['INAME=' + tsk.inputs[0].bldpath()] +
['ONAME=' + tsk.outputs[0].bldpath()]
)
exec_env = {
'ORACLE_HOME': env.PROC_ORACLE,
'LD_LIBRARY_PATH': env.PROC_ORACLE + path.sep + 'lib',
}
if env.PROC_TNS_ADMIN:
exec_env['TNS_ADMIN'] = env.PROC_TNS_ADMIN
return tsk.exec_command(cmd, env=exec_env)
TaskGen.declare_chain(
name='proc',
rule=proc,
ext_in='.pc',
ext_out='.c',
)
示例4: check_cython_version
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
# Cython tool for waf
from waflib.Configure import conf
from waflib import TaskGen
TaskGen.declare_chain(
name = "cython",
rule = "${CYTHON} ${CYTHONFLAGS} ${CPPPATH_ST:INCPATHS} ${SRC} -o ${TGT}",
ext_in = ['.pyx'],
ext_out = ['.cxx'],
reentrant = True,
)
@conf
def check_cython_version(conf, minver):
conf.start_msg("Checking cython version")
minver = tuple(minver)
import re
version_re = re.compile(r'cython\s*version\s*(?P<major>\d*)\.(?P<minor>\d*)(?:\.(?P<micro>\d*))?', re.I).search
cmd = conf.cmd_to_list(conf.env['CYTHON'])
cmd = cmd + ['--version']
from waflib.Tools import fc_config
stdout, stderr = fc_config.getoutput(conf, cmd)
if stdout:
match = version_re(stdout)
else:
match = version_re(stderr)
if not match:
conf.fatal("cannot determine the Cython version")
cy_ver = [match.group('major'), match.group('minor')]
if match.group('micro'):
示例5: declare_chain
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
def declare_chain(self, *k, **kw):
"""
Wraps :py:func:`waflib.TaskGen.declare_chain` for convenience
"""
return TaskGen.declare_chain(*k, **kw)
示例6: proc
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
if not env.PROC_TNS_ADMIN:
env.PROC_TNS_ADMIN = cnf.options.tns_admin
if not env.PROC_CONNECTION:
env.PROC_CONNECTION = cnf.options.connection
cnf.find_program("proc", var="PROC", path_list=env.PROC_ORACLE + path.sep + "bin")
def proc(tsk):
env = tsk.env
gen = tsk.generator
bld = gen.bld
inc_nodes = gen.to_incnodes(Utils.to_list(getattr(gen, "includes", [])) + env["INCLUDES"])
# FIXME the if-else construct will not work in python 2
cmd = (
[env.PROC]
+ ["SQLCHECK=SEMANTICS"]
+ (["SYS_INCLUDE=(" + ",".join(env.PROC_INCLUDES) + ")"] if env.PROC_INCLUDES else [])
+ ["INCLUDE=(" + ",".join([i.bldpath() for i in inc_nodes]) + ")"]
+ ["userid=" + env.PROC_CONNECTION]
+ ["INAME=" + tsk.inputs[0].bldpath()]
+ ["ONAME=" + tsk.outputs[0].bldpath()]
)
exec_env = {"ORACLE_HOME": env.PROC_ORACLE, "LD_LIBRARY_PATH": env.PROC_ORACLE + path.sep + "lib"}
if env.PROC_TNS_ADMIN:
exec_env["TNS_ADMIN"] = env.PROC_TNS_ADMIN
return tsk.exec_command(cmd, env=exec_env)
TaskGen.declare_chain(name="proc", rule=proc, ext_in=".pc", ext_out=".c")
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:32,代码来源:proc.py
示例7: init_lua
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# WARNING! All changes made to this file will be lost!
from waflib import TaskGen,Utils
TaskGen.declare_chain(name='luac',rule='${LUAC} -s -o ${TGT} ${SRC}',ext_in='.lua',ext_out='.luac',reentrant=False)
def init_lua(self):
self.default_chmod=Utils.O755
def configure(conf):
conf.find_program('luac',var='LUAC')
TaskGen.feature('lua')(init_lua)
示例8: open
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
shaderFile = open(src, "r")
headerFile = open(tgt, "w")
headerFile.write("namespace oak {\n")
# deduce variable name from filename
split = os.path.splitext(os.path.basename(src))
variableName = split[0] + split[1].upper()[1:]
headerFile.write("const char *" + variableName + "String = \"")
for line in shaderFile:
# escape '\' and '"'
line = line.replace("\\", "\\\\")
line = line.replace("\"", "\\\"")
# content, with \n between lines
headerFile.write(line.strip() + "\\n")
headerFile.write("\";\n")
headerFile.write("} // oak namespace\n")
shaderFile.close()
headerFile.close()
return 0
from waflib import TaskGen
TaskGen.declare_chain(name = "vertex_shader", rule = build_shader, ext_in = ".vs", ext_out = ".vs.h")
TaskGen.declare_chain(name = "fragment_shader", rule = build_shader, ext_in = ".fs", ext_out = ".fs.h")
示例9: configure
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
from waflib import Logs
from waflib import TaskGen
TaskGen.declare_chain(
name='ppp',
rule='${PPP} ${SRC} ${TGT}',
shell=False,
ext_in='.pp',
ext_out='.cc',
reentrant=True,
)
def configure(ctx):
ctx.msg('Setting up Piccolo Pre-Processor', 1)
ctx.env['PPP'] = ctx.path.find_resource('util/ppp.py').abspath()
示例10: cxxtest_generate_suite
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
#includes = '.',
#source = cpp_src,
#**kw)
def cxxtest_generate_suite(tsk):
pathparts = tsk.inputs[0].abspath().split('/')
testIdx = (pathparts[::-1].index('test') + 1) * -1
nameparts = '/'.join(pathparts[testIdx:])
# adding the --include flag with the relative path to the test suite is
# required for waf to properly generate the dependency tree, otherwise it
# misses the dependency on the hpp file
tsk.exec_command('%s %s -o %s %s --include=%s' % (tsk.env['CXXTESTGEN'][0],
' '.join(tsk.env['CXXTESTFLAGS_suite']),
tsk.outputs[0].abspath(),
tsk.inputs[0].abspath(),
nameparts))
def cxxtest_generate_runner(tsk):
tsk.exec_command('%s %s -o %s' % (tsk.env['CXXTESTGEN'][0],
' '.join(tsk.env['CXXTESTFLAGS_runner']),
tsk.outputs[0].abspath()))
# Create a task generator that can make test suites
TaskGen.declare_chain(
name = 'cxxtest-gen',
rule = cxxtest_generate_suite,
shell = False,
reentrant = False,
ext_out = 'Test.cpp',
ext_in = 'Test.hpp')
示例11:
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
if conf.env.CDS_MIXED_SIGNAL:
conf.env.NCELAB_OPTIONS.extend(['-discipline', 'logic'])
if not conf.env.NCSIM_OPTIONS:
conf.env.NCSIM_OPTIONS = ['-64bit','-gui']
conf.find_program('ncsim',var='CDS_NCSIM')
conf.find_program('ncelab',var='CDS_NCELAB')
conf.find_program('ncvlog',var='CDS_NCVLOG')
conf.find_program('ncvhdl',var='CDS_NCVHDL')
TaskGen.declare_chain(
rule = '${CDS_NCVLOG} -cdslib ${CDS_LIB_PATH} -hdlvar ${CDS_HDLVAR_PATH} -logfile ${gen.get_logdir_node().abspath()+env.NCVLOG_LOGFILE+gen.name} ${NCVLOG_OPTIONS} -work ${WORKLIB} ${VERILOG_INC_DIRS} ${SRC} && echo "${TGT}" > ${TGT}',
ext_in = [ '.lib.src',],
ext_out = [ '.lib.src.out',],
reentrant = False,
scan = scan_verilog_task
)
TaskGen.declare_chain(
rule = '${CDS_NCVLOG} -cdslib ${CDS_LIB_PATH} -hdlvar ${CDS_HDLVAR_PATH} -logfile ${gen.get_logdir_node().abspath()+env.NCVLOG_LOGFILE+gen.name} ${NCVLOG_OPTIONS} -work ${WORKLIB} ${VERILOG_INC_DIRS} ${SRC} && echo "${TGT}" > ${TGT}',
ext_in = [ '.vp', ],
ext_out = [ '.vp.out', ],
reentrant = False,
scan = scan_verilog_task
)
TaskGen.declare_chain(
rule = '${CDS_NCVHDL} -cdslib ${CDS_LIB_PATH} -hdlvar ${CDS_HDLVAR_PATH} -logfile ${gen.get_logdir_node().abspath()+env.NCVHDL_LOGFILE+gen.name} ${NCVHDL_OPTIONS} -work ${WORKLIB} ${SRC}',
ext_in = ['.vhd'],
scan = vhdl_scanner,
reentrant = False,
示例12:
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Bernhard Schuster, 2016
from waflib import TaskGen
TaskGen.declare_chain(
name = 'gtkbuilder',
rule = 'gtk-builder-tool validate ${SRC}',
ext_in = ['.ui','.ui.in'],
reentrant = False,
color = 'CYAN',
)
示例13: configure
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
from waflib import TaskGen
import sys
TaskGen.declare_chain(
name='genpy',
rule='${PYTHON} ${SRC} ${GENPY_ARGS} > ${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']
conf.env['GENPY_ARGS'] = ''
return True
示例14: declare_chain
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
def declare_chain(self, *k, **kw):
"""alias for TaskGen.declare_chain (wrapper provided for convenience - avoid the import)"""
return TaskGen.declare_chain(*k, **kw)
示例15:
# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import declare_chain [as 别名]
# scan = verilog_scanner_task,
#)
#TaskGen.declare_chain(
# rule = '${MODEL_VLOG} -l ${VLOG_LOGFILE} ${VLOG_V_OPTIONS} -work ${WORKLIB} ${VERILOG_INC_DIRS} ${SRC} && echo "${TGT}" > ${TGT}',
# ext_in = ['.v' ],
# ext_out = ['.v.out' ],
# reentrant = False,
# scan = scan_verilog_task,
# after = 'vlibTask',
#)
TaskGen.declare_chain(
rule = '${MODEL_VLOG} -l ${VLOG_LOGFILE} ${VLOG_V_OPTIONS} -work ${gen.WORKLIB.abspath()} ${VERILOG_INC_DIRS} ${SRC} && echo "${TGT}" > ${TGT}',
ext_in = ['.lib.src' ],
ext_out = ['.lib.src.out' ],
reentrant = False,
scan = scan_verilog_task,
after = 'vlibTask',
)
TaskGen.declare_chain(
rule = '${MODEL_VLOG} -l ${VLOG_LOGFILE} ${VLOG_V_OPTIONS} -work ${gen.WORKLIB.abspath()} ${VERILOG_INC_DIRS} ${SRC} && echo "${TGT}" > ${TGT}',
ext_in = ['.vp', ],
ext_out = ['.vp.out', ],
reentrant = False,
scan = scan_verilog_task,
after = 'vlibTask',
)
TaskGen.declare_chain(
rule = '${MODEL_VCOM} -l ${gen.get_logdir_node().make_node(gen.env.VCOM_LOGFILE).abspath()+gen.name} ${VCOM_OPTIONS} -work ${gen.WORKLIB.abspath()} ${SRC}',