本文整理汇总了Python中Engine.findDependencies方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.findDependencies方法的具体用法?Python Engine.findDependencies怎么用?Python Engine.findDependencies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.findDependencies方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writeSingleSolution
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import findDependencies [as 别名]
def writeSingleSolution(configFileName, projectExt, solutionExt, solutionHeader, is2010):
basePath = os.path.dirname(configFileName)
try:
# Load the overall configuration from the .tcfg file.
generalDict, projectDict, solutionDict = Engine.readConfiguration(configFileName)
if len(solutionDict) == 0:
logging.debug('No solution section found, bailing out of solution generation (offending file %s)' % configFileName)
return 1
if 'dependencies' not in solutionDict:
solutionDict['dependencies'] = ''
if 'dependenciespaths' not in solutionDict:
solutionDict['dependenciespaths'] = ''
if 'additionalprojects' not in solutionDict:
solutionDict['additionalprojects'] = ''
if 'additionalprojectspaths' not in solutionDict:
solutionDict['additionalprojectspaths'] = ''
# Determine the output product path.
targetName = os.path.join( basePath, generalDict['name'] + solutionExt )
logging.debug( 'Now generating solution %s' % targetName )
baseProject = os.path.splitext(configFileName)[0] + projectExt
dependencies = Engine.findDependencies( basePath, solutionDict['dependencies'], solutionDict['dependenciespaths'], generalDict['platform'], lambda x: x+'.bdgcfg')
additionalProjects = Engine.findDependencies( basePath, solutionDict['additionalprojects'], solutionDict['additionalprojectspaths'], generalDict['platform'], lambda x: x+'.bdgcfg')
platform = projectDict['platform']
solution = writeSolution( basePath, [[baseProject] + [os.path.splitext(x)[0] + projectExt for x in dependencies]] + [[os.path.splitext(x)[0] + projectExt for x in additionalProjects]], platform, Engine.getConfigurations(projectDict))
# All is now done, try to write the target file to disk...
Engine.writeConfigFile( targetName, solutionHeader + '\n' + solution )
except SyntaxError, e:
logging.error( str(e) )
return 1
示例2: writeMultiSolution
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import findDependencies [as 别名]
def writeMultiSolution(targetSolutionName, candidates, projectExt, solutionHeader, is2010):
basePath = os.path.dirname(targetSolutionName)
projects = []
for item in map(os.path.abspath, candidates):
generalDict, projectDict, solutionDict = Engine.readConfiguration(item)
if len(solutionDict) == 0:
logging.debug('No solution section found, skipping (offending file %s)' % item)
continue
baseProject = os.path.splitext(item)[0] + projectExt
try:
dependencies = Engine.findDependencies( basePath, solutionDict['dependencies'], solutionDict['dependenciespaths'], generalDict['platform'], lambda x: x+'.bdgcfg' )
except KeyError:
dependencies = []
# HACK: The platform will just be the last one referenced.
platform = projectDict['platform']
projects.append( [baseProject] + [os.path.splitext(x)[0] + projectExt for x in dependencies] )
solution = writeSolution( basePath, projects, platform, Engine.getConfigurations(projectDict) )
# All is now done, try to write the target file to disk...
Engine.writeConfigFile( targetSolutionName, solutionHeader + '\n' + solution )
示例3: generateReferences
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import findDependencies [as 别名]
def generateReferences(basePath, platform, solutionDict):
"""
Goes through any of the dependencies, tries to resolve them and put the uuid references in the project file.
"""
try:
deps = solutionDict['dependencies']
depspath = solutionDict['dependenciespaths']
except KeyError:
return ''
linkLibraries = 0
try:
if int(solutionDict['linklibraries']):
linkLibraries = 1
except KeyError:
pass
libraryOptions = ''
if linkLibraries:
libraryOptions = '\t\t\t<LinkLibraryDependencies>true</LinkLibraryDependencies>\n'
dependencies = Engine.findDependencies( basePath, deps, depspath, platform, lambda x: x+'.bdgcfg' )
if len(dependencies) == 0:
return ''
result = '\t<ItemGroup>\n'
for bdgcfg in dependencies:
uuid = getGUIDByBdcfg(bdgcfg)
vcxproj = os.path.splitext(bdgcfg)[0] + '.vcxproj'
vcxproj = PathHelp.relative(basePath, vcxproj)
result += '\t\t<ProjectReference Include="%s">\n\t\t\t<Project>{%s}</Project>\n%s\t\t</ProjectReference>\n' % (vcxproj, uuid, libraryOptions)
result += '\t</ItemGroup>\n'
return result