本文整理汇总了C#中Microsoft.Build.Evaluation.SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Build.Evaluation.SetProperty方法的具体用法?C# Microsoft.Build.Evaluation.SetProperty怎么用?C# Microsoft.Build.Evaluation.SetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Evaluation
的用法示例。
在下文中一共展示了Microsoft.Build.Evaluation.SetProperty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreProcess
public void PreProcess(MSBuild.Project project) {
project.SetProperty("ProjectHome", ".");
project.SetProperty("WorkingDirectory", ".");
project.Xml.AddProperty("VisualStudioVersion", "11.0").Condition = "'$(VisualStudioVersion)' == ''";
project.Xml.AddProperty("PtvsTargetsFile", "$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\Python Tools\\Microsoft.PythonTools.targets");
var import1 = project.Xml.AddImport("$(PtvsTargetsFile)");
import1.Condition = "Exists($(PtvsTargetsFile))";
var import2 = project.Xml.AddImport("$(MSBuildToolsPath)\\Microsoft.Common.targets");
import2.Condition = "!Exists($(PtvsTargetsFile))";
}
示例2: PreProcess
public void PreProcess(MSBuild.Project project) {
if (project.ProjectFileLocation.File.EndsWith(".user", System.StringComparison.OrdinalIgnoreCase)) {
return;
}
// Node.js projects are flavored which enables a lot of our functionality, so
// setup our flavor.
project.SetProperty("ProjectTypeGuids", "{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}");
var prop = project.SetProperty("VisualStudioVersion", "14.0");
project.Xml.AddProperty("VisualStudioVersion", "14.0").Condition = "'$(VisualStudioVersion)' == ''";
project.Xml.AddProperty("VSToolsPath", "$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)").Condition = "'$(VSToolsPath)' == ''";
var import = project.Xml.AddImport("$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props");
import.Condition = "Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')";
project.Xml.AddImport("$(VSToolsPath)\\Node.js Tools\\Microsoft.NodejsTools.targets");
project.SetProperty("ProjectHome", ".");
project.SetProperty("WorkingDirectory", ".");
project.SetProperty("ProjectView", "ShowAllFiles");
project.SetProperty("OutputPath", ".");
}
示例3: Generate
public override void Generate(ProjectType projectType, MSBuild.Project project) {
project.SetProperty(Name, Value);
}
示例4: PreProcess
public void PreProcess(MSBuild.Project project)
{
if (project.ProjectFileLocation.File.EndsWith(".user", System.StringComparison.OrdinalIgnoreCase)) {
return;
}
project.SetProperty("ProjectTypeGuids", "{00251F00-BA30-4CE4-96A2-B8A1085F37AA};{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}");
project.SetProperty("VisualStudioVersion", "14.0");
project.Xml.AddProperty("VisualStudioVersion", "14.0").Condition = "'$(VisualStudioVersion)' == ''";
project.Xml.AddProperty("VSToolsPath", "$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)").Condition = "'$(VSToolsPath)' == ''";
project.Xml.AddImport("$(VSToolsPath)\\Node.js Tools\\Microsoft.NodejsUwp.targets");
project.SetProperty("ProjectHome", ".");
project.SetProperty("ProjectView", "ShowAllFiles");
project.SetProperty("OutputPath", ".");
project.SetProperty("AppContainerApplication", "true");
project.SetProperty("ApplicationType", "Windows Store");
project.SetProperty("OutpApplicationTypeRevisionutPath", "8.2");
project.SetProperty("AppxPackage", "true");
project.SetProperty("WindowsAppContainer", "true");
project.SetProperty("RemoteDebugEnabled", "true");
project.SetProperty("PlatformAware", "true");
project.SetProperty("AvailablePlatforms", "x86,x64,ARM");
// Add package.json
string jsonStr = "{\"name\": \"HelloWorld\",\"version\": \"0.0.0\",\"main\": \"server.js\"}";
string jsonPath = string.Format("{0}\\package.json", project.DirectoryPath);
using (FileStream fs = File.Create(jsonPath)) {
fs.Write(Encoding.ASCII.GetBytes(jsonStr), 0, jsonStr.Length);
}
ProjectItemGroupElement itemGroup = project.Xml.AddItemGroup();
itemGroup.AddItem("Content", jsonPath);
}
示例5: PreProcess
public void PreProcess(MSBuild.Project project) {
if (project.ProjectFileLocation.File.EndsWith(".user", System.StringComparison.OrdinalIgnoreCase)) {
return;
}
project.SetProperty("ProjectTypeGuids", "{00251F00-BA30-4CE4-96A2-B8A1085F37AA};{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}");
project.SetProperty("VisualStudioVersion", "14.0");
project.Xml.AddProperty("VisualStudioVersion", "14.0").Condition = "'$(VisualStudioVersion)' == ''";
project.Xml.AddProperty("VSToolsPath", "$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)").Condition = "'$(VSToolsPath)' == ''";
project.Xml.AddImport("$(VSToolsPath)\\Node.js Tools\\Microsoft.NodejsUwp.targets");
project.SetProperty("ProjectHome", ".");
project.SetProperty("ProjectView", "ShowAllFiles");
project.SetProperty("OutputPath", ".");
project.SetProperty("AppContainerApplication", "true");
project.SetProperty("ApplicationType", "Windows Store");
project.SetProperty("OutpApplicationTypeRevisionutPath", "8.2");
project.SetProperty("AppxPackage", "true");
project.SetProperty("WindowsAppContainer", "true");
project.SetProperty("RemoteDebugEnabled", "true");
project.SetProperty("PlatformAware", "true");
project.SetProperty("AvailablePlatforms", "x86,x64,ARM");
}
示例6: MakeTemplateReplacements
static internal void MakeTemplateReplacements(bool isAProject, bool creatingProject,
string rootNamespace, string sourceFileName, _BE.Project proj)
{
if (isAProject)
{
if (!string.IsNullOrEmpty(rootNamespace))
{
_BE.ProjectProperty prop;
string name;
name = "StartupObject";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace + ".", "$safeprojectname$."));
name = "DocumentationFile";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace + ".", "$safeprojectname$."));
name = "RootNamespace";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace, "$safeprojectname$"));
name = "AssemblyName";
prop = proj.GetProperty(name);
if (prop != null) proj.SetProperty(name, prop.UnevaluatedValue.Replace(rootNamespace, "$safeprojectname$"));
}
}
else
{
if (creatingProject == true)
{
//Exporting the entire project ... replace projectname only; this may not work as desired for Web projects,
//we don't have any so we don't care.
WordReplace(proj, rootNamespace, "$safeprojectname$");
}
else
{
//Exporting a single item from a project. Replace root name space (if given)
//and item name
if (!string.IsNullOrEmpty(rootNamespace))
{
WordReplace(proj, rootNamespace, "$rootnamespace$");
}
string itemName = Path.GetFileNameWithoutExtension(sourceFileName);
int iDotIndex = itemName.LastIndexOf(".");
if (iDotIndex != -1)
{
//This is intended to fix the foo.designer.vb case (GetFileNameWithoutExtension()
//returns foo.designer, and we want to replace just foo
itemName = itemName.Substring(0, iDotIndex);
}
WordReplace(proj, itemName, "$safeitemname$");
}
}
}
示例7: PreProcess
public void PreProcess(MSBuild.Project project) {
project.SetProperty("ProjectHome", ".");
project.SetProperty("WorkingDirectory", ".");
project.Xml.AddImport(Microsoft.PythonTools.Project.PythonProjectFactory.PtvsTargets);
}