本文整理汇总了C#中VCConfiguration.Evaluate方法的典型用法代码示例。如果您正苦于以下问题:C# VCConfiguration.Evaluate方法的具体用法?C# VCConfiguration.Evaluate怎么用?C# VCConfiguration.Evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VCConfiguration
的用法示例。
在下文中一共展示了VCConfiguration.Evaluate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parseLinkerSettings_LibraryPath
/// <summary>
/// Finds the library path for the configuration passed in.
/// </summary>
private void parseLinkerSettings_LibraryPath(VCConfiguration vcConfiguration, VCLinkerTool linkerTool, ProjectConfigurationInfo_CPP configurationInfo)
{
// We:
// 1. Read the additional library paths (which are in a semi-colon-delimited string)
// 2. Split it into separate paths
// 3. Resolve any symbols
// 4. Make sure all paths are relative to the project root folder
// 1 & 2...
string strAdditionalLibraryDirectories = Utils.call(() => (linkerTool.AdditionalLibraryDirectories));
if (strAdditionalLibraryDirectories == null)
{
return;
}
List<string> additionalLibraryDirectories = Utils.split(strAdditionalLibraryDirectories, ';', ',');
foreach (string additionalLibraryDirectory in additionalLibraryDirectories)
{
// The string may be quoted. We need to remove the quotes...
string unquotedLibraryDirectory = additionalLibraryDirectory.Trim('"');
if (unquotedLibraryDirectory == "")
{
continue;
}
// 3 & 4...
string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(unquotedLibraryDirectory)));
if (resolvedPath != "")
{
string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
configurationInfo.addLibraryPath(relativePath);
}
}
}
示例2: parseConfiguration_Folder
/// <summary>
/// Gets a folder name from the function passed in, and returns it as a path
/// relative to the project root folder.
/// </summary>
private string parseConfiguration_Folder(VCConfiguration vcConfiguration, Func<string> folderFn)
{
// We get the folder name, which may contain symbols e.g. £(ConfgurationName)...
string pathWithSymbols = Utils.call(folderFn);
// We resolve the symbols...
string evaluatedPath = Utils.call(() => (vcConfiguration.Evaluate(pathWithSymbols)));
// If we ave an absolute path, we convert it to a relative one...
string relativePath = evaluatedPath;
if (Path.IsPathRooted(evaluatedPath))
{
relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, evaluatedPath);
}
return relativePath;
}
示例3: ReplaceMacros
public string ReplaceMacros(string s, VCConfiguration cfg = null)
{
if (cfg == null)
cfg = config;
//! Replace macros
foreach (string macro in ProjectMacros.Collection)
{
string result = cfg.Evaluate(macro);
if (result != null)
s = s.Replace(macro, result, StringComparison.CurrentCultureIgnoreCase);
}
return s;
}
示例4: GetPCH
public static string GetPCH(VCProject project, VCConfiguration config)
{
string pch = "";
IVCCollection tools = config.Tools as IVCCollection;
VCCLCompilerTool vctool = tools.Item("VCCLCompilerTool") as VCCLCompilerTool;
if (vctool != null)
{
pch = vctool.PrecompiledHeaderThrough;
}
if (pch != "")
{
VCFile file = Connect.GetVCFile(project, config.Evaluate(pch));
if (file != null)
{
pch = file.Name;
}
}
return pch;
}
示例5: parseLinkerSettings_LibraryPath
/// <summary>
/// Finds the library path for the configuration passed in.
/// </summary>
private void parseLinkerSettings_LibraryPath(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
{
// Get the library paths across all property sheets
List<string> libraryPaths = ToolPropertyCollector.Get(vcConfiguration, "VCLinkerTool", (tool) =>
{
var linkerTool = tool as VCLinkerTool;
string str = Utils.call(() => (linkerTool.AdditionalLibraryDirectories));
if (str == null)
return null;
// The string may be quoted. We need to remove the quotes.
// (TODO: We might need to handle quotes in a smarter manner.)
return Utils.split(str, ';').Select(s => s.Trim('"')).ToList();
} );
// Process the library paths
foreach (string libraryPath in libraryPaths)
{
if (libraryPath == "")
continue;
string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(libraryPath)));
if (resolvedPath == "")
continue;
string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
configurationInfo.addLibraryPath(relativePath);
}
}
示例6: parseCompilerSettings_IncludePath
/// <summary>
/// Finds the collection of include paths for the configuration passed in.
/// </summary>
private void parseCompilerSettings_IncludePath(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
{
List<string> paths = ToolPropertyCollector.Get(vcConfiguration, "VCCLCompilerTool", (tool) =>
{
var compilerTool = tool as VCCLCompilerTool;
string strAdditionalIncludeDirectories = Utils.call(() => (compilerTool.AdditionalIncludeDirectories));
if (strAdditionalIncludeDirectories == null)
return null;
// The string may be quoted. We need to remove the quotes.
// (TODO: We might need to handle quotes in a smarter manner.)
return Utils.split(strAdditionalIncludeDirectories, ';', ',').Select(s => s.Trim('"')).ToList();
} );
foreach (var path in paths)
{
// Resolve variables
string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(path)));
if (resolvedPath != "")
{
// Make sure all paths are relative to the project root folder
string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
configurationInfo.addIncludePath(relativePath);
}
}
}