void UpdateProjects(List <string> projectList) { foreach (string projectPath in projectList) { MsbuildProject msbp = new MsbuildProject(projectPath); if (msbp.IsProjectTestType) { if (ExcludeFromTestExecution == true) { msbp.AddUpdateProperty(PROPNAME_SKIP_TEST_EXECUTION, "true"); } else { msbp.AddUpdateProperty(PROPNAME_SKIP_TEST_EXECUTION, "false"); } } if (ExcludeFromBuild == true) { msbp.AddUpdateProperty(PROPNAME_SKIP_BUILD, "true"); } else { msbp.AddUpdateProperty(PROPNAME_SKIP_BUILD, "false"); } } }
public void UpdateApiTag() { foreach (dynamic asmInfoItem in AssemblyInfoList) { string apiTag = GetApiFromSdkInfo(asmInfoItem.AssemblyFilePath); if (!File.Exists(asmInfoItem.AzPropFilePath)) { MsbuildProject buildProj = new MsbuildProject(); buildProj.CreateAzPropsfile(asmInfoItem.AzPropFilePath); } MsbuildProject msbProj = new MsbuildProject(asmInfoItem.AzPropFilePath); msbProj.AddUpdateProperty(API_TAG_PROPERTYNAME, apiTag); } }
void UpdatePropertyValue(MsbuildProject proj, string propertyName, bool newPropValue) { string existingVal = proj.GetPropertyValue(propertyName); if (string.IsNullOrWhiteSpace(existingVal) && newPropValue == false) { TaskLogger.LogInfo(MessageImportance.Low, "'{0}' property is not currently set and the new value is '{1}'. No changes will be made", propertyName, newPropValue.ToString()); } else if (existingVal.Equals(newPropValue.ToString(), StringComparison.OrdinalIgnoreCase)) { TaskLogger.LogInfo(MessageImportance.Low, "'{0}' current value is '{1}'. New value requested is '{2}'", propertyName, existingVal, newPropValue.ToString()); } else if (!existingVal.Equals(newPropValue.ToString(), StringComparison.OrdinalIgnoreCase)) { TaskLogger.LogInfo(MessageImportance.Low, "{0} current value:'{1}', new value:'{2}'", propertyName, existingVal, newPropValue.ToString()); proj.AddUpdateProperty(propertyName, newPropValue.ToString()); } }